diff options
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CGBlocks.cpp | 10 | ||||
-rw-r--r-- | clang/lib/CodeGen/CGClass.cpp | 18 | ||||
-rw-r--r-- | clang/lib/CodeGen/CGException.cpp | 14 | ||||
-rw-r--r-- | clang/lib/CodeGen/CGObjCMac.cpp | 3 | ||||
-rw-r--r-- | clang/lib/CodeGen/CodeGenPGO.cpp | 4 |
5 files changed, 22 insertions, 27 deletions
diff --git a/clang/lib/CodeGen/CGBlocks.cpp b/clang/lib/CodeGen/CGBlocks.cpp index 70006b022eb..7644ab9beee 100644 --- a/clang/lib/CodeGen/CGBlocks.cpp +++ b/clang/lib/CodeGen/CGBlocks.cpp @@ -1,4 +1,4 @@ -//===--- CGBlocks.cpp - Emit LLVM Code for declarations -------------------===// +//===--- CGBlocks.cpp - Emit LLVM Code for declarations ---------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -78,7 +78,7 @@ static llvm::Constant *buildBlockDescriptor(CodeGenModule &CGM, ASTContext &C = CGM.getContext(); llvm::Type *ulong = CGM.getTypes().ConvertType(C.UnsignedLongTy); - llvm::Type *i8p = NULL; + llvm::Type *i8p = nullptr; if (CGM.getLangOpts().OpenCL) i8p = llvm::Type::getInt8PtrTy( @@ -232,7 +232,7 @@ namespace { return getPrefOrder(left) < getPrefOrder(right); } -} +} // end anonymous namespace /// Determines if the given type is safe for constant capture in C++. static bool isSafeForCXXConstantCapture(QualType type) { @@ -943,7 +943,6 @@ llvm::Type *CodeGenModule::getGenericBlockLiteralType() { return GenericBlockLiteralType; } - RValue CodeGenFunction::EmitBlockCallExpr(const CallExpr *E, ReturnValueSlot ReturnValue) { const BlockPointerType *BPT = @@ -1305,7 +1304,6 @@ CodeGenFunction::GenerateBlockFunction(GlobalDecl GD, } */ - /// Generate the copy-helper function for a block closure object: /// static void block_copy_helper(block_t *dst, block_t *src); /// The runtime will have previously initialized 'dst' by doing a @@ -2252,7 +2250,7 @@ namespace { CGF.BuildBlockRelease(Addr, BLOCK_FIELD_IS_BYREF); } }; -} +} // end anonymous namespace /// Enter a cleanup to destroy a __block variable. Note that this /// cleanup should be a no-op if the variable hasn't left the stack diff --git a/clang/lib/CodeGen/CGClass.cpp b/clang/lib/CodeGen/CGClass.cpp index 5c08f67d402..77ec7f2f7fa 100644 --- a/clang/lib/CodeGen/CGClass.cpp +++ b/clang/lib/CodeGen/CGClass.cpp @@ -1,4 +1,4 @@ -//===--- CGClass.cpp - Emit LLVM Code for C++ classes ---------------------===// +//===--- CGClass.cpp - Emit LLVM Code for C++ classes -----------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -508,7 +508,7 @@ namespace { // external code might potentially access the vtable. void VisitCXXThisExpr(const CXXThisExpr *E) { UsesThis = true; } }; -} +} // end anonymous namespace static bool BaseInitializerUsesThis(ASTContext &C, const Expr *Init) { DynamicThisUseChecker Checker(C); @@ -930,7 +930,7 @@ void CodeGenFunction::EmitConstructorBody(FunctionArgList &Args) { return; } - const FunctionDecl *Definition = 0; + const FunctionDecl *Definition = nullptr; Stmt *Body = Ctor->getBody(Definition); assert(Definition == Ctor && "emitting wrong constructor body"); @@ -987,7 +987,7 @@ namespace { SanitizerSet OldSanOpts; }; } - + namespace { class FieldMemcpyizer { public: @@ -1342,8 +1342,7 @@ namespace { emitAggregatedStmts(); } }; - -} +} // end anonymous namespace static bool isInitializerOfDynamicClass(const CXXCtorInitializer *BaseInit) { const Type *BaseType = BaseInit->getBaseClass(); @@ -1802,7 +1801,7 @@ namespace { EmitSanitizerDtorCallback(CGF, VTablePtr, PoisonSize); } }; -} +} // end anonymous namespace /// \brief Emit all code that comes at the end of class's /// destructor. This is to call destructors on members and base classes @@ -1941,7 +1940,6 @@ void CodeGenFunction::EmitCXXAggrConstructorCall(const CXXConstructorDecl *ctor, Address arrayBase, const CXXConstructExpr *E, bool zeroInitialize) { - // It's legal for numElements to be zero. This can happen both // dynamically, because x can be zero in 'new A[x]', and statically, // because of GCC extensions that permit zero-length arrays. There @@ -2240,7 +2238,7 @@ namespace { /*Delegating=*/true, Addr); } }; -} +} // end anonymous namespace void CodeGenFunction::EmitDelegatingCXXConstructorCall(const CXXConstructorDecl *Ctor, @@ -2520,7 +2518,7 @@ void CodeGenFunction::EmitVTablePtrCheckForCast(QualType T, if (!SanOpts.has(SanitizerKind::CFICastStrict)) ClassDecl = LeastDerivedClassWithSameLayout(ClassDecl); - llvm::BasicBlock *ContBlock = 0; + llvm::BasicBlock *ContBlock = nullptr; if (MayBeNull) { llvm::Value *DerivedNotNull = diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp index 85204f4c9af..ebeb7270852 100644 --- a/clang/lib/CodeGen/CGException.cpp +++ b/clang/lib/CodeGen/CGException.cpp @@ -1,4 +1,4 @@ -//===--- CGException.cpp - Emit LLVM Code for C++ exceptions --------------===// +//===--- CGException.cpp - Emit LLVM Code for C++ exceptions ----*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -346,7 +346,7 @@ namespace { CGF.EmitNounwindRuntimeCall(getFreeExceptionFn(CGF.CGM), exn); } }; -} +} // end anonymous namespace // Emits an exception expression into the given location. This // differs from EmitAnyExprToMem only in that, if a final copy-ctor @@ -1191,7 +1191,7 @@ namespace { CGF.EnsureInsertPoint(); } }; -} +} // end anonymous namespace /// Enters a finally block for an implementation using zero-cost /// exceptions. This is mostly general, but hard-codes some @@ -1313,7 +1313,7 @@ llvm::BasicBlock *CodeGenFunction::getTerminateLandingPad() { llvm::StructType::get(Int8PtrTy, Int32Ty, nullptr), 0); LPadInst->addClause(getCatchAllValue(*this)); - llvm::Value *Exn = 0; + llvm::Value *Exn = nullptr; if (getLangOpts().CPlusPlus) Exn = Builder.CreateExtractValue(LPadInst, 0); llvm::CallInst *terminateCall = @@ -1341,7 +1341,7 @@ llvm::BasicBlock *CodeGenFunction::getTerminateHandler() { EHPersonality::get(*this).isMSVCPersonality()) { Builder.CreateTerminatePad(/*UnwindBB=*/nullptr, CGM.getTerminateFn()); } else { - llvm::Value *Exn = 0; + llvm::Value *Exn = nullptr; if (getLangOpts().CPlusPlus) Exn = getExceptionFromSlot(); llvm::CallInst *terminateCall = @@ -1465,7 +1465,7 @@ struct PerformSEHFinally final : EHScopeStack::Cleanup { CleanupEndBB); } }; -} +} // end anonymous namespace namespace { /// Find all local variable captures in the statement. @@ -1524,7 +1524,7 @@ struct CaptureFinder : ConstStmtVisitor<CaptureFinder> { } } }; -} +} // end anonymous namespace Address CodeGenFunction::recoverAddrOfEscapedLocal( CodeGenFunction &ParentCGF, Address ParentVar, llvm::Value *ParentFP) { diff --git a/clang/lib/CodeGen/CGObjCMac.cpp b/clang/lib/CodeGen/CGObjCMac.cpp index 5435d4a61c8..bedfd69cd72 100644 --- a/clang/lib/CodeGen/CGObjCMac.cpp +++ b/clang/lib/CodeGen/CGObjCMac.cpp @@ -970,7 +970,6 @@ protected: llvm::Constant *getBitmapBlockLayout(bool ComputeByrefLayout); - /// GetIvarLayoutName - Returns a unique constant for the given /// ivar layout bitmap. llvm::Constant *GetIvarLayoutName(IdentifierInfo *Ident, @@ -6718,7 +6717,7 @@ llvm::Value *CGObjCNonFragileABIMac::EmitClassRef(CodeGenFunction &CGF, llvm::Value *CGObjCNonFragileABIMac::EmitNSAutoreleasePoolClassRef( CodeGenFunction &CGF) { IdentifierInfo *II = &CGM.getContext().Idents.get("NSAutoreleasePool"); - return EmitClassRefFromId(CGF, II, false, 0); + return EmitClassRefFromId(CGF, II, false, nullptr); } llvm::Value * diff --git a/clang/lib/CodeGen/CodeGenPGO.cpp b/clang/lib/CodeGen/CodeGenPGO.cpp index 8dffefc871f..a1d06cb80b1 100644 --- a/clang/lib/CodeGen/CodeGenPGO.cpp +++ b/clang/lib/CodeGen/CodeGenPGO.cpp @@ -604,7 +604,7 @@ struct ComputeRegionCounts : public ConstStmtVisitor<ComputeRegionCounts> { RecordNextStmtCount = true; } }; -} +} // end anonymous namespace void PGOHash::combine(HashType Type) { // Check that we never combine 0 and only have six bits. @@ -763,7 +763,7 @@ CodeGenPGO::applyFunctionAttributes(llvm::IndexedInstrProfReader *PGOReader, return; uint64_t MaxFunctionCount = PGOReader->getMaximumFunctionCount(); - uint64_t FunctionCount = getRegionCount(0); + uint64_t FunctionCount = getRegionCount(nullptr); if (FunctionCount >= (uint64_t)(0.3 * (double)MaxFunctionCount)) // Turn on InlineHint attribute for hot functions. // FIXME: 30% is from preliminary tuning on SPEC, it may not be optimal. |