summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-08-22 04:16:24 +0000
committerJohn McCall <rjmccall@apple.com>2010-08-22 04:16:24 +0000
commit84fa510aa9ee3ee97ded906fe4635c2952596fe9 (patch)
tree99fc717368577049fd788cb8060618198f79f9ab /clang/lib/CodeGen/CodeGenFunction.cpp
parenta8bbb82c55a3c8885b5cf23dd84f80b2a08c069a (diff)
downloadbcm5719-llvm-84fa510aa9ee3ee97ded906fe4635c2952596fe9.tar.gz
bcm5719-llvm-84fa510aa9ee3ee97ded906fe4635c2952596fe9.zip
Abstract more member-pointerness out.
llvm-svn: 111771
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 5bee016d7e5..ca4e6982293 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 =
OpenPOWER on IntegriCloud