summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/StackProtector.cpp
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2014-11-13 22:55:19 +0000
committerReid Kleckner <reid@kleckner.net>2014-11-13 22:55:19 +0000
commit971c3ea67b7ba140a5d7634111fd1063d86d2cdd (patch)
tree8848ac3f29b9828ac25ca2b3128764362f430a13 /llvm/lib/CodeGen/StackProtector.cpp
parent8716b58583cf5e753f2dc2cfb214cdf24a839c43 (diff)
downloadbcm5719-llvm-971c3ea67b7ba140a5d7634111fd1063d86d2cdd.tar.gz
bcm5719-llvm-971c3ea67b7ba140a5d7634111fd1063d86d2cdd.zip
Use nullptr instead of NULL for variadic sentinels
Windows defines NULL to 0, which when used as an argument to a variadic function, is not a null pointer constant. As a result, Clang's -Wsentinel fires on this code. Using '0' would be wrong on most 64-bit platforms, but both MSVC and Clang make it work on Windows. Sidestep the issue with nullptr. llvm-svn: 221940
Diffstat (limited to 'llvm/lib/CodeGen/StackProtector.cpp')
-rw-r--r--llvm/lib/CodeGen/StackProtector.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/StackProtector.cpp b/llvm/lib/CodeGen/StackProtector.cpp
index e478f31d545..91cc7b70e7f 100644
--- a/llvm/lib/CodeGen/StackProtector.cpp
+++ b/llvm/lib/CodeGen/StackProtector.cpp
@@ -480,12 +480,12 @@ BasicBlock *StackProtector::CreateFailBB() {
if (Trip.getOS() == llvm::Triple::OpenBSD) {
Constant *StackChkFail = M->getOrInsertFunction(
"__stack_smash_handler", Type::getVoidTy(Context),
- Type::getInt8PtrTy(Context), NULL);
+ Type::getInt8PtrTy(Context), nullptr);
B.CreateCall(StackChkFail, B.CreateGlobalStringPtr(F->getName(), "SSH"));
} else {
Constant *StackChkFail = M->getOrInsertFunction(
- "__stack_chk_fail", Type::getVoidTy(Context), NULL);
+ "__stack_chk_fail", Type::getVoidTy(Context), nullptr);
B.CreateCall(StackChkFail);
}
B.CreateUnreachable();
OpenPOWER on IntegriCloud