[llvm-commits] [llvm-gcc-4.2] r69817 - /llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
Duncan Sands
baldrick at free.fr
Wed Apr 22 11:55:02 PDT 2009
Author: baldrick
Date: Wed Apr 22 13:55:01 2009
New Revision: 69817
URL: http://llvm.org/viewvc/llvm-project?rev=69817&view=rev
Log:
Fix PR2958: if the type of a global is an as yet
unresolved forward declaration then do not try
to output the global (which will surely fail).
In practice the language front-end will output
an error message later.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=69817&r1=69816&r2=69817&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Wed Apr 22 13:55:01 2009
@@ -1232,6 +1232,10 @@
&& (DECL_DEFER_OUTPUT(decl)))
return;
+ // If we encounter a forward declaration then do not emit the global yet.
+ if (!TYPE_SIZE(TREE_TYPE(decl)))
+ return;
+
timevar_push(TV_LLVM_GLOBALS);
// Get or create the global variable now.
More information about the llvm-commits
mailing list