From: Duncan P. N. Exon Smith Date: Thu, 20 Mar 2014 18:40:55 +0000 (+0000) Subject: Use nullptr; no functionality change X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=789603ca971a85786a0be846f1cecbd7f03a693f;p=clang Use nullptr; no functionality change git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204372 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CodeGenPGO.cpp b/lib/CodeGen/CodeGenPGO.cpp index 4071caee69..20305c3567 100644 --- a/lib/CodeGen/CodeGenPGO.cpp +++ b/lib/CodeGen/CodeGenPGO.cpp @@ -301,17 +301,17 @@ void CodeGenPGO::emitInstrumentationData() { llvm::Function *CodeGenPGO::emitInitialization(CodeGenModule &CGM) { if (!CGM.getCodeGenOpts().ProfileInstrGenerate) - return 0; + return nullptr; // Only need to create this once per module. if (CGM.getModule().getFunction("__llvm_pgo_init")) - return 0; + return nullptr; // Get the functions to call at initialization. llvm::Constant *RegisterF = getRegisterFunc(CGM); llvm::Constant *WriteAtExitF = getOrInsertRuntimeWriteAtExit(CGM); if (!RegisterF && !WriteAtExitF) - return 0; + return nullptr; // Create the initialization function. auto *VoidTy = llvm::Type::getVoidTy(CGM.getLLVMContext()); @@ -963,7 +963,7 @@ llvm::MDNode *CodeGenPGO::createBranchWeights(uint64_t TrueCount, uint64_t FalseCount) { // Check for empty weights. if (!TrueCount && !FalseCount) - return 0; + return nullptr; // Calculate how to scale down to 32-bits. uint64_t Scale = calculateWeightScale(std::max(TrueCount, FalseCount)); @@ -976,7 +976,7 @@ llvm::MDNode *CodeGenPGO::createBranchWeights(uint64_t TrueCount, llvm::MDNode *CodeGenPGO::createBranchWeights(ArrayRef Weights) { // We need at least two elements to create meaningful weights. if (Weights.size() < 2) - return 0; + return nullptr; // Calculate how to scale down to 32-bits. uint64_t Scale = calculateWeightScale(*std::max_element(Weights.begin(), @@ -994,14 +994,14 @@ llvm::MDNode *CodeGenPGO::createBranchWeights(ArrayRef Weights) { llvm::MDNode *CodeGenPGO::createLoopWeights(const Stmt *Cond, RegionCounter &Cnt) { if (!haveRegionCounts()) - return 0; + return nullptr; uint64_t LoopCount = Cnt.getCount(); uint64_t CondCount = 0; bool Found = getStmtCount(Cond, CondCount); assert(Found && "missing expected loop condition count"); (void)Found; if (CondCount == 0) - return 0; + return nullptr; return createBranchWeights(LoopCount, std::max(CondCount, LoopCount) - LoopCount); }