summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2014-06-18 07:08:49 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2014-06-18 07:08:49 +0000
commit51b9d7b1384f0325cb34b76fc999ff78c7a79452 (patch)
tree326cbfaa9e8c2fee3da18aef9ba271cf84972b6e
parentebcdb1ed2f435e48584e4fad5a96a3d6abb1406f (diff)
downloadclang-51b9d7b1384f0325cb34b76fc999ff78c7a79452.tar.gz
clang-51b9d7b1384f0325cb34b76fc999ff78c7a79452.tar.bz2
clang-51b9d7b1384f0325cb34b76fc999ff78c7a79452.tar.xz
[OPENMP] Reformatting and code improvement.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211147 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Basic/OpenMPKinds.cpp55
-rw-r--r--lib/CodeGen/CGOpenMPRuntime.cpp21
-rw-r--r--lib/CodeGen/CGOpenMPRuntime.h8
-rw-r--r--lib/CodeGen/CGStmtOpenMP.cpp13
-rw-r--r--lib/Parse/ParseOpenMP.cpp2
-rw-r--r--lib/Sema/SemaOpenMP.cpp61
6 files changed, 86 insertions, 74 deletions
diff --git a/lib/Basic/OpenMPKinds.cpp b/lib/Basic/OpenMPKinds.cpp
index af537de67b..9b398a18d1 100644
--- a/lib/Basic/OpenMPKinds.cpp
+++ b/lib/Basic/OpenMPKinds.cpp
@@ -22,10 +22,9 @@ using namespace clang;
OpenMPDirectiveKind clang::getOpenMPDirectiveKind(StringRef Str) {
return llvm::StringSwitch<OpenMPDirectiveKind>(Str)
-#define OPENMP_DIRECTIVE(Name) \
- .Case(#Name, OMPD_##Name)
+#define OPENMP_DIRECTIVE(Name) .Case(#Name, OMPD_##Name)
#include "clang/Basic/OpenMPKinds.def"
- .Default(OMPD_unknown);
+ .Default(OMPD_unknown);
}
const char *clang::getOpenMPDirectiveName(OpenMPDirectiveKind Kind) {
@@ -33,8 +32,9 @@ const char *clang::getOpenMPDirectiveName(OpenMPDirectiveKind Kind) {
switch (Kind) {
case OMPD_unknown:
return "unknown";
-#define OPENMP_DIRECTIVE(Name) \
- case OMPD_##Name : return #Name;
+#define OPENMP_DIRECTIVE(Name) \
+ case OMPD_##Name: \
+ return #Name;
#include "clang/Basic/OpenMPKinds.def"
break;
}
@@ -43,10 +43,9 @@ const char *clang::getOpenMPDirectiveName(OpenMPDirectiveKind Kind) {
OpenMPClauseKind clang::getOpenMPClauseKind(StringRef Str) {
return llvm::StringSwitch<OpenMPClauseKind>(Str)
-#define OPENMP_CLAUSE(Name, Class) \
- .Case(#Name, OMPC_##Name)
+#define OPENMP_CLAUSE(Name, Class) .Case(#Name, OMPC_##Name)
#include "clang/Basic/OpenMPKinds.def"
- .Default(OMPC_unknown);
+ .Default(OMPC_unknown);
}
const char *clang::getOpenMPClauseName(OpenMPClauseKind Kind) {
@@ -54,8 +53,9 @@ const char *clang::getOpenMPClauseName(OpenMPClauseKind Kind) {
switch (Kind) {
case OMPC_unknown:
return "unknown";
-#define OPENMP_CLAUSE(Name, Class) \
- case OMPC_##Name : return #Name;
+#define OPENMP_CLAUSE(Name, Class) \
+ case OMPC_##Name: \
+ return #Name;
#include "clang/Basic/OpenMPKinds.def"
case OMPC_threadprivate:
return "threadprivate or thread local";
@@ -68,16 +68,14 @@ unsigned clang::getOpenMPSimpleClauseType(OpenMPClauseKind Kind,
switch (Kind) {
case OMPC_default:
return llvm::StringSwitch<OpenMPDefaultClauseKind>(Str)
-#define OPENMP_DEFAULT_KIND(Name) \
- .Case(#Name, OMPC_DEFAULT_##Name)
+#define OPENMP_DEFAULT_KIND(Name) .Case(#Name, OMPC_DEFAULT_##Name)
#include "clang/Basic/OpenMPKinds.def"
- .Default(OMPC_DEFAULT_unknown);
+ .Default(OMPC_DEFAULT_unknown);
case OMPC_proc_bind:
return llvm::StringSwitch<OpenMPProcBindClauseKind>(Str)
-#define OPENMP_PROC_BIND_KIND(Name) \
- .Case(#Name, OMPC_PROC_BIND_##Name)
+#define OPENMP_PROC_BIND_KIND(Name) .Case(#Name, OMPC_PROC_BIND_##Name)
#include "clang/Basic/OpenMPKinds.def"
- .Default(OMPC_PROC_BIND_unknown);
+ .Default(OMPC_PROC_BIND_unknown);
case OMPC_unknown:
case OMPC_threadprivate:
case OMPC_if:
@@ -104,8 +102,9 @@ const char *clang::getOpenMPSimpleClauseTypeName(OpenMPClauseKind Kind,
switch (Type) {
case OMPC_DEFAULT_unknown:
return "unknown";
-#define OPENMP_DEFAULT_KIND(Name) \
- case OMPC_DEFAULT_##Name : return #Name;
+#define OPENMP_DEFAULT_KIND(Name) \
+ case OMPC_DEFAULT_##Name: \
+ return #Name;
#include "clang/Basic/OpenMPKinds.def"
}
llvm_unreachable("Invalid OpenMP 'default' clause type");
@@ -113,8 +112,9 @@ const char *clang::getOpenMPSimpleClauseTypeName(OpenMPClauseKind Kind,
switch (Type) {
case OMPC_PROC_BIND_unknown:
return "unknown";
-#define OPENMP_PROC_BIND_KIND(Name) \
- case OMPC_PROC_BIND_##Name : return #Name;
+#define OPENMP_PROC_BIND_KIND(Name) \
+ case OMPC_PROC_BIND_##Name: \
+ return #Name;
#include "clang/Basic/OpenMPKinds.def"
}
llvm_unreachable("Invalid OpenMP 'proc_bind' clause type");
@@ -144,8 +144,9 @@ bool clang::isAllowedClauseForDirective(OpenMPDirectiveKind DKind,
switch (DKind) {
case OMPD_parallel:
switch (CKind) {
-#define OPENMP_PARALLEL_CLAUSE(Name) \
- case OMPC_##Name: return true;
+#define OPENMP_PARALLEL_CLAUSE(Name) \
+ case OMPC_##Name: \
+ return true;
#include "clang/Basic/OpenMPKinds.def"
default:
break;
@@ -153,8 +154,9 @@ bool clang::isAllowedClauseForDirective(OpenMPDirectiveKind DKind,
break;
case OMPD_simd:
switch (CKind) {
-#define OPENMP_SIMD_CLAUSE(Name) \
- case OMPC_##Name: return true;
+#define OPENMP_SIMD_CLAUSE(Name) \
+ case OMPC_##Name: \
+ return true;
#include "clang/Basic/OpenMPKinds.def"
default:
break;
@@ -162,8 +164,9 @@ bool clang::isAllowedClauseForDirective(OpenMPDirectiveKind DKind,
break;
case OMPD_for:
switch (CKind) {
-#define OPENMP_FOR_CLAUSE(Name) \
- case OMPC_##Name: return true;
+#define OPENMP_FOR_CLAUSE(Name) \
+ case OMPC_##Name: \
+ return true;
#include "clang/Basic/OpenMPKinds.def"
default:
break;
diff --git a/lib/CodeGen/CGOpenMPRuntime.cpp b/lib/CodeGen/CGOpenMPRuntime.cpp
index 8ff4c3c305..12a3a7790e 100644
--- a/lib/CodeGen/CGOpenMPRuntime.cpp
+++ b/lib/CodeGen/CGOpenMPRuntime.cpp
@@ -19,7 +19,7 @@
#include "llvm/IR/GlobalValue.h"
#include "llvm/IR/Value.h"
#include "llvm/Support/raw_ostream.h"
-#include <assert.h>
+#include <cassert>
using namespace clang;
using namespace CodeGen;
@@ -31,8 +31,8 @@ CGOpenMPRuntime::CGOpenMPRuntime(CodeGenModule &CGM)
CGM.Int32Ty /* reserved_2 */, CGM.Int32Ty /* reserved_3 */,
CGM.Int8PtrTy /* psource */, NULL);
// Build void (*kmpc_micro)(kmp_int32 *global_tid, kmp_int32 *bound_tid,...)
- llvm::Type *MicroParams[] = { llvm::PointerType::getUnqual(CGM.Int32Ty),
- llvm::PointerType::getUnqual(CGM.Int32Ty) };
+ llvm::Type *MicroParams[] = {llvm::PointerType::getUnqual(CGM.Int32Ty),
+ llvm::PointerType::getUnqual(CGM.Int32Ty)};
Kmpc_MicroTy = llvm::FunctionType::get(CGM.VoidTy, MicroParams, true);
}
@@ -57,10 +57,9 @@ CGOpenMPRuntime::GetOrCreateDefaultOpenMPLocation(OpenMPLocationFlags Flags) {
DefaultOpenMPLocation->setLinkage(llvm::GlobalValue::PrivateLinkage);
llvm::Constant *Zero = llvm::ConstantInt::get(CGM.Int32Ty, 0, true);
- llvm::Constant *Values[] = {
- Zero, llvm::ConstantInt::get(CGM.Int32Ty, Flags), Zero,
- Zero, DefaultOpenMPPSource
- };
+ llvm::Constant *Values[] = {Zero,
+ llvm::ConstantInt::get(CGM.Int32Ty, Flags),
+ Zero, Zero, DefaultOpenMPPSource};
llvm::Constant *Init = llvm::ConstantStruct::get(IdentTy, Values);
DefaultOpenMPLocation->setInitializer(Init);
return DefaultOpenMPLocation;
@@ -132,7 +131,7 @@ llvm::Value *CGOpenMPRuntime::GetOpenMPGlobalThreadNum(CodeGenFunction &CGF,
// Generate "int32 .kmpc_global_thread_num.addr;"
CGBuilderTy::InsertPointGuard IPG(CGF.Builder);
CGF.Builder.SetInsertPoint(CGF.AllocaInsertPt);
- llvm::Value *Args[] = { EmitOpenMPUpdateLocation(CGF, Loc) };
+ llvm::Value *Args[] = {EmitOpenMPUpdateLocation(CGF, Loc)};
GTid = CGF.EmitRuntimeCall(
CreateRuntimeFunction(OMPRTL__kmpc_global_thread_num), Args);
OpenMPGtidMap[CGF.CurFn] = GTid;
@@ -163,8 +162,8 @@ CGOpenMPRuntime::CreateRuntimeFunction(OpenMPRTLFunction Function) {
case OMPRTL__kmpc_fork_call: {
// Build void __kmpc_fork_call(ident_t *loc, kmp_int32 argc, kmpc_micro
// microtask, ...);
- llvm::Type *TypeParams[] = { getIdentTyPointerTy(), CGM.Int32Ty,
- getKmpc_MicroPointerTy() };
+ llvm::Type *TypeParams[] = {getIdentTyPointerTy(), CGM.Int32Ty,
+ getKmpc_MicroPointerTy()};
llvm::FunctionType *FnTy =
llvm::FunctionType::get(CGM.VoidTy, TypeParams, true);
RTLFn = CGM.CreateRuntimeFunction(FnTy, "__kmpc_fork_call");
@@ -172,7 +171,7 @@ CGOpenMPRuntime::CreateRuntimeFunction(OpenMPRTLFunction Function) {
}
case OMPRTL__kmpc_global_thread_num: {
// Build kmp_int32 __kmpc_global_thread_num(ident_t *loc);
- llvm::Type *TypeParams[] = { getIdentTyPointerTy() };
+ llvm::Type *TypeParams[] = {getIdentTyPointerTy()};
llvm::FunctionType *FnTy =
llvm::FunctionType::get(CGM.Int32Ty, TypeParams, false);
RTLFn = CGM.CreateRuntimeFunction(FnTy, "__kmpc_global_thread_num");
diff --git a/lib/CodeGen/CGOpenMPRuntime.h b/lib/CodeGen/CGOpenMPRuntime.h
index 368c2d897a..862e8a148c 100644
--- a/lib/CodeGen/CGOpenMPRuntime.h
+++ b/lib/CodeGen/CGOpenMPRuntime.h
@@ -31,7 +31,7 @@ class FunctionType;
class StructType;
class Type;
class Value;
-}
+} // namespace llvm
namespace clang {
@@ -136,7 +136,7 @@ private:
OpenMPGtidMapTy OpenMPGtidMap;
public:
- CGOpenMPRuntime(CodeGenModule &CGM);
+ explicit CGOpenMPRuntime(CodeGenModule &CGM);
~CGOpenMPRuntime() {}
/// \brief Cleans up references to the objects in finished function.
@@ -171,7 +171,7 @@ public:
/// \return Specified function.
llvm::Constant *CreateRuntimeFunction(OpenMPRTLFunction Function);
};
-}
-}
+} // namespace CodeGen
+} // namespace clang
#endif
diff --git a/lib/CodeGen/CGStmtOpenMP.cpp b/lib/CodeGen/CGStmtOpenMP.cpp
index 9f915fa2d3..097d9a895c 100644
--- a/lib/CodeGen/CGStmtOpenMP.cpp
+++ b/lib/CodeGen/CGStmtOpenMP.cpp
@@ -38,13 +38,12 @@ void CodeGenFunction::EmitOMPParallelDirective(const OMPParallelDirective &S) {
// Build call __kmpc_fork_call(loc, 1, microtask, captured_struct/*context*/)
llvm::Value *Args[] = {
- CGM.getOpenMPRuntime().EmitOpenMPUpdateLocation(*this, S.getLocStart()),
- Builder.getInt32(1), // Number of arguments after 'microtask' argument
- // (there is only one additional argument - 'context')
- Builder.CreateBitCast(OutlinedFn,
- CGM.getOpenMPRuntime().getKmpc_MicroPointerTy()),
- EmitCastToVoidPtr(CapturedStruct)
- };
+ CGM.getOpenMPRuntime().EmitOpenMPUpdateLocation(*this, S.getLocStart()),
+ Builder.getInt32(1), // Number of arguments after 'microtask' argument
+ // (there is only one additional argument - 'context')
+ Builder.CreateBitCast(OutlinedFn,
+ CGM.getOpenMPRuntime().getKmpc_MicroPointerTy()),
+ EmitCastToVoidPtr(CapturedStruct)};
llvm::Constant *RTLFn = CGM.getOpenMPRuntime().CreateRuntimeFunction(
CGOpenMPRuntime::OMPRTL__kmpc_fork_call);
EmitRuntimeCall(RTLFn, Args);
diff --git a/lib/Parse/ParseOpenMP.cpp b/lib/Parse/ParseOpenMP.cpp
index 9ea1e7f838..97b708ba86 100644
--- a/lib/Parse/ParseOpenMP.cpp
+++ b/lib/Parse/ParseOpenMP.cpp
@@ -434,7 +434,7 @@ static bool ParseReductionId(Parser &P, CXXScopeSpec &ReductionIdScopeSpec,
}
if (OOK != OO_None) {
SourceLocation OpLoc = P.ConsumeToken();
- SourceLocation SymbolLocations[] = { OpLoc, OpLoc, SourceLocation() };
+ SourceLocation SymbolLocations[] = {OpLoc, OpLoc, SourceLocation()};
ReductionId.setOperatorFunctionId(OpLoc, OOK, SymbolLocations);
return false;
}
diff --git a/lib/Sema/SemaOpenMP.cpp b/lib/Sema/SemaOpenMP.cpp
index ffcfa10d77..56903ceee3 100644
--- a/lib/Sema/SemaOpenMP.cpp
+++ b/lib/Sema/SemaOpenMP.cpp
@@ -40,7 +40,7 @@ enum DefaultDataSharingAttributes {
DSA_shared = 1 << 1 /// \brief Default data sharing attribute 'shared'.
};
template <class T> struct MatchesAny {
- MatchesAny(ArrayRef<T> Arr) : Arr(Arr) {}
+ explicit MatchesAny(ArrayRef<T> Arr) : Arr(std::move(Arr)) {}
bool operator()(T Kind) {
for (auto KindEl : Arr)
if (KindEl == Kind)
@@ -51,15 +51,14 @@ template <class T> struct MatchesAny {
private:
ArrayRef<T> Arr;
};
-template <class T> struct MatchesAlways {
+struct MatchesAlways {
MatchesAlways() {}
+ template <class T>
bool operator()(T) { return true; }
};
typedef MatchesAny<OpenMPClauseKind> MatchesAnyClause;
typedef MatchesAny<OpenMPDirectiveKind> MatchesAnyDirective;
-typedef MatchesAlways<OpenMPClauseKind> MatchesAlwaysClause;
-typedef MatchesAlways<OpenMPDirectiveKind> MatchesAlwaysDirective;
/// \brief Stack for tracking declarations used in OpenMP directives and
/// clauses and their data-sharing attributes.
@@ -355,7 +354,7 @@ DSAStackTy::DSAVarData DSAStackTy::getTopDSA(VarDecl *D) {
// Variables with const-qualified type having no mutable member may be
// listed in a firstprivate clause, even if they are static data members.
DSAVarData DVarTemp = hasDSA(D, MatchesAnyClause(OMPC_firstprivate),
- MatchesAlwaysDirective());
+ MatchesAlways());
if (DVarTemp.CKind == OMPC_firstprivate && DVarTemp.RefExpr)
return DVar;
@@ -380,7 +379,7 @@ DSAStackTy::DSAVarData DSAStackTy::getTopDSA(VarDecl *D) {
// Variables with const-qualified type having no mutable member may be
// listed in a firstprivate clause, even if they are static data members.
DSAVarData DVarTemp = hasDSA(D, MatchesAnyClause(OMPC_firstprivate),
- MatchesAlwaysDirective());
+ MatchesAlways());
if (DVarTemp.CKind == OMPC_firstprivate && DVarTemp.RefExpr)
return DVar;
@@ -476,7 +475,9 @@ void Sema::EndOpenMPDSABlock(Stmt *CurDirective) {
if (Type->isArrayType())
Type = QualType(Type->getArrayElementTypeNoTypeQual(), 0);
CXXRecordDecl *RD =
- getLangOpts().CPlusPlus ? Type->getAsCXXRecordDecl() : 0;
+ getLangOpts().CPlusPlus ? Type->getAsCXXRecordDecl() : nullptr;
+ // FIXME This code must be replaced by actual constructing of the
+ // lastprivate variable.
if (RD) {
CXXConstructorDecl *CD = LookupDefaultConstructor(RD);
PartialDiagnostic PD =
@@ -517,7 +518,7 @@ private:
Sema &Actions;
public:
- VarDeclFilterCCC(Sema &S) : Actions(S) {}
+ explicit VarDeclFilterCCC(Sema &S) : Actions(S) {}
bool ValidateCandidate(const TypoCorrection &Candidate) override {
NamedDecl *ND = Candidate.getCorrectionDecl();
if (VarDecl *VD = dyn_cast_or_null<VarDecl>(ND)) {
@@ -690,7 +691,7 @@ public:
}
return false;
}
- LocalVarRefChecker(Sema &SemaRef) : SemaRef(SemaRef) {}
+ explicit LocalVarRefChecker(Sema &SemaRef) : SemaRef(SemaRef) {}
};
} // namespace
@@ -794,7 +795,7 @@ public:
// enclosing worksharing or parallel construct may not be accessed in an
// explicit task.
DVar = Stack->hasInnermostDSA(VD, MatchesAnyClause(OMPC_reduction),
- MatchesAlwaysDirective());
+ MatchesAlways());
if (DKind == OMPD_task && DVar.CKind == OMPC_reduction) {
ErrorFound = true;
Actions.Diag(ELoc, diag::err_omp_reduction_in_task);
@@ -1135,7 +1136,7 @@ bool OpenMPIterationSpaceChecker::CheckInit(Stmt *S) {
return true;
}
-/// \brief Ignore parenthesises, implicit casts, copy constructor and return the
+/// \brief Ignore parenthesizes, implicit casts, copy constructor and return the
/// variable (which may be the loop variable) if possible.
static const VarDecl *GetInitVarDecl(const Expr *E) {
if (!E)
@@ -1301,7 +1302,7 @@ bool OpenMPIterationSpaceChecker::CheckInc(Expr *S) {
<< S->getSourceRange() << Var;
return true;
}
-}
+} // namespace
/// \brief Called on a for stmt to check and extract its iteration space
/// for further processing (such as collapsing).
@@ -1762,9 +1763,8 @@ OMPClause *Sema::ActOnOpenMPVarListClause(
Res = ActOnOpenMPSharedClause(VarList, StartLoc, LParenLoc, EndLoc);
break;
case OMPC_reduction:
- Res =
- ActOnOpenMPReductionClause(VarList, StartLoc, LParenLoc, ColonLoc,
- EndLoc, ReductionIdScopeSpec, ReductionId);
+ Res = ActOnOpenMPReductionClause(VarList, StartLoc, LParenLoc, ColonLoc,
+ EndLoc, ReductionIdScopeSpec, ReductionId);
break;
case OMPC_linear:
Res = ActOnOpenMPLinearClause(VarList, TailExpr, StartLoc, LParenLoc,
@@ -1844,7 +1844,7 @@ OMPClause *Sema::ActOnOpenMPPrivateClause(ArrayRef<Expr *> VarList,
// OpenMP [2.9.3.3, Restrictions, C/C++, p.1]
// A variable of class type (or array thereof) that appears in a private
- // clause requires an accesible, unambiguous default constructor for the
+ // clause requires an accessible, unambiguous default constructor for the
// class type.
while (Type.getNonReferenceType()->isArrayType()) {
Type = cast<ArrayType>(Type.getNonReferenceType().getTypePtr())
@@ -1853,6 +1853,8 @@ OMPClause *Sema::ActOnOpenMPPrivateClause(ArrayRef<Expr *> VarList,
CXXRecordDecl *RD = getLangOpts().CPlusPlus
? Type.getNonReferenceType()->getAsCXXRecordDecl()
: nullptr;
+ // FIXME This code must be replaced by actual constructing/destructing of
+ // the private variable.
if (RD) {
CXXConstructorDecl *CD = LookupDefaultConstructor(RD);
PartialDiagnostic PD =
@@ -1979,12 +1981,14 @@ OMPClause *Sema::ActOnOpenMPFirstprivateClause(ArrayRef<Expr *> VarList,
// OpenMP [2.9.3.4, Restrictions, C/C++, p.1]
// A variable of class type (or array thereof) that appears in a private
- // clause requires an accesible, unambiguous copy constructor for the
+ // clause requires an accessible, unambiguous copy constructor for the
// class type.
Type = Context.getBaseElementType(Type);
CXXRecordDecl *RD = getLangOpts().CPlusPlus
? Type.getNonReferenceType()->getAsCXXRecordDecl()
: nullptr;
+ // FIXME This code must be replaced by actual constructing/destructing of
+ // the firstprivate variable.
if (RD) {
CXXConstructorDecl *CD = LookupCopyingConstructor(RD, 0);
PartialDiagnostic PD =
@@ -2222,6 +2226,8 @@ OMPClause *Sema::ActOnOpenMPLastprivateClause(ArrayRef<Expr *> VarList,
CXXRecordDecl *RD = getLangOpts().CPlusPlus
? Type.getNonReferenceType()->getAsCXXRecordDecl()
: nullptr;
+ // FIXME This code must be replaced by actual copying and destructing of the
+ // lastprivate variable.
if (RD) {
CXXMethodDecl *MD = LookupCopyingAssignment(RD, 0, false, 0);
DeclAccessPair FoundDecl = DeclAccessPair::make(MD, MD->getAccess());
@@ -2350,7 +2356,7 @@ public:
if (DVar.CKind != OMPC_unknown)
return true;
DSAStackTy::DSAVarData DVarPrivate =
- Stack->hasDSA(VD, isOpenMPPrivate, MatchesAlwaysDirective());
+ Stack->hasDSA(VD, isOpenMPPrivate, MatchesAlways());
if (DVarPrivate.CKind != OMPC_unknown)
return true;
return false;
@@ -2364,9 +2370,9 @@ public:
}
return false;
}
- DSARefChecker(DSAStackTy *S) : Stack(S) {}
+ explicit DSARefChecker(DSAStackTy *S) : Stack(S) {}
};
-}
+} // namespace
OMPClause *Sema::ActOnOpenMPReductionClause(
ArrayRef<Expr *> VarList, SourceLocation StartLoc, SourceLocation LParenLoc,
@@ -2548,7 +2554,7 @@ OMPClause *Sema::ActOnOpenMPReductionClause(
getDiagnostics().setSuppressAllDiagnostics(Suppress);
if (ReductionOp.isInvalid()) {
Diag(ELoc, diag::err_omp_reduction_id_not_compatible) << Type
- << ReductionIdRange;
+ << ReductionIdRange;
bool IsDecl =
VD->isThisDeclarationADefinition(Context) == VarDecl::DeclarationOnly;
Diag(VD->getLocation(),
@@ -2611,13 +2617,16 @@ OMPClause *Sema::ActOnOpenMPReductionClause(
CXXRecordDecl *RD = getLangOpts().CPlusPlus
? Type.getNonReferenceType()->getAsCXXRecordDecl()
: nullptr;
+ // FIXME This code must be replaced by actual constructing/destructing of
+ // the reduction variable.
if (RD) {
CXXConstructorDecl *CD = LookupDefaultConstructor(RD);
PartialDiagnostic PD =
PartialDiagnostic(PartialDiagnostic::NullDiagnostic());
- if (!CD || CheckConstructorAccess(
- ELoc, CD, InitializedEntity::InitializeTemporary(Type),
- CD->getAccess(), PD) == AR_inaccessible ||
+ if (!CD ||
+ CheckConstructorAccess(ELoc, CD,
+ InitializedEntity::InitializeTemporary(Type),
+ CD->getAccess(), PD) == AR_inaccessible ||
CD->isDeleted()) {
Diag(ELoc, diag::err_omp_required_method)
<< getOpenMPClauseName(OMPC_reduction) << 0;
@@ -2911,11 +2920,13 @@ OMPClause *Sema::ActOnOpenMPCopyinClause(ArrayRef<Expr *> VarList,
// OpenMP [2.14.4.1, Restrictions, C/C++, p.2]
// A variable of class type (or array thereof) that appears in a
- // copyin clause requires an accesible, unambiguous copy assignment
+ // copyin clause requires an accessible, unambiguous copy assignment
// operator for the class type.
Type = Context.getBaseElementType(Type);
CXXRecordDecl *RD =
getLangOpts().CPlusPlus ? Type->getAsCXXRecordDecl() : nullptr;
+ // FIXME This code must be replaced by actual assignment of the
+ // threadprivate variable.
if (RD) {
CXXMethodDecl *MD = LookupCopyingAssignment(RD, 0, false, 0);
DeclAccessPair FoundDecl = DeclAccessPair::make(MD, MD->getAccess());