Fix Clang-tidy modernize-use-nullptr warnings in source directories and generated...
[oota-llvm.git] / lib / Transforms / Instrumentation / SafeStack.cpp
index 8a767617f9097491f324542f6d23eac0bce44064..1b28caffd4a886527fcb439c0f64fb549658d8c5 100644 (file)
@@ -278,7 +278,7 @@ Value *SafeStack::getOrCreateUnsafeStackPtr(IRBuilder<> &IRB, Function &F) {
       UnsafeStackPtr = new GlobalVariable(
           /*Module=*/M, /*Type=*/StackPtrTy,
           /*isConstant=*/false, /*Linkage=*/GlobalValue::ExternalLinkage,
-          /*Initializer=*/0, /*Name=*/kUnsafeStackPtrVar,
+          /*Initializer=*/nullptr, /*Name=*/kUnsafeStackPtrVar,
           /*InsertBefore=*/nullptr,
           /*ThreadLocalMode=*/GlobalValue::InitialExecTLSModel);
     } else {
@@ -443,7 +443,7 @@ SafeStack::moveStaticAllocasToUnsafeStack(IRBuilder<> &IRB, Function &F,
       cast<Instruction>(NewAI)->takeName(AI);
 
     // Replace alloc with the new location.
-    replaceDbgDeclareForAlloca(AI, NewAI, DIB, /*Deref=*/true);
+    replaceDbgDeclareForAlloca(AI, BasePointer, DIB, /*Deref=*/true, -StaticOffset);
     AI->replaceAllUsesWith(NewAI);
     AI->eraseFromParent();
   }
@@ -619,7 +619,7 @@ bool SafeStack::runOnFunction(Function &F) {
   return true;
 }
 
-} // end anonymous namespace
+} // anonymous namespace
 
 char SafeStack::ID = 0;
 INITIALIZE_TM_PASS_BEGIN(SafeStack, "safe-stack",