From 84fa510aa9ee3ee97ded906fe4635c2952596fe9 Mon Sep 17 00:00:00 2001 From: John McCall Date: Sun, 22 Aug 2010 04:16:24 +0000 Subject: Abstract more member-pointerness out. llvm-svn: 111771 --- clang/lib/CodeGen/CodeGenFunction.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp') diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 5bee016d7e50..ca4e69822935 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -579,7 +579,8 @@ CodeGenFunction::EmitNullInitialization(llvm::Value *DestPtr, QualType Ty) { // If the type contains a pointer to data member we can't memset it to zero. // Instead, create a null constant and copy it to the destination. - if (CGM.getTypes().ContainsPointerToDataMember(Ty)) { + if (CGM.getLangOptions().CPlusPlus && + CGM.getCXXABI().RequiresNonZeroInitializer(Ty)) { llvm::Constant *NullConstant = CGM.EmitNullConstant(Ty); llvm::GlobalVariable *NullVariable = -- cgit v1.2.3