forked from OSchip/llvm-project
use CodeGenModule::EmitNullConstant in a couple of places.
llvm-svn: 77915
This commit is contained in:
parent
133d9105d3
commit
f18318cf4e
|
@ -105,9 +105,8 @@ CodeGenFunction::CreateStaticBlockVarDecl(const VarDecl &D,
|
|||
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) {
|
||||
|
|
|
@ -772,5 +772,5 @@ llvm::Constant *CodeGenModule::EmitConstantExpr(const Expr *E,
|
|||
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));
|
||||
}
|
||||
|
|
|
@ -810,6 +810,7 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D) {
|
|||
// 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());
|
||||
|
|
Loading…
Reference in New Issue