Commit 22caf9f7 authored by Michael Kruse's avatar Michael Kruse
Browse files

fix check-clang

parent c6117c91
......@@ -7554,7 +7554,7 @@ class OMPSizesClause final
/// Build an empty clause.
explicit OMPSizesClause(int NumSizes)
: OMPClause(OMPC_sizes, SourceLocation(), SourceLocation()),
: OMPClause(llvm::omp::OMPC_sizes, SourceLocation(), SourceLocation()),
NumSizes(NumSizes) {}
public:
......@@ -7623,7 +7623,7 @@ public:
}
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_sizes;
return T->getClauseKind() == llvm::omp::OMPC_sizes;
}
};
......
......@@ -66,7 +66,6 @@
# define OPENMP_TILE_CLAUSE(Name)
#endif
OPENMP_CLAUSE(sizes, OMPSizesClause)
// Static attributes for 'schedule' clause.
OPENMP_SCHEDULE_KIND(static)
OPENMP_SCHEDULE_KIND(dynamic)
......
......@@ -433,16 +433,7 @@ const char *clang::getOpenMPSimpleClauseTypeName(OpenMPClauseKind Kind,
llvm_unreachable("Invalid OpenMP simple clause kind");
}
case OMPD_tile:
switch (CKind) {
#define OPENMP_TILE_CLAUSE(Name) \
case OMPC_##Name: \
return true;
#include "clang/Basic/OpenMPKinds.def"
default:
break;
}
break;
bool clang::isOpenMPLoopDirective(OpenMPDirectiveKind DKind) {
return DKind == OMPD_simd || DKind == OMPD_for || DKind == OMPD_for_simd ||
DKind == OMPD_parallel_for || DKind == OMPD_parallel_for_simd ||
......
......@@ -2321,7 +2321,7 @@ Parser::ParseOpenMPDeclarativeOrExecutableDirective(ParsedStmtContext StmtCtx) {
HasAssociatedStatement = false;
}
if (DKind == OMPD_tile && !FirstClauses[OMPC_sizes].getInt()) {
if (DKind == OMPD_tile && !FirstClauses[unsigned(OMPC_sizes)].getInt()) {
Diag(Loc, diag::err_omp_required_clause)
<< getOpenMPDirectiveName(OMPD_tile) << "sizes";
ErrorFound = true;
......
......@@ -35,6 +35,7 @@
#include "llvm/ADT/IndexedMap.h"
#include "llvm/ADT/PointerEmbeddedInt.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Frontend/OpenMP/OMPConstants.h"
#include <set>
 
......@@ -6962,8 +6963,8 @@ static Expr *
calculateNumIters(Sema &SemaRef, Scope *S, SourceLocation DefaultLoc,
Expr *Lower, Expr *Upper, Expr *Step, QualType LCTy,
bool TestIsStrictOp, bool RoundToStep,
llvm::MapVector<const Expr *, DeclRefExpr *> &Captures) {
ExprResult NewStep = tryBuildCapture(SemaRef, Step, Captures);
llvm::MapVector<const Expr *, DeclRefExpr *> &Captures, bool Capturing) {
ExprResult NewStep = tryBuildCapture(SemaRef, Step, Captures, Capturing);
if (!NewStep.isUsable())
return nullptr;
llvm::APSInt LRes, URes, SRes;
......@@ -7173,8 +7174,8 @@ Expr *OpenMPIterationSpaceChecker::buildNumIterations(
if (!LBMaxVal.isUsable())
return nullptr;
 
Expr *LBMin = tryBuildCapture(SemaRef, LBMinVal.get(), Captures, Capturin).get();
Expr *LBMax = tryBuildCapture(SemaRef, LBMaxVal.get(), Captures, Capturin).get();
Expr *LBMin = tryBuildCapture(SemaRef, LBMinVal.get(), Captures, Capturing).get();
Expr *LBMax = tryBuildCapture(SemaRef, LBMaxVal.get(), Captures, Capturing).get();
if (!LBMin || !LBMax)
return nullptr;
// LB(MinVal) < LB(MaxVal)
......@@ -7293,7 +7294,7 @@ Expr *OpenMPIterationSpaceChecker::buildNumIterations(
 
ExprResult Diff =
calculateNumIters(SemaRef, S, DefaultLoc, Lower, Upper, Step, VarType,
TestIsStrictOp, /*RoundToStep=*/true, Captures);
TestIsStrictOp, /*RoundToStep=*/true, Captures, Capturing);
if (!Diff.isUsable())
return nullptr;
 
......@@ -7373,7 +7374,7 @@ std::pair<Expr *, Expr *> OpenMPIterationSpaceChecker::buildMinMaxValues(
 
ExprResult Diff =
calculateNumIters(SemaRef, S, DefaultLoc, Lower, Upper, Step, VarType,
TestIsStrictOp, /*RoundToStep=*/false, Captures);
TestIsStrictOp, /*RoundToStep=*/false, Captures, Capturing);
if (!Diff.isUsable())
return std::make_pair(nullptr, nullptr);
 
......@@ -7565,7 +7566,7 @@ Expr *OpenMPIterationSpaceChecker::buildOrderedLoopData(
 
ExprResult Diff = calculateNumIters(SemaRef, S, DefaultLoc, Lower, Upper,
Step, VarType, /*TestIsStrictOp=*/false,
/*RoundToStep=*/false, Captures);
/*RoundToStep=*/false, Captures, Capturing);
if (!Diff.isUsable())
return nullptr;
 
......
......@@ -11982,7 +11982,7 @@ OMPClause *OMPClauseReader::readClause() {
case llvm::omp::OMPC_detach:
C = new (Context) OMPDetachClause();
break;
case OMPC_sizes: {
case llvm::omp::OMPC_sizes: {
unsigned NumSizes = Record.readInt();
C = OMPSizesClause::CreateEmpty(Context, NumSizes);
break;
......
This diff is collapsed.
......@@ -38,6 +38,7 @@ def OMPC_NumThreads : Clause<"num_threads"> {
let clangClass = "OMPNumThreadsClause";
}
def OMPC_SafeLen : Clause<"safelen"> { let clangClass = "OMPSafelenClause"; }
def OMPC_Sizes: Clause<"sizes"> { let clangClass = "OMPClauseClause"; }
def OMPC_SimdLen : Clause<"simdlen"> { let clangClass = "OMPSimdlenClause"; }
def OMPC_Collapse : Clause<"collapse"> { let clangClass = "OMPCollapseClause"; }
def OMPC_Default : Clause<"default"> { let clangClass = "OMPDefaultClause"; }
......@@ -210,6 +211,9 @@ def OMP_Simd : Directive<"simd"> {
OMPC_Aligned, OMPC_SafeLen, OMPC_SimdLen, OMPC_Collapse, OMPC_Reduction,
OMPC_Allocate, OMPC_If, OMPC_NonTemporal, OMPC_Order];
}
def OMP_Tile : Directive<"tile"> {
let allowedClauses = [OMPC_Sizes];
}
def OMP_For : Directive<"for"> {
let allowedClauses = [OMPC_Private, OMPC_LastPrivate, OMPC_FirstPrivate,
OMPC_Reduction, OMPC_Collapse, OMPC_Schedule, OMPC_Ordered, OMPC_NoWait,
......
......@@ -198,6 +198,7 @@ __OMP_CLAUSE(detach, OMPDetachClause)
__OMP_CLAUSE(inclusive, OMPInclusiveClause)
__OMP_CLAUSE(exclusive, OMPExclusiveClause)
__OMP_CLAUSE(uses_allocators, OMPUsesAllocatorsClause)
__OMP_CLAUSE(sizes, OMPSizesClause)
__OMP_CLAUSE(affinity, OMPAffinityClause)
__OMP_CLAUSE(use_device_addr, OMPUseDeviceAddrClause)
......@@ -1218,6 +1219,8 @@ __OMP_DIRECTIVE_CLAUSE(for_simd, 50, ~0, if)
__OMP_DIRECTIVE_CLAUSE(for_simd, 50, ~0, nontemporal)
__OMP_DIRECTIVE_CLAUSE(for_simd, 50, ~0, order)
__OMP_DIRECTIVE_CLAUSE(tile, 1, ~0, sizes)
__OMP_DIRECTIVE_CLAUSE(sections, 1, ~0, private)
__OMP_DIRECTIVE_CLAUSE(sections, 1, ~0, lastprivate)
__OMP_DIRECTIVE_CLAUSE(sections, 1, ~0, firstprivate)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment