[cfe-commits] r77915 - in /cfe/trunk/lib/CodeGen: CGDecl.cpp CGExprConstant.cpp CodeGenModule.cpp
Anders Carlsson
andersca at mac.com
Sun Aug 2 14:18:23 PDT 2009
Author: andersca
Date: Sun Aug 2 16:18:22 2009
New Revision: 77915
URL: http://llvm.org/viewvc/llvm-project?rev=77915&view=rev
Log:
use CodeGenModule::EmitNullConstant in a couple of places.
Modified:
cfe/trunk/lib/CodeGen/CGDecl.cpp
cfe/trunk/lib/CodeGen/CGExprConstant.cpp
cfe/trunk/lib/CodeGen/CodeGenModule.cpp
Modified: cfe/trunk/lib/CodeGen/CGDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDecl.cpp?rev=77915&r1=77914&r2=77915&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDecl.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDecl.cpp Sun Aug 2 16:18:22 2009
@@ -105,9 +105,8 @@
const llvm::Type *LTy = CGM.getTypes().ConvertTypeForMem(Ty);
return new llvm::GlobalVariable(CGM.getModule(), LTy,
Ty.isConstant(getContext()), Linkage,
- llvm::Constant::getNullValue(LTy), Name,
- 0, D.isThreadSpecified(),
- Ty.getAddressSpace());
+ CGM.EmitNullConstant(D.getType()), Name, 0,
+ D.isThreadSpecified(), Ty.getAddressSpace());
}
void CodeGenFunction::EmitStaticBlockVarDecl(const VarDecl &D) {
Modified: cfe/trunk/lib/CodeGen/CGExprConstant.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprConstant.cpp?rev=77915&r1=77914&r2=77915&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprConstant.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprConstant.cpp Sun Aug 2 16:18:22 2009
@@ -772,5 +772,5 @@
llvm::Constant *CodeGenModule::EmitNullConstant(QualType T) {
// Always return an LLVM null constant for now; this will change when we
// get support for IRGen of member pointers.
- return llvm::Constant::getNullValue(getTypes().ConvertType(T));
+ return llvm::Constant::getNullValue(getTypes().ConvertTypeForMem(T));
}
Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=77915&r1=77914&r2=77915&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Sun Aug 2 16:18:22 2009
@@ -810,6 +810,7 @@
// exists. A use may still exists, however, so we still may need
// to do a RAUW.
assert(!ASTTy->isIncompleteType() && "Unexpected incomplete type");
+ Init = EmitNullConstant(D->getType());
Init = llvm::Constant::getNullValue(getTypes().ConvertTypeForMem(ASTTy));
} else {
Init = EmitConstantExpr(D->getInit(), D->getType());
More information about the cfe-commits
mailing list