diff options
author | Anders Carlsson <andersca@mac.com> | 2010-05-21 22:17:48 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-05-21 22:17:48 +0000 |
commit | 892fa6c5e152dd22e4ba460d5c8cd5c79d657e87 (patch) | |
tree | 9b3716a54eafbe4e9e0fc9c687b1dfb7aeed8462 /lib/CodeGen/CodeGenFunction.cpp | |
parent | d775c66b3a1ea17e770cf8fbf4ae37c667c1e043 (diff) |
Unbreak self-host.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104390 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenFunction.cpp | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp index 222dcc4b8f..d3bf1645a0 100644 --- a/lib/CodeGen/CodeGenFunction.cpp +++ b/lib/CodeGen/CodeGenFunction.cpp @@ -472,23 +472,7 @@ void CodeGenFunction::ErrorUnsupported(const Stmt *S, const char *Type, CGM.ErrorUnsupported(S, Type, OmitOnError); } -void -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)) { - llvm::Constant *NullConstant = CGM.EmitNullConstant(Ty); - - llvm::GlobalVariable *NullVariable = - new llvm::GlobalVariable(CGM.getModule(), NullConstant->getType(), - /*isConstant=*/true, - llvm::GlobalVariable::PrivateLinkage, - NullConstant, llvm::Twine()); - EmitAggregateCopy(DestPtr, NullVariable, Ty, /*isVolatile=*/false); - return; - } - - +void CodeGenFunction::EmitMemSetToZero(llvm::Value *DestPtr, QualType Ty) { // Ignore empty classes in C++. if (getContext().getLangOptions().CPlusPlus) { if (const RecordType *RT = Ty->getAs<RecordType>()) { @@ -497,9 +481,6 @@ CodeGenFunction::EmitNullInitialization(llvm::Value *DestPtr, QualType Ty) { } } - // Otherwise, just memset the whole thing to zero. This is legal - // because in LLVM, all default initializers (other than the ones we just - // handled above) are guaranteed to have a bit pattern of all zeros. const llvm::Type *BP = llvm::Type::getInt8PtrTy(VMContext); if (DestPtr->getType() != BP) DestPtr = Builder.CreateBitCast(DestPtr, BP, "tmp"); |