diff options
Diffstat (limited to 'clang/lib/Sema/SemaAttr.cpp')
-rw-r--r-- | clang/lib/Sema/SemaAttr.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/clang/lib/Sema/SemaAttr.cpp b/clang/lib/Sema/SemaAttr.cpp index 6397487981b..7c182a1c648 100644 --- a/clang/lib/Sema/SemaAttr.cpp +++ b/clang/lib/Sema/SemaAttr.cpp @@ -109,7 +109,7 @@ bool PragmaPackStack::pop(IdentifierInfo *Name, bool IsReset) { /// FreePackedContext - Deallocate and null out PackContext. void Sema::FreePackedContext() { delete static_cast<PragmaPackStack*>(PackContext); - PackContext = 0; + PackContext = nullptr; } void Sema::AddAlignmentAttributesForRecord(RecordDecl *RD) { @@ -143,7 +143,7 @@ void Sema::AddMsStructLayoutForRecord(RecordDecl *RD) { void Sema::ActOnPragmaOptionsAlign(PragmaOptionsAlignKind Kind, SourceLocation PragmaLoc) { - if (PackContext == 0) + if (!PackContext) PackContext = new PragmaPackStack(); PragmaPackStack *Context = static_cast<PragmaPackStack*>(PackContext); @@ -155,14 +155,14 @@ void Sema::ActOnPragmaOptionsAlign(PragmaOptionsAlignKind Kind, case POAK_Native: case POAK_Power: case POAK_Natural: - Context->push(0); + Context->push(nullptr); Context->setAlignment(0); break; // Note that '#pragma options align=packed' is not equivalent to attribute // packed, it has a different precedence relative to attribute aligned. case POAK_Packed: - Context->push(0); + Context->push(nullptr); Context->setAlignment(1); break; @@ -172,14 +172,14 @@ void Sema::ActOnPragmaOptionsAlign(PragmaOptionsAlignKind Kind, Diag(PragmaLoc, diag::err_pragma_options_align_mac68k_target_unsupported); return; } - Context->push(0); + Context->push(nullptr); Context->setAlignment(PackStackEntry::kMac68kAlignmentSentinel); break; case POAK_Reset: // Reset just pops the top of the stack, or resets the current alignment to // default. - if (!Context->pop(0, /*IsReset=*/true)) { + if (!Context->pop(nullptr, /*IsReset=*/true)) { Diag(PragmaLoc, diag::warn_pragma_options_align_reset_failed) << "stack empty"; } @@ -211,7 +211,7 @@ void Sema::ActOnPragmaPack(PragmaPackKind Kind, IdentifierInfo *Name, AlignmentVal = (unsigned) Val.getZExtValue(); } - if (PackContext == 0) + if (!PackContext) PackContext = new PragmaPackStack(); PragmaPackStack *Context = static_cast<PragmaPackStack*>(PackContext); @@ -436,7 +436,7 @@ void Sema::ActOnPragmaUnused(const Token &IdTok, Scope *curScope, IdentifierInfo *Name = IdTok.getIdentifierInfo(); LookupResult Lookup(*this, Name, IdTok.getLocation(), LookupOrdinaryName); - LookupParsedName(Lookup, curScope, NULL, true); + LookupParsedName(Lookup, curScope, nullptr, true); if (Lookup.empty()) { Diag(PragmaLoc, diag::warn_pragma_unused_undeclared_var) @@ -523,7 +523,7 @@ void Sema::AddPushedVisibilityAttribute(Decl *D) { /// FreeVisContext - Deallocate and null out VisContext. void Sema::FreeVisContext() { delete static_cast<VisStack*>(VisContext); - VisContext = 0; + VisContext = nullptr; } static void PushPragmaVisibility(Sema &S, unsigned type, SourceLocation loc) { |