aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--lib/CodeGen/CodeGenModule.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index 3d01770cd3..7432b01e25 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/lib/CodeGen/CodeGenModule.cpp
@@ -626,8 +626,11 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D) {
Init = llvm::Constant::getNullValue(InitTy);
} else {
Init = EmitConstantExpr(D->getInit());
- if (!Init)
+ if (!Init) {
ErrorUnsupported(D, "static initializer");
+ QualType T = D->getInit()->getType();
+ Init = llvm::UndefValue::get(getTypes().ConvertType(T));
+ }
}
const llvm::Type* InitType = Init->getType();