[cfe-commits] r44752 - /cfe/trunk/CodeGen/CodeGenModule.cpp

Chris Lattner sabre at nondot.org
Sun Dec 9 16:05:55 PST 2007


Author: lattner
Date: Sun Dec  9 18:05:55 2007
New Revision: 44752

URL: http://llvm.org/viewvc/llvm-project?rev=44752&view=rev
Log:
abort when we lower an initializer to the wrong type, as we currently do for:
char text[] = "string";



Modified:
    cfe/trunk/CodeGen/CodeGenModule.cpp

Modified: cfe/trunk/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CodeGenModule.cpp?rev=44752&r1=44751&r2=44752&view=diff

==============================================================================
--- cfe/trunk/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/CodeGen/CodeGenModule.cpp Sun Dec  9 18:05:55 2007
@@ -488,8 +488,8 @@
   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.





More information about the cfe-commits mailing list