]> granicus.if.org Git - clang/commitdiff
abort when we lower an initializer to the wrong type, as we currently do for:
authorChris Lattner <sabre@nondot.org>
Mon, 10 Dec 2007 00:05:55 +0000 (00:05 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 10 Dec 2007 00:05:55 +0000 (00:05 +0000)
char text[] = "string";

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44752 91177308-0d34-0410-b5e6-96231b3b80d8

CodeGen/CodeGenModule.cpp

index afd23c45012ee7610349b6996b1930fb5ca13358..2ce7f4e8371807a6772fa889b65b8dc49dec5a65 100644 (file)
@@ -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.