diff options
| author | Chris Lattner <sabre@nondot.org> | 2007-12-10 00:05:55 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2007-12-10 00:05:55 +0000 |
| commit | cb04ac95998db8e7c98b5bb65e28a3d7343b82ff (patch) | |
| tree | d28e1168644422b3a2d0eec00f33b69cd7993d3f /clang/CodeGen/CodeGenModule.cpp | |
| parent | 686628e052861c16263683c4c77579153bd206d5 (diff) | |
| download | bcm5719-llvm-cb04ac95998db8e7c98b5bb65e28a3d7343b82ff.tar.gz bcm5719-llvm-cb04ac95998db8e7c98b5bb65e28a3d7343b82ff.zip | |
abort when we lower an initializer to the wrong type, as we currently do for:
char text[] = "string";
llvm-svn: 44752
Diffstat (limited to 'clang/CodeGen/CodeGenModule.cpp')
| -rw-r--r-- | clang/CodeGen/CodeGenModule.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/CodeGen/CodeGenModule.cpp b/clang/CodeGen/CodeGenModule.cpp index afd23c45012..2ce7f4e8371 100644 --- a/clang/CodeGen/CodeGenModule.cpp +++ b/clang/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. |

