aboutsummaryrefslogtreecommitdiff
path: root/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-12-10 00:05:55 +0000
committerChris Lattner <sabre@nondot.org>2007-12-10 00:05:55 +0000
commitf89dfb292478b0921c68ef7177ceb738bee1e11b (patch)
tree52cbeba776e70211aeefbbf5e69849b4b6fc0a82 /CodeGen/CodeGenModule.cpp
parent5ccc7011e6b4a4151598a2608a6acd56dbd14b9c (diff)
abort when we lower an initializer to the wrong type, as we currently do for:
char text[] = "string"; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44752 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CodeGen/CodeGenModule.cpp')
-rw-r--r--CodeGen/CodeGenModule.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/CodeGen/CodeGenModule.cpp b/CodeGen/CodeGenModule.cpp
index afd23c4501..2ce7f4e837 100644
--- a/CodeGen/CodeGenModule.cpp
+++ b/CodeGen/CodeGenModule.cpp
@@ -488,8 +488,8 @@ void CodeGenModule::EmitGlobalVar(const FileVarDecl *D) {
if (!Init)
Init = EmitGlobalInit(D->getInit());
- assert(Init && "FIXME: Global variable initializers unimp!");
-
+ assert(GV->getType()->getElementType() == Init->getType() &&
+ "Initializer codegen type mismatch!");
GV->setInitializer(Init);
// Set the llvm linkage type as appropriate.