Skip to content

Commit 7a4eccd

Browse files
Merge branch 'main' into fix-deque-const_iterator
2 parents 94dbfb4 + 1bf1e6e commit 7a4eccd

File tree

6 files changed

+17
-63
lines changed

6 files changed

+17
-63
lines changed

clang/lib/Parse/ParseTentative.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,7 +1171,6 @@ Parser::isCXXDeclarationSpecifier(ImplicitTypenameContext AllowImplicitTypename,
11711171
case tok::kw_inline:
11721172
case tok::kw_virtual:
11731173
case tok::kw_explicit:
1174-
case tok::kw__Noreturn:
11751174

11761175
// Modules
11771176
case tok::kw___module_private__:
@@ -1226,7 +1225,6 @@ Parser::isCXXDeclarationSpecifier(ImplicitTypenameContext AllowImplicitTypename,
12261225
// GNU
12271226
case tok::kw_restrict:
12281227
case tok::kw__Complex:
1229-
case tok::kw__Imaginary:
12301228
case tok::kw___attribute:
12311229
case tok::kw___auto_type:
12321230
return TPResult::True;

clang/test/Interpreter/disambiguate-decl-stmt.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,3 @@ __attribute((noreturn)) Attrs2::Attrs2() = default;
102102

103103
// Extra semicolon
104104
namespace N {};
105-
106-
// Test C keywords supported in all language modes.
107-
// https://clang.llvm.org/docs/LanguageExtensions.html#c-keywords-supported-in-all-language-modes
108-
109-
_Alignas(16) int aligned_var;
110-
int align = _Alignof(double);
111-
_Atomic int atomic_var = 0;
112-
_Complex double complex_val = 1.0 + 2.0i;
113-
_Float16 f = 1.5;
114-
_Thread_local int counter = 0;
115-
_Static_assert(sizeof(int) == 4, "int must be 4 bytes");
116-
_Imaginary float i = 2.0f; // expected-error {{imaginary types are not supported}}
117-
_Noreturn void noreturn_func() { while (true) {} }

flang/lib/Semantics/check-omp-structure.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4420,6 +4420,13 @@ void OmpStructureChecker::Enter(const parser::OmpClause::Depend &x) {
44204420
CheckDoacross(*doaDep);
44214421
CheckDependenceType(doaDep->GetDepType());
44224422
} else {
4423+
using Modifier = parser::OmpDependClause::TaskDep::Modifier;
4424+
auto &modifiers{std::get<std::optional<std::list<Modifier>>>(taskDep->t)};
4425+
if (!modifiers) {
4426+
context_.Say(GetContext().clauseSource,
4427+
"A DEPEND clause on a TASK construct must have a valid task dependence type"_err_en_US);
4428+
return;
4429+
}
44234430
CheckTaskDependenceType(taskDep->GetTaskDepType());
44244431
}
44254432

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
! RUN: %python %S/../test_errors.py %s %flang -fopenmp
2+
3+
program test
4+
! ERROR: A DEPEND clause on a TASK construct must have a valid task dependence type
5+
!$omp task depend(ii)
6+
!$omp end task
7+
end
8+

llvm/include/llvm/IR/PatternMatch.h

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3046,35 +3046,8 @@ inline InsertValue_match<Ind, Val_t, Elt_t> m_InsertValue(const Val_t &Val,
30463046
return InsertValue_match<Ind, Val_t, Elt_t>(Val, Elt);
30473047
}
30483048

3049-
/// Matches patterns for `vscale`. This can either be a call to `llvm.vscale` or
3050-
/// the constant expression
3051-
/// `ptrtoint(gep <vscale x 1 x i8>, <vscale x 1 x i8>* null, i32 1>`
3052-
/// under the right conditions determined by DataLayout.
3053-
struct VScaleVal_match {
3054-
template <typename ITy> bool match(ITy *V) const {
3055-
if (m_Intrinsic<Intrinsic::vscale>().match(V))
3056-
return true;
3057-
3058-
Value *Ptr;
3059-
if (m_PtrToInt(m_Value(Ptr)).match(V)) {
3060-
if (auto *GEP = dyn_cast<GEPOperator>(Ptr)) {
3061-
auto *DerefTy =
3062-
dyn_cast<ScalableVectorType>(GEP->getSourceElementType());
3063-
if (GEP->getNumIndices() == 1 && DerefTy &&
3064-
DerefTy->getElementType()->isIntegerTy(8) &&
3065-
m_Zero().match(GEP->getPointerOperand()) &&
3066-
m_SpecificInt(1).match(GEP->idx_begin()->get()))
3067-
return true;
3068-
}
3069-
}
3070-
3071-
return false;
3072-
}
3073-
};
3074-
3075-
inline VScaleVal_match m_VScale() {
3076-
return VScaleVal_match();
3077-
}
3049+
/// Matches a call to `llvm.vscale()`.
3050+
inline IntrinsicID_match m_VScale() { return m_Intrinsic<Intrinsic::vscale>(); }
30783051

30793052
template <typename Opnd0, typename Opnd1>
30803053
inline typename m_Intrinsic_Ty<Opnd0, Opnd1>::Ty

llvm/unittests/IR/PatternMatch.cpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2355,25 +2355,6 @@ TEST_F(PatternMatchTest, VectorLogicalSelects) {
23552355
EXPECT_FALSE(match(MixedTypeOr, m_LogicalOr(m_Value(), m_Value())));
23562356
}
23572357

2358-
TEST_F(PatternMatchTest, VScale) {
2359-
DataLayout DL = M->getDataLayout();
2360-
2361-
Type *VecTy = ScalableVectorType::get(IRB.getInt8Ty(), 1);
2362-
Value *NullPtrVec =
2363-
Constant::getNullValue(PointerType::getUnqual(VecTy->getContext()));
2364-
Value *GEP = IRB.CreateGEP(VecTy, NullPtrVec, IRB.getInt64(1));
2365-
Value *PtrToInt = IRB.CreatePtrToInt(GEP, DL.getIntPtrType(GEP->getType()));
2366-
EXPECT_TRUE(match(PtrToInt, m_VScale()));
2367-
2368-
Type *VecTy2 = ScalableVectorType::get(IRB.getInt8Ty(), 2);
2369-
Value *NullPtrVec2 =
2370-
Constant::getNullValue(PointerType::getUnqual(VecTy2->getContext()));
2371-
Value *GEP2 = IRB.CreateGEP(VecTy, NullPtrVec2, IRB.getInt64(1));
2372-
Value *PtrToInt2 =
2373-
IRB.CreatePtrToInt(GEP2, DL.getIntPtrType(GEP2->getType()));
2374-
EXPECT_TRUE(match(PtrToInt2, m_VScale()));
2375-
}
2376-
23772358
TEST_F(PatternMatchTest, NotForbidPoison) {
23782359
Type *ScalarTy = IRB.getInt8Ty();
23792360
Type *VectorTy = FixedVectorType::get(ScalarTy, 3);

0 commit comments

Comments
 (0)