Index: lib/ARCMigrate/TransProperties.cpp =================================================================== --- lib/ARCMigrate/TransProperties.cpp +++ lib/ARCMigrate/TransProperties.cpp @@ -365,7 +365,7 @@ assert(!props.empty()); QualType ty = props[0].PropD->getType().getUnqualifiedType(); -#ifndef NDEBUG +#ifndef LLVM_NDEBUG for (PropsTy::iterator I = props.begin(), E = props.end(); I != E; ++I) assert(ty == I->PropD->getType().getUnqualifiedType()); #endif @@ -379,7 +379,7 @@ ObjCPropertyDecl::PropertyAttributeKind attrs = props[0].PropD->getPropertyAttributesAsWritten(); -#ifndef NDEBUG +#ifndef LLVM_NDEBUG for (PropsTy::iterator I = props.begin(), E = props.end(); I != E; ++I) assert(attrs == I->PropD->getPropertyAttributesAsWritten()); #endif Index: lib/AST/ASTContext.cpp =================================================================== --- lib/AST/ASTContext.cpp +++ lib/AST/ASTContext.cpp @@ -64,7 +64,7 @@ if (!CommentsLoaded && ExternalSource) { ExternalSource->ReadComments(); -#ifndef NDEBUG +#ifndef LLVM_NDEBUG ArrayRef RawComments = Comments.getComments(); assert(std::is_sorted(RawComments.begin(), RawComments.end(), BeforeThanCompare(SourceMgr))); @@ -3040,7 +3040,7 @@ return QualType(FTP, 0); } -#ifndef NDEBUG +#ifndef LLVM_NDEBUG static bool NeedsInjectedClassNameType(const RecordDecl *D) { if (!isa(D)) return false; const CXXRecordDecl *RD = cast(D); @@ -3193,7 +3193,7 @@ QualType ASTContext::getSubstTemplateTypeParmPackType( const TemplateTypeParmType *Parm, const TemplateArgument &ArgPack) { -#ifndef NDEBUG +#ifndef LLVM_NDEBUG for (const auto &P : ArgPack.pack_elements()) { assert(P.getKind() == TemplateArgument::Type &&"Pack contains a non-type"); assert(P.getAsType().isCanonical() && "Pack contains non-canonical type"); @@ -3295,7 +3295,7 @@ Underlying); } -#ifndef NDEBUG +#ifndef LLVM_NDEBUG static bool hasAnyPackExpansions(const TemplateArgument *Args, unsigned NumArgs) { for (unsigned I = 0; I != NumArgs; ++I) @@ -5851,7 +5851,7 @@ size = layout.getSize(); } -#ifndef NDEBUG +#ifndef LLVM_NDEBUG uint64_t CurOffs = 0; #endif std::multimap::iterator @@ -5867,7 +5867,7 @@ S += '"'; } S += "^^?"; -#ifndef NDEBUG +#ifndef LLVM_NDEBUG CurOffs += getTypeSize(VoidPtrTy); #endif } @@ -5880,7 +5880,7 @@ } for (; CurLayObj != FieldOrBaseOffsets.end(); ++CurLayObj) { -#ifndef NDEBUG +#ifndef LLVM_NDEBUG assert(CurOffs <= CurLayObj->first); if (CurOffs < CurLayObj->first) { uint64_t padding = CurLayObj->first - CurOffs; @@ -5907,7 +5907,7 @@ getObjCEncodingForStructureImpl(base, S, FD, /*includeVBases*/false, NotEncodedT); assert(!base->isEmpty()); -#ifndef NDEBUG +#ifndef LLVM_NDEBUG CurOffs += toBits(getASTRecordLayout(base).getNonVirtualSize()); #endif } else { @@ -5920,7 +5920,7 @@ if (field->isBitField()) { EncodeBitField(this, S, field->getType(), field); -#ifndef NDEBUG +#ifndef LLVM_NDEBUG CurOffs += field->getBitWidthValue(*this); #endif } else { @@ -5931,7 +5931,7 @@ /*EncodingProperty*/false, /*StructField*/true, false, false, false, NotEncodedT); -#ifndef NDEBUG +#ifndef LLVM_NDEBUG CurOffs += getTypeSize(field->getType()); #endif } @@ -6551,7 +6551,7 @@ } else { // It's not valid to set GC attributes on anything that isn't a // pointer. -#ifndef NDEBUG +#ifndef LLVM_NDEBUG QualType CT = Ty->getCanonicalTypeInternal(); while (const ArrayType *AT = dyn_cast(CT)) CT = AT->getElementType(); Index: lib/AST/CommentLexer.cpp =================================================================== --- lib/AST/CommentLexer.cpp +++ lib/AST/CommentLexer.cpp @@ -274,7 +274,7 @@ Result.setLocation(getSourceLocation(BufferPtr)); Result.setKind(Kind); Result.setLength(TokLen); -#ifndef NDEBUG +#ifndef LLVM_NDEBUG Result.TextPtr = ""; Result.IntVal = 7; #endif Index: lib/AST/CommentParser.cpp =================================================================== --- lib/AST/CommentParser.cpp +++ lib/AST/CommentParser.cpp @@ -136,7 +136,7 @@ Result.setLocation(Loc); Result.setKind(tok::text); Result.setLength(TokLength); -#ifndef NDEBUG +#ifndef LLVM_NDEBUG Result.TextPtr = ""; Result.IntVal = 7; #endif Index: lib/AST/Decl.cpp =================================================================== --- lib/AST/Decl.cpp +++ lib/AST/Decl.cpp @@ -1323,7 +1323,7 @@ D->setCachedLinkage(LV.getLinkage()); -#ifndef NDEBUG +#ifndef LLVM_NDEBUG // In C (because of gnu inline) and in c++ with microsoft extensions an // static can follow an extern, so we can have two decls with different // linkages. @@ -3654,7 +3654,7 @@ return FieldDecl::classofKind(K) || IndirectFieldDecl::classofKind(K); }, Decls); -#ifndef NDEBUG +#ifndef LLVM_NDEBUG // Check that all decls we got were FieldDecls. for (unsigned i=0, e=Decls.size(); i != e; ++i) assert(isa(Decls[i]) || isa(Decls[i])); Index: lib/AST/DeclBase.cpp =================================================================== --- lib/AST/DeclBase.cpp +++ lib/AST/DeclBase.cpp @@ -722,7 +722,7 @@ } bool Decl::AccessDeclContextSanity() const { -#ifndef NDEBUG +#ifndef LLVM_NDEBUG // Suppress this check if any of the following hold: // 1. this is the translation unit (and thus has no parent) // 2. this is a template parameter (and thus doesn't belong to its context) Index: lib/AST/DeclFriend.cpp =================================================================== --- lib/AST/DeclFriend.cpp +++ lib/AST/DeclFriend.cpp @@ -29,7 +29,7 @@ FriendUnion Friend, SourceLocation FriendL, ArrayRef FriendTypeTPLists) { -#ifndef NDEBUG +#ifndef LLVM_NDEBUG if (Friend.is()) { NamedDecl *D = Friend.get(); assert(isa(D) || Index: lib/AST/DeclTemplate.cpp =================================================================== --- lib/AST/DeclTemplate.cpp +++ lib/AST/DeclTemplate.cpp @@ -181,7 +181,7 @@ void *InsertPos) { typedef SpecEntryTraits SETraits; if (InsertPos) { -#ifndef NDEBUG +#ifndef LLVM_NDEBUG void *CorrectInsertPos; assert(!findSpecializationImpl(Specializations, SETraits::getTemplateArgs(Entry), Index: lib/AST/ExprCXX.cpp =================================================================== --- lib/AST/ExprCXX.cpp +++ lib/AST/ExprCXX.cpp @@ -750,7 +750,7 @@ } Expr *UserDefinedLiteral::getCookedLiteral() { -#ifndef NDEBUG +#ifndef LLVM_NDEBUG LiteralOperatorKind LOK = getLiteralOperatorKind(); assert(LOK != LOK_Template && LOK != LOK_Raw && "not a cooked literal"); #endif Index: lib/AST/ExprConstant.cpp =================================================================== --- lib/AST/ExprConstant.cpp +++ lib/AST/ExprConstant.cpp @@ -3815,7 +3815,7 @@ bool Success = true; unsigned BasesSeen = 0; -#ifndef NDEBUG +#ifndef LLVM_NDEBUG CXXRecordDecl::base_class_const_iterator BaseIt = RD->bases_begin(); #endif for (const auto *I : Definition->inits()) { @@ -3826,7 +3826,7 @@ FieldDecl *FD = nullptr; if (I->isBaseInitializer()) { QualType BaseType(I->getBaseClass(), 0); -#ifndef NDEBUG +#ifndef LLVM_NDEBUG // Non-virtual base classes are initialized in the order in the class // definition. We have already checked for virtual base classes. assert(!BaseIt->isVirtual() && "virtual base for literal type"); Index: lib/AST/RecordLayout.cpp =================================================================== --- lib/AST/RecordLayout.cpp +++ lib/AST/RecordLayout.cpp @@ -86,7 +86,7 @@ CXXInfo->LeadsWithZeroSizedBase = LeadsWithZeroSizedBase; -#ifndef NDEBUG +#ifndef LLVM_NDEBUG if (const CXXRecordDecl *PrimaryBase = getPrimaryBase()) { if (isPrimaryBaseVirtual()) { if (Ctx.getTargetInfo().getCXXABI().hasPrimaryVBases()) { Index: lib/AST/RecordLayoutBuilder.cpp =================================================================== --- lib/AST/RecordLayoutBuilder.cpp +++ lib/AST/RecordLayoutBuilder.cpp @@ -1303,7 +1303,7 @@ // of the struct itself. FinishLayout(RD); -#ifndef NDEBUG +#ifndef LLVM_NDEBUG // Check that we have base offsets for all bases. for (const CXXBaseSpecifier &Base : RD->bases()) { if (Base.isVirtual()) Index: lib/AST/StmtViz.cpp =================================================================== --- lib/AST/StmtViz.cpp +++ lib/AST/StmtViz.cpp @@ -19,7 +19,7 @@ using namespace clang; void Stmt::viewAST() const { -#ifndef NDEBUG +#ifndef LLVM_NDEBUG llvm::ViewGraph(this,"AST"); #else llvm::errs() << "Stmt::viewAST is only available in debug builds on " @@ -34,7 +34,7 @@ static std::string getNodeLabel(const Stmt* Node, const Stmt* Graph) { -#ifndef NDEBUG +#ifndef LLVM_NDEBUG std::string OutSStr; llvm::raw_string_ostream Out(OutSStr); Index: lib/ASTMatchers/Dynamic/Marshallers.h =================================================================== --- lib/ASTMatchers/Dynamic/Marshallers.h +++ lib/ASTMatchers/Dynamic/Marshallers.h @@ -518,7 +518,7 @@ bool isVariadic() const override { bool Overload0Variadic = Overloads[0]->isVariadic(); -#ifndef NDEBUG +#ifndef LLVM_NDEBUG for (const auto &O : Overloads) { assert(Overload0Variadic == O->isVariadic()); } @@ -528,7 +528,7 @@ unsigned getNumArgs() const override { unsigned Overload0NumArgs = Overloads[0]->getNumArgs(); -#ifndef NDEBUG +#ifndef LLVM_NDEBUG for (const auto &O : Overloads) { assert(Overload0NumArgs == O->getNumArgs()); } Index: lib/Analysis/CFG.cpp =================================================================== --- lib/Analysis/CFG.cpp +++ lib/Analysis/CFG.cpp @@ -4537,12 +4537,12 @@ //===----------------------------------------------------------------------===// -#ifndef NDEBUG +#ifndef LLVM_NDEBUG static StmtPrinterHelper* GraphHelper; #endif void CFG::viewCFG(const LangOptions &LO) const { -#ifndef NDEBUG +#ifndef LLVM_NDEBUG StmtPrinterHelper H(this, LO); GraphHelper = &H; llvm::ViewGraph(this,"CFG"); @@ -4558,7 +4558,7 @@ static std::string getNodeLabel(const CFGBlock *Node, const CFG* Graph) { -#ifndef NDEBUG +#ifndef LLVM_NDEBUG std::string OutSStr; llvm::raw_string_ostream Out(OutSStr); print_block(Out,Graph, *Node, *GraphHelper, false, false); Index: lib/Basic/DiagnosticIDs.cpp =================================================================== --- lib/Basic/DiagnosticIDs.cpp +++ lib/Basic/DiagnosticIDs.cpp @@ -97,7 +97,7 @@ /// or null if the ID is invalid. static const StaticDiagInfoRec *GetDiagInfo(unsigned DiagID) { // If assertions are enabled, verify that the StaticDiagInfo array is sorted. -#ifndef NDEBUG +#ifndef LLVM_NDEBUG static bool IsFirst = true; // So the check is only performed on first call. if (IsFirst) { for (unsigned i = 1; i != StaticDiagInfoSize; ++i) { Index: lib/Basic/VirtualFileSystem.cpp =================================================================== --- lib/Basic/VirtualFileSystem.cpp +++ lib/Basic/VirtualFileSystem.cpp @@ -977,7 +977,7 @@ return UniqueID(std::numeric_limits::max(), ID); } -#ifndef NDEBUG +#ifndef LLVM_NDEBUG static bool pathHasTraversal(StringRef Path) { using namespace llvm::sys; for (StringRef Comp : llvm::make_range(path::begin(Path), path::end(Path))) Index: lib/CodeGen/CGBuilder.h =================================================================== --- lib/CodeGen/CGBuilder.h +++ lib/CodeGen/CGBuilder.h @@ -39,7 +39,7 @@ }; // Don't preserve names on values in an optimized build. -#ifdef NDEBUG +#ifdef LLVM_NDEBUG #define PreserveNames false #else #define PreserveNames true Index: lib/CodeGen/CGBuiltin.cpp =================================================================== --- lib/CodeGen/CGBuiltin.cpp +++ lib/CodeGen/CGBuiltin.cpp @@ -2617,7 +2617,7 @@ findNeonIntrinsicInMap(ArrayRef IntrinsicMap, unsigned BuiltinID, bool &MapProvenSorted) { -#ifndef NDEBUG +#ifndef LLVM_NDEBUG if (!MapProvenSorted) { // FIXME: use std::is_sorted once C++11 is allowed for (unsigned i = 0; i < IntrinsicMap.size() - 1; ++i) Index: lib/CodeGen/CGCall.cpp =================================================================== --- lib/CodeGen/CGCall.cpp +++ lib/CodeGen/CGCall.cpp @@ -3383,7 +3383,7 @@ llvm::Type *LastParamTy = IRFuncTy->getParamType(IRFuncTy->getNumParams() - 1); if (Arg->getType() != LastParamTy) { -#ifndef NDEBUG +#ifndef LLVM_NDEBUG // Assert that these structs have equivalent element types. llvm::StructType *FullTy = CallInfo.getArgStruct(); llvm::StructType *DeclaredTy = cast( Index: lib/CodeGen/CGExpr.cpp =================================================================== --- lib/CodeGen/CGExpr.cpp +++ lib/CodeGen/CGExpr.cpp @@ -2312,7 +2312,7 @@ CheckRecoverableKind RecoverKind = getRecoverableKind(Checked[0].second); assert(SanOpts.has(Checked[0].second)); -#ifndef NDEBUG +#ifndef LLVM_NDEBUG for (int i = 1, n = Checked.size(); i < n; ++i) { assert(RecoverKind == getRecoverableKind(Checked[i].second) && "All recoverable kinds in a single check must be same!"); Index: lib/CodeGen/CGExprAgg.cpp =================================================================== --- lib/CodeGen/CGExprAgg.cpp +++ lib/CodeGen/CGExprAgg.cpp @@ -1183,7 +1183,7 @@ if (!E->getInitializedFieldInUnion()) { // Empty union; we have nothing to do. -#ifndef NDEBUG +#ifndef LLVM_NDEBUG // Make sure that it's really an empty and not a failure of // semantic analysis. for (const auto *Field : record->fields()) Index: lib/CodeGen/CGRecordLayoutBuilder.cpp =================================================================== --- lib/CodeGen/CGRecordLayoutBuilder.cpp +++ lib/CodeGen/CGRecordLayoutBuilder.cpp @@ -732,7 +732,7 @@ RL->print(llvm::outs()); } -#ifndef NDEBUG +#ifndef LLVM_NDEBUG // Verify that the computed LLVM struct size matches the AST layout size. const ASTRecordLayout &Layout = getContext().getASTRecordLayout(D); Index: lib/CodeGen/CGVTables.cpp =================================================================== --- lib/CodeGen/CGVTables.cpp +++ lib/CodeGen/CGVTables.cpp @@ -71,7 +71,7 @@ ThunkFn->setComdat(CGM.getModule().getOrInsertComdat(ThunkFn->getName())); } -#ifndef NDEBUG +#ifndef LLVM_NDEBUG static bool similar(const ABIArgInfo &infoL, CanQualType typeL, const ABIArgInfo &infoR, CanQualType typeR) { return (infoL.getKind() == infoR.getKind() && @@ -275,7 +275,7 @@ const FunctionProtoType *FPT = MD->getType()->getAs(); -#ifndef NDEBUG +#ifndef LLVM_NDEBUG const CGFunctionInfo &CallFnInfo = CGM.getTypes().arrangeCXXMethodCall(CallArgs, FPT, RequiredArgs::forPrototypePlus(FPT, 1)); @@ -846,7 +846,7 @@ /// v-tables, and that we are now at the end of the translation unit, /// decide whether we should emit them. void CodeGenModule::EmitDeferredVTables() { -#ifndef NDEBUG +#ifndef LLVM_NDEBUG // Remember the size of DeferredVTables, because we're going to assume // that this entire operation doesn't modify it. size_t savedSize = DeferredVTables.size(); Index: lib/CodeGen/CodeGenFunction.h =================================================================== --- lib/CodeGen/CodeGenFunction.h +++ lib/CodeGen/CodeGenFunction.h @@ -1433,7 +1433,7 @@ llvm::BasicBlock *createBasicBlock(const Twine &name = "", llvm::Function *parent = nullptr, llvm::BasicBlock *before = nullptr) { -#ifdef NDEBUG +#ifdef LLVM_NDEBUG return llvm::BasicBlock::Create(getLLVMContext(), "", parent, before); #else return llvm::BasicBlock::Create(getLLVMContext(), name, parent, before); @@ -2942,7 +2942,7 @@ SourceLocation Loc); public: -#ifndef NDEBUG +#ifndef LLVM_NDEBUG // Determine whether the given argument is an Objective-C method // that may have type parameters in its signature. static bool isObjCMethodWithTypeParams(const ObjCMethodDecl *method) { @@ -2974,7 +2974,7 @@ assert((ParamsToSkip == 0 || CallArgTypeInfo) && "Can't skip parameters if type info is not provided"); if (CallArgTypeInfo) { -#ifndef NDEBUG +#ifndef LLVM_NDEBUG bool isGenericMethod = isObjCMethodWithTypeParams(CallArgTypeInfo); #endif Index: lib/CodeGen/CodeGenFunction.cpp =================================================================== --- lib/CodeGen/CodeGenFunction.cpp +++ lib/CodeGen/CodeGenFunction.cpp @@ -1760,7 +1760,7 @@ CGF->InsertHelper(I, Name, BB, InsertPt); } -#ifdef NDEBUG +#ifdef LLVM_NDEBUG #define PreserveNames false #else #define PreserveNames true Index: lib/CodeGen/MicrosoftCXXABI.cpp =================================================================== --- lib/CodeGen/MicrosoftCXXABI.cpp +++ lib/CodeGen/MicrosoftCXXABI.cpp @@ -1617,7 +1617,7 @@ // Queue up this v-table for possible deferred emission. CGM.addDeferredVTable(RD); -#ifndef NDEBUG +#ifndef LLVM_NDEBUG // Create all the vftables at once in order to make sure each vftable has // a unique mangled name. llvm::StringSet<> ObservedMangledNames; Index: lib/Driver/Multilib.cpp =================================================================== --- lib/Driver/Multilib.cpp +++ lib/Driver/Multilib.cpp @@ -217,7 +217,7 @@ MultilibSet &MultilibSet::FilterOut(const char *Regex) { llvm::Regex R(Regex); -#ifndef NDEBUG +#ifndef LLVM_NDEBUG std::string Error; if (!R.isValid(Error)) { llvm::errs() << Error; Index: lib/Driver/Tools.cpp =================================================================== --- lib/Driver/Tools.cpp +++ lib/Driver/Tools.cpp @@ -3068,7 +3068,7 @@ CmdArgs.push_back("-disable-free"); // Disable the verification pass in -asserts builds. -#ifdef NDEBUG +#ifdef LLVM_NDEBUG CmdArgs.push_back("-disable-llvm-verifier"); #endif Index: lib/Format/UnwrappedLineFormatter.cpp =================================================================== --- lib/Format/UnwrappedLineFormatter.cpp +++ lib/Format/UnwrappedLineFormatter.cpp @@ -458,7 +458,7 @@ } } -#ifndef NDEBUG +#ifndef LLVM_NDEBUG static void printLineState(const LineState &State) { llvm::dbgs() << "State: "; for (const ParenState &P : State.Stack) { Index: lib/Frontend/ASTUnit.cpp =================================================================== --- lib/Frontend/ASTUnit.cpp +++ lib/Frontend/ASTUnit.cpp @@ -2824,7 +2824,7 @@ ++NumLines; } -#ifndef NDEBUG +#ifndef LLVM_NDEBUG ASTUnit::ConcurrencyState::ConcurrencyState() { Mutex = new llvm::sys::MutexImpl(/*recursive=*/true); } @@ -2842,7 +2842,7 @@ static_cast(Mutex)->release(); } -#else // NDEBUG +#else // LLVM_NDEBUG ASTUnit::ConcurrencyState::ConcurrencyState() { Mutex = 0; } ASTUnit::ConcurrencyState::~ConcurrencyState() {} Index: lib/Frontend/VerifyDiagnosticConsumer.cpp =================================================================== --- lib/Frontend/VerifyDiagnosticConsumer.cpp +++ lib/Frontend/VerifyDiagnosticConsumer.cpp @@ -46,7 +46,7 @@ Diags.takeClient().release(); } -#ifndef NDEBUG +#ifndef LLVM_NDEBUG namespace { class VerifyFileTracker : public PPCallbacks { VerifyDiagnosticConsumer &Verify; @@ -79,7 +79,7 @@ this->LangOpts = &LangOpts; setSourceManager(PP->getSourceManager()); const_cast(PP)->addCommentHandler(this); -#ifndef NDEBUG +#ifndef LLVM_NDEBUG // Debug build tracks parsed files. const_cast(PP)->addPPCallbacks( llvm::make_unique(*this, *SrcManager)); @@ -117,7 +117,7 @@ setSourceManager(Info.getSourceManager()); } -#ifndef NDEBUG +#ifndef LLVM_NDEBUG // Debug build tracks unparsed files for possible // unparsed expected-* directives. if (SrcManager) { @@ -572,7 +572,7 @@ return false; } -#ifndef NDEBUG +#ifndef LLVM_NDEBUG /// \brief Lex the specified source file to determine whether it contains /// any expected-* directives. As a Lexer is used rather than a full-blown /// Preprocessor, directives inside skipped #if blocks will still be found. @@ -609,7 +609,7 @@ } return false; } -#endif // !NDEBUG +#endif // !LLVM_NDEBUG /// \brief Takes a list of diagnostics that have been generated but not matched /// by an expected-* directive and produces a diagnostic to the user from this. @@ -779,7 +779,7 @@ // Check SourceManager hasn't changed. setSourceManager(SM); -#ifndef NDEBUG +#ifndef LLVM_NDEBUG if (FID.isInvalid()) return; @@ -812,7 +812,7 @@ std::unique_ptr Owner = Diags.takeClient(); Diags.setClient(PrimaryClient, false); -#ifndef NDEBUG +#ifndef LLVM_NDEBUG // In a debug build, scan through any files that may have been missed // during parsing and issue a fatal error if directives are contained // within these files. If a fatal error occurs, this suggests that @@ -849,7 +849,7 @@ // UnparsedFiles has been processed now, so clear it. UnparsedFiles.clear(); } -#endif // !NDEBUG +#endif // !LLVM_NDEBUG if (SrcManager) { // Produce an error if no expected-* directives could be found in the Index: lib/Lex/ModuleMap.cpp =================================================================== --- lib/Lex/ModuleMap.cpp +++ lib/Lex/ModuleMap.cpp @@ -214,7 +214,7 @@ ModuleMap::ModuleHeaderRole Role, Module *RequestedModule) { bool IsPrivateRole = Role & ModuleMap::PrivateHeader; -#ifndef NDEBUG +#ifndef LLVM_NDEBUG if (IsPrivateRole) { // Check for consistency between the module header role // as obtained from the lookup and as obtained from the module. Index: lib/Sema/Sema.cpp =================================================================== --- lib/Sema/Sema.cpp +++ lib/Sema/Sema.cpp @@ -343,7 +343,7 @@ CastKind Kind, ExprValueKind VK, const CXXCastPath *BasePath, CheckedConversionKind CCK) { -#ifndef NDEBUG +#ifndef LLVM_NDEBUG if (VK == VK_RValue && !E->isRValue()) { switch (Kind) { default: Index: lib/Sema/SemaDecl.cpp =================================================================== --- lib/Sema/SemaDecl.cpp +++ lib/Sema/SemaDecl.cpp @@ -1119,7 +1119,7 @@ assert(!S->getEntity() && "scope already has entity"); -#ifndef NDEBUG +#ifndef LLVM_NDEBUG Scope *Ancestor = S->getParent(); while (!Ancestor->getEntity()) Ancestor = Ancestor->getParent(); assert(Ancestor->getEntity() == CurContext && "ancestor context mismatch"); @@ -5452,7 +5452,7 @@ // Okay, go ahead and call the relatively-more-expensive function. -#ifndef NDEBUG +#ifndef LLVM_NDEBUG // AST quite reasonably asserts that it's working on a function // definition. We don't really have a way to tell it that we're // currently defining the function, so just lie to it in +Asserts @@ -5463,7 +5463,7 @@ bool isC99Inline = S.Context.GetGVALinkageForFunction(FD) == GVA_AvailableExternally; -#ifndef NDEBUG +#ifndef LLVM_NDEBUG FD->setLazyBody(0); #endif Index: lib/Sema/SemaLookup.cpp =================================================================== --- lib/Sema/SemaLookup.cpp +++ lib/Sema/SemaLookup.cpp @@ -318,7 +318,7 @@ } bool LookupResult::sanity() const { - // This function is never called by NDEBUG builds. + // This function is never called by LLVM_NDEBUG builds. assert(ResultKind != NotFound || Decls.size() == 0); assert(ResultKind != Found || Decls.size() == 1); assert(ResultKind != FoundOverloaded || Decls.size() > 1 || Index: lib/Sema/SemaOverload.cpp =================================================================== --- lib/Sema/SemaOverload.cpp +++ lib/Sema/SemaOverload.cpp @@ -10418,7 +10418,7 @@ OverloadCandidateSet &CandidateSet, bool PartialOverloading) { -#ifndef NDEBUG +#ifndef LLVM_NDEBUG // Verify that ArgumentDependentLookup is consistent with the rules // in C++0x [basic.lookup.argdep]p3: // @@ -10706,7 +10706,7 @@ SourceLocation RParenLoc, OverloadCandidateSet *CandidateSet, ExprResult *Result) { -#ifndef NDEBUG +#ifndef LLVM_NDEBUG if (ULE->requiresADL()) { // To do ADL, we must have found an unqualified name. assert(!ULE->getQualifier() && "qualified name with ADL"); Index: lib/Sema/SemaTemplateDeduction.cpp =================================================================== --- lib/Sema/SemaTemplateDeduction.cpp +++ lib/Sema/SemaTemplateDeduction.cpp @@ -3672,7 +3672,7 @@ FunctionTemplateDecl *InvokerTemplate = LambdaClass-> getLambdaStaticInvoker()->getDescribedFunctionTemplate(); -#ifndef NDEBUG +#ifndef LLVM_NDEBUG Sema::TemplateDeductionResult LLVM_ATTRIBUTE_UNUSED Result = #endif S.FinishTemplateArgumentDeduction(InvokerTemplate, DeducedArguments, 0, Index: lib/Sema/SemaTemplateInstantiate.cpp =================================================================== --- lib/Sema/SemaTemplateInstantiate.cpp +++ lib/Sema/SemaTemplateInstantiate.cpp @@ -2795,7 +2795,7 @@ D = getCanonicalParmVarDecl(D); llvm::PointerUnion &Stored = LocalDecls[D]; if (Stored.isNull()) { -#ifndef NDEBUG +#ifndef LLVM_NDEBUG // It should not be present in any surrounding scope either. LocalInstantiationScope *Current = this; while (Current->CombineWithOuterScope && Current->Outer) { @@ -2820,7 +2820,7 @@ } void LocalInstantiationScope::MakeInstantiatedLocalArgPack(const Decl *D) { -#ifndef NDEBUG +#ifndef LLVM_NDEBUG // This should be the first time we've been told about this decl. for (LocalInstantiationScope *Current = this; Current && Current->CombineWithOuterScope; Current = Current->Outer) Index: lib/Sema/TreeTransform.h =================================================================== --- lib/Sema/TreeTransform.h +++ lib/Sema/TreeTransform.h @@ -4624,7 +4624,7 @@ PVars->push_back(nullptr); } -#ifndef NDEBUG +#ifndef LLVM_NDEBUG if (PVars) { for (unsigned i = 0, e = PVars->size(); i != e; ++i) if (ParmVarDecl *parm = (*PVars)[i]) @@ -10589,7 +10589,7 @@ return ExprError(); } -#ifndef NDEBUG +#ifndef LLVM_NDEBUG // In builds with assertions, make sure that we captured everything we // captured before. if (!SemaRef.getDiagnostics().hasErrorOccurred()) { Index: lib/Sema/TypeLocBuilder.h =================================================================== --- lib/Sema/TypeLocBuilder.h +++ lib/Sema/TypeLocBuilder.h @@ -33,7 +33,7 @@ /// The index of the first occupied byte in the buffer. size_t Index; -#ifndef NDEBUG +#ifndef LLVM_NDEBUG /// The last type pushed on this builder. QualType LastTy; #endif @@ -76,7 +76,7 @@ /// Resets this builder to the newly-initialized state. void clear() { -#ifndef NDEBUG +#ifndef LLVM_NDEBUG LastTy = QualType(); #endif Index = Capacity; @@ -86,7 +86,7 @@ /// \brief Tell the TypeLocBuilder that the type it is storing has been /// modified in some safe way that doesn't affect type-location information. void TypeWasModifiedSafely(QualType T) { -#ifndef NDEBUG +#ifndef LLVM_NDEBUG LastTy = T; #endif } @@ -102,7 +102,7 @@ /// Creates a TypeSourceInfo for the given type. TypeSourceInfo *getTypeSourceInfo(ASTContext& Context, QualType T) { -#ifndef NDEBUG +#ifndef LLVM_NDEBUG assert(T == LastTy && "type doesn't match last type pushed!"); #endif @@ -115,7 +115,7 @@ /// \brief Copies the type-location information to the given AST context and /// returns a \c TypeLoc referring into the AST context. TypeLoc getTypeLocInContext(ASTContext &Context, QualType T) { -#ifndef NDEBUG +#ifndef LLVM_NDEBUG assert(T == LastTy && "type doesn't match last type pushed!"); #endif @@ -139,7 +139,7 @@ /// \c TypeLocBuilder is active and has not had more type information /// pushed into it. TypeLoc getTemporaryTypeLoc(QualType T) { -#ifndef NDEBUG +#ifndef LLVM_NDEBUG assert(LastTy == T && "type doesn't match last type pushed!"); #endif return TypeLoc(T, &Buffer[Index]); Index: lib/Sema/TypeLocBuilder.cpp =================================================================== --- lib/Sema/TypeLocBuilder.cpp +++ lib/Sema/TypeLocBuilder.cpp @@ -61,7 +61,7 @@ } TypeLoc TypeLocBuilder::pushImpl(QualType T, size_t LocalSize, unsigned LocalAlignment) { -#ifndef NDEBUG +#ifndef LLVM_NDEBUG QualType TLast = TypeLoc(T, nullptr).getNextTypeLoc().getType(); assert(TLast == LastTy && "mismatch between last type and new type's inner type"); Index: lib/Serialization/ASTReader.cpp =================================================================== --- lib/Serialization/ASTReader.cpp +++ lib/Serialization/ASTReader.cpp @@ -6310,7 +6310,7 @@ /// definitions in multiple different module files. /// /// Note: this needs to be kept in sync with ASTWriter::AddedVisibleDecl's -/// NDEBUG checking. +/// LLVM_NDEBUG checking. static ModuleFile *getDefinitiveModuleFileFor(const DeclContext *DC, ASTReader &Reader) { if (const DeclContext *DefDC = getDefinitiveDeclContext(DC)) Index: lib/Serialization/ASTReaderStmt.cpp =================================================================== --- lib/Serialization/ASTReaderStmt.cpp +++ lib/Serialization/ASTReaderStmt.cpp @@ -2317,7 +2317,7 @@ /// just after the stmt record. llvm::DenseMap StmtEntries; -#ifndef NDEBUG +#ifndef LLVM_NDEBUG unsigned PrevNumStmts = StmtStack.size(); #endif Index: lib/Serialization/ASTWriter.cpp =================================================================== --- lib/Serialization/ASTWriter.cpp +++ lib/Serialization/ASTWriter.cpp @@ -3319,7 +3319,7 @@ Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob)); unsigned IdentifierOffsetAbbrev = Stream.EmitAbbrev(Abbrev); -#ifndef NDEBUG +#ifndef LLVM_NDEBUG for (unsigned I = 0, N = IdentifierOffsets.size(); I != N; ++I) assert(IdentifierOffsets[I] && "Missing identifier offset?"); #endif Index: lib/Serialization/ASTWriterStmt.cpp =================================================================== --- lib/Serialization/ASTWriterStmt.cpp +++ lib/Serialization/ASTWriterStmt.cpp @@ -2178,7 +2178,7 @@ return; } -#ifndef NDEBUG +#ifndef LLVM_NDEBUG assert(!ParentStmts.count(S) && "There is a Stmt cycle!"); struct ParentStmtInserterRAII { @@ -2205,7 +2205,7 @@ Writer.AbbrevToUse = 0; Writer.Visit(S); -#ifndef NDEBUG +#ifndef LLVM_NDEBUG if (Writer.Code == serialization::STMT_NULL_PTR) { SourceManager &SrcMgr = DeclIDs.begin()->first->getASTContext().getSourceManager(); Index: lib/Serialization/ModuleManager.cpp =================================================================== --- lib/Serialization/ModuleManager.cpp +++ lib/Serialization/ModuleManager.cpp @@ -21,7 +21,7 @@ #include "llvm/Support/raw_ostream.h" #include -#ifndef NDEBUG +#ifndef LLVM_NDEBUG #include "llvm/Support/GraphWriter.h" #endif @@ -438,7 +438,7 @@ return false; } -#ifndef NDEBUG +#ifndef LLVM_NDEBUG namespace llvm { template<> struct GraphTraits { Index: lib/StaticAnalyzer/Core/BugReporterVisitors.cpp =================================================================== --- lib/StaticAnalyzer/Core/BugReporterVisitors.cpp +++ lib/StaticAnalyzer/Core/BugReporterVisitors.cpp @@ -330,7 +330,7 @@ const ExplodedNode *PrevN, BugReporterContext &BRC, BugReport &BR) { -#ifndef NDEBUG +#ifndef LLVM_NDEBUG ExprEngine &Eng = BRC.getBugReporter().getEngine(); AnalyzerOptions &Options = Eng.getAnalysisManager().options; assert(hasCounterSuppression(Options)); Index: lib/StaticAnalyzer/Core/CheckerManager.cpp =================================================================== --- lib/StaticAnalyzer/Core/CheckerManager.cpp +++ lib/StaticAnalyzer/Core/CheckerManager.cpp @@ -40,7 +40,7 @@ } void CheckerManager::finishedCheckerRegistration() { -#ifndef NDEBUG +#ifndef LLVM_NDEBUG // Make sure that for every event that has listeners, there is at least // one dispatcher registered for it. for (llvm::DenseMap::iterator @@ -553,7 +553,7 @@ if (evaluated) { anyEvaluated = true; Dst.insert(checkDst); -#ifdef NDEBUG +#ifdef LLVM_NDEBUG break; // on release don't check that no other checker also evals. #endif } Index: lib/StaticAnalyzer/Core/ExplodedGraph.cpp =================================================================== --- lib/StaticAnalyzer/Core/ExplodedGraph.cpp +++ lib/StaticAnalyzer/Core/ExplodedGraph.cpp @@ -33,12 +33,12 @@ // An out of line virtual method to provide a home for the class vtable. ExplodedNode::Auditor::~Auditor() {} -#ifndef NDEBUG +#ifndef LLVM_NDEBUG static ExplodedNode::Auditor* NodeAuditor = nullptr; #endif void ExplodedNode::SetAuditor(ExplodedNode::Auditor* A) { -#ifndef NDEBUG +#ifndef LLVM_NDEBUG NodeAuditor = A; #endif } @@ -219,7 +219,7 @@ assert (!V->isSink()); Preds.addNode(V, G); V->Succs.addNode(this, G); -#ifndef NDEBUG +#ifndef LLVM_NDEBUG if (NodeAuditor) NodeAuditor->AddEdge(V, this); #endif } Index: lib/StaticAnalyzer/Core/ExprEngine.cpp =================================================================== --- lib/StaticAnalyzer/Core/ExprEngine.cpp +++ lib/StaticAnalyzer/Core/ExprEngine.cpp @@ -30,7 +30,7 @@ #include "llvm/ADT/Statistic.h" #include "llvm/Support/raw_ostream.h" -#ifndef NDEBUG +#ifndef LLVM_NDEBUG #include "llvm/Support/GraphWriter.h" #endif @@ -1458,7 +1458,7 @@ return state->getSVal(Ex, LCtx); } -#ifndef NDEBUG +#ifndef LLVM_NDEBUG static const Stmt *getRightmostLeaf(const Stmt *Condition) { while (Condition) { const BinaryOperator *BO = dyn_cast(Condition); @@ -2398,7 +2398,7 @@ // Visualization. //===----------------------------------------------------------------------===// -#ifndef NDEBUG +#ifndef LLVM_NDEBUG static ExprEngine* GraphPrintCheckerState; static SourceManager* GraphPrintSourceManager; @@ -2655,7 +2655,7 @@ #endif void ExprEngine::ViewGraph(bool trim) { -#ifndef NDEBUG +#ifndef LLVM_NDEBUG if (trim) { std::vector Src; @@ -2686,7 +2686,7 @@ } void ExprEngine::ViewGraph(ArrayRef Nodes) { -#ifndef NDEBUG +#ifndef LLVM_NDEBUG GraphPrintCheckerState = this; GraphPrintSourceManager = &getContext().getSourceManager();