[llvm-commits] [gcc-plugin] r83073 - /gcc-plugin/trunk/llvm-backend.cpp

Duncan Sands baldrick at free.fr
Tue Sep 29 09:56:54 PDT 2009

Author: baldrick
Date: Tue Sep 29 11:56:54 2009
New Revision: 83073

URL: http://llvm.org/viewvc/llvm-project?rev=83073&view=rev
A CONST_DECL does not have an assembler name.  Since GCC
barfs if you try to get the assembler name for a constant,
better just not even try.  (Another possibility would be
to use the ordinary name of the constant if it has one).
This fires a lot when compiling Fortran.


Modified: gcc-plugin/trunk/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-backend.cpp?rev=83073&r1=83072&r2=83073&view=diff

--- gcc-plugin/trunk/llvm-backend.cpp (original)
+++ gcc-plugin/trunk/llvm-backend.cpp Tue Sep 29 11:56:54 2009
@@ -1375,7 +1375,9 @@
 //TODO  timevar_push(TV_LLVM_GLOBALS);
-  std::string Name = getLLVMAssemblerName(decl).str();
+  std::string Name;
+  if (TREE_CODE(decl) != CONST_DECL) // CONST_DECLs do not have assembler names.
+    Name = getLLVMAssemblerName(decl).str();
   // Now handle ordinary static variables and functions (in memory).
   // Also handle vars declared register invalidly.

More information about the llvm-commits mailing list