Use nullptr to silence -Wsentinel when self-hosting on Windows
Richard rejected my Sema change to interpret an integer literal zero in a varargs context as a null pointer, so -Wsentinel sees an integer literal zero and fires off a warning. Only CodeGen currently knows that it promotes integer literal zeroes in this context to pointer size on Windows. I didn't want to teach -Wsentinel about that compatibility hack. Therefore, I'm migrating to C++11 nullptr. llvm-svn: 223079
This commit is contained in:
@@ -915,7 +915,7 @@ llvm::Type *CodeGenModule::getBlockDescriptorType() {
|
||||
// };
|
||||
BlockDescriptorType =
|
||||
llvm::StructType::create("struct.__block_descriptor",
|
||||
UnsignedLongTy, UnsignedLongTy, NULL);
|
||||
UnsignedLongTy, UnsignedLongTy, nullptr);
|
||||
|
||||
// Now form a pointer to that.
|
||||
BlockDescriptorType = llvm::PointerType::getUnqual(BlockDescriptorType);
|
||||
@@ -938,7 +938,7 @@ llvm::Type *CodeGenModule::getGenericBlockLiteralType() {
|
||||
GenericBlockLiteralType =
|
||||
llvm::StructType::create("struct.__block_literal_generic",
|
||||
VoidPtrTy, IntTy, IntTy, VoidPtrTy,
|
||||
BlockDescPtrTy, NULL);
|
||||
BlockDescPtrTy, nullptr);
|
||||
|
||||
return GenericBlockLiteralType;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user