OpenMPDirectiveKind DKind;
OpenMPClauseKind CKind;
DeclRefExpr *RefExpr;
- DSAVarData() : DKind(OMPD_unknown), CKind(OMPC_unknown), RefExpr(0) { }
+ DSAVarData() : DKind(OMPD_unknown), CKind(OMPC_unknown), RefExpr(nullptr) {}
};
private:
struct DSAInfo {
OpenMPDirectiveKind Directive;
DeclarationNameInfo DirectiveName;
Scope *CurScope;
- SharingMapTy(OpenMPDirectiveKind DKind,
- const DeclarationNameInfo &Name,
+ SharingMapTy(OpenMPDirectiveKind DKind, const DeclarationNameInfo &Name,
Scope *CurScope)
- : SharingMap(), DefaultAttr(DSA_unspecified), Directive(DKind),
- DirectiveName(Name), CurScope(CurScope) { }
+ : SharingMap(), DefaultAttr(DSA_unspecified), Directive(DKind),
+ DirectiveName(Name), CurScope(CurScope) {}
SharingMapTy()
- : SharingMap(), DefaultAttr(DSA_unspecified),
- Directive(OMPD_unknown), DirectiveName(),
- CurScope(0) { }
+ : SharingMap(), DefaultAttr(DSA_unspecified), Directive(OMPD_unknown),
+ DirectiveName(), CurScope(nullptr) {}
};
typedef SmallVector<SharingMapTy, 64> StackTy;
// firstprivate.
DVarTemp = getDSA(I, D);
if (DVarTemp.CKind != OMPC_shared) {
- DVar.RefExpr = 0;
+ DVar.RefExpr = nullptr;
DVar.DKind = OMPD_task;
DVar.CKind = OMPC_firstprivate;
return DVar;
DSAStackTy::isOpenMPLocal(VarDecl *D, StackTy::reverse_iterator Iter) {
if (Stack.size() > 2) {
reverse_iterator I = Iter, E = Stack.rend() - 1;
- Scope *TopScope = 0;
+ Scope *TopScope = nullptr;
while (I != E && I->Directive != OMPD_parallel) {
++I;
}
if (I == E) return false;
- TopScope = I->CurScope ? I->CurScope->getParent() : 0;
+ TopScope = I->CurScope ? I->CurScope->getParent() : nullptr;
Scope *CurScope = getCurScope();
while (CurScope != TopScope && !CurScope->isDeclScope(D)) {
CurScope = CurScope->getParent();
// in a Construct, C/C++, predetermined, p.6]
// Variables with const qualified type having no mutable member are
// shared.
- CXXRecordDecl *RD = Actions.getLangOpts().CPlusPlus ?
- Type->getAsCXXRecordDecl() : 0;
+ CXXRecordDecl *RD =
+ Actions.getLangOpts().CPlusPlus ? Type->getAsCXXRecordDecl() : nullptr;
if (IsConstant &&
!(Actions.getLangOpts().CPlusPlus && RD && RD->hasMutableFields())) {
// Variables with const-qualified type having no mutable member may be
VarDecl *VD;
if (!Lookup.isSingleResult()) {
VarDeclFilterCCC Validator(*this);
- if (TypoCorrection Corrected = CorrectTypo(Id, LookupOrdinaryName, CurScope,
- 0, Validator, CTK_ErrorRecovery)) {
+ if (TypoCorrection Corrected =
+ CorrectTypo(Id, LookupOrdinaryName, CurScope, nullptr, Validator,
+ CTK_ErrorRecovery)) {
diagnoseTypo(Corrected,
- PDiag(Lookup.empty()? diag::err_undeclared_var_use_suggest
- : diag::err_omp_expected_var_arg_suggest)
- << Id.getName());
+ PDiag(Lookup.empty()
+ ? diag::err_undeclared_var_use_suggest
+ : diag::err_omp_expected_var_arg_suggest)
+ << Id.getName());
VD = Corrected.getCorrectionDeclAs<VarDecl>();
} else {
Diag(Id.getLoc(), Lookup.empty() ? diag::err_undeclared_var_use
Vars.push_back(*I);
DSAStack->addDSA(VD, DE, OMPC_threadprivate);
}
- OMPThreadPrivateDecl *D = 0;
+ OMPThreadPrivateDecl *D = nullptr;
if (!Vars.empty()) {
D = OMPThreadPrivateDecl::Create(Context, getCurLexicalContext(), Loc,
Vars);
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) {
- OMPClause *Res = 0;
+ OMPClause *Res = nullptr;
switch (Kind) {
case OMPC_if:
Res = ActOnOpenMPIfClause(Expr, StartLoc, LParenLoc, EndLoc);
Condition->getExprLoc(),
Condition);
if (Val.isInvalid())
- return 0;
+ return nullptr;
ValExpr = Val.take();
}
ExprResult Val =
PerformImplicitIntegerConversion(NumThreadsLoc, NumThreads);
if (Val.isInvalid())
- return 0;
+ return nullptr;
ValExpr = Val.take();
Result.isSigned() && !Result.isStrictlyPositive()) {
Diag(NumThreadsLoc, diag::err_omp_negative_expression_in_clause)
<< "num_threads" << NumThreads->getSourceRange();
- return 0;
+ return nullptr;
}
}
// positive integer expression.
ExprResult Safelen = VerifyPositiveIntegerConstantInClause(Len, OMPC_safelen);
if (Safelen.isInvalid())
- return 0;
+ return nullptr;
return new (Context)
OMPSafelenClause(Safelen.take(), StartLoc, LParenLoc, EndLoc);
}
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc) {
- OMPClause *Res = 0;
+ OMPClause *Res = nullptr;
switch (Kind) {
case OMPC_default:
Res =
}
Diag(KindKwLoc, diag::err_omp_unexpected_clause_value)
<< Values << getOpenMPClauseName(OMPC_default);
- return 0;
+ return nullptr;
}
switch (Kind) {
case OMPC_DEFAULT_none:
}
Diag(KindKwLoc, diag::err_omp_unexpected_clause_value)
<< Values << getOpenMPClauseName(OMPC_proc_bind);
- return 0;
+ return nullptr;
}
return new (Context) OMPProcBindClause(Kind, KindKwLoc, StartLoc, LParenLoc,
EndLoc);
SourceLocation LParenLoc,
SourceLocation ColonLoc,
SourceLocation EndLoc) {
- OMPClause *Res = 0;
+ OMPClause *Res = nullptr;
switch (Kind) {
case OMPC_private:
Res = ActOnOpenMPPrivateClause(VarList, StartLoc, LParenLoc, EndLoc);
Type = cast<ArrayType>(
Type.getNonReferenceType().getTypePtr())->getElementType();
}
- CXXRecordDecl *RD = getLangOpts().CPlusPlus ?
- Type.getNonReferenceType()->getAsCXXRecordDecl() : 0;
+ CXXRecordDecl *RD = getLangOpts().CPlusPlus
+ ? Type.getNonReferenceType()->getAsCXXRecordDecl()
+ : nullptr;
if (RD) {
CXXConstructorDecl *CD = LookupDefaultConstructor(RD);
PartialDiagnostic PD =
Vars.push_back(DE);
}
- if (Vars.empty()) return 0;
+ if (Vars.empty()) return nullptr;
return OMPPrivateClause::Create(Context, StartLoc, LParenLoc, EndLoc, Vars);
}
// clause requires an accesible, unambiguous copy constructor for the
// class type.
Type = Context.getBaseElementType(Type);
- CXXRecordDecl *RD = getLangOpts().CPlusPlus ?
- Type.getNonReferenceType()->getAsCXXRecordDecl() : 0;
+ CXXRecordDecl *RD = getLangOpts().CPlusPlus
+ ? Type.getNonReferenceType()->getAsCXXRecordDecl()
+ : nullptr;
if (RD) {
CXXConstructorDecl *CD = LookupCopyingConstructor(RD, 0);
PartialDiagnostic PD =
Vars.push_back(DE);
}
- if (Vars.empty()) return 0;
+ if (Vars.empty()) return nullptr;
return OMPFirstprivateClause::Create(Context, StartLoc, LParenLoc, EndLoc,
Vars);
Vars.push_back(DE);
}
- if (Vars.empty()) return 0;
+ if (Vars.empty()) return nullptr;
return OMPSharedClause::Create(Context, StartLoc, LParenLoc, EndLoc, Vars);
}
}
if (Vars.empty())
- return 0;
+ return nullptr;
Expr *StepExpr = Step;
if (Step && !Step->isValueDependent() && !Step->isTypeDependent() &&
SourceLocation StepLoc = Step->getLocStart();
ExprResult Val = PerformImplicitIntegerConversion(StepLoc, Step);
if (Val.isInvalid())
- return 0;
+ return nullptr;
StepExpr = Val.take();
// Warn about zero linear step (it would be probably better specified as
// copyin clause requires an accesible, unambiguous copy assignment
// operator for the class type.
Type = Context.getBaseElementType(Type);
- CXXRecordDecl *RD = getLangOpts().CPlusPlus ?
- Type->getAsCXXRecordDecl() : 0;
+ CXXRecordDecl *RD =
+ getLangOpts().CPlusPlus ? Type->getAsCXXRecordDecl() : nullptr;
if (RD) {
CXXMethodDecl *MD = LookupCopyingAssignment(RD, 0, false, 0);
DeclAccessPair FoundDecl = DeclAccessPair::make(MD, MD->getAccess());
Vars.push_back(DE);
}
- if (Vars.empty()) return 0;
+ if (Vars.empty()) return nullptr;
return OMPCopyinClause::Create(Context, StartLoc, LParenLoc, EndLoc, Vars);
}