Add support for 'special' llvm globals like debug info and static ctors/dtors.
authorChris Lattner <sabre@nondot.org>
Thu, 9 Mar 2006 06:14:35 +0000 (06:14 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 9 Mar 2006 06:14:35 +0000 (06:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26628 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Alpha/AlphaAsmPrinter.cpp
lib/Target/IA64/IA64AsmPrinter.cpp
lib/Target/Sparc/SparcAsmPrinter.cpp

index ad42ca3cd1ec14269f42a81a442b9373227b4f8e..6f45fb5497f98df0e6486c857456dff551724278 100644 (file)
@@ -231,6 +231,10 @@ bool AlphaAsmPrinter::doFinalization(Module &M) {
 
   for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I)
     if (I->hasInitializer()) {   // External global require no code
+      // Check to see if this is a special global used by LLVM, if so, emit it.
+      if (EmitSpecialLLVMGlobal(I))
+        continue;
+      
       O << "\n\n";
       std::string name = Mang->getValueName(I);
       Constant *C = I->getInitializer();
index d779104701c9e1c130354ae3afe87648f6468253..09d388b84989dbb6af64c336d5fb40288d428afc 100644 (file)
@@ -288,6 +288,10 @@ bool IA64AsmPrinter::doFinalization(Module &M) {
   for (Module::const_global_iterator I = M.global_begin(), E = M.global_end();
        I != E; ++I)
     if (I->hasInitializer()) {   // External global require no code
+      // Check to see if this is a special global used by LLVM, if so, emit it.
+      if (EmitSpecialLLVMGlobal(I))
+        continue;
+      
       O << "\n\n";
       std::string name = Mang->getValueName(I);
       Constant *C = I->getInitializer();
index 3be81a55ce8d13137140c5da54077d5a82d4e601..4565a997e274472a363dfc6b2b1bfe81cc288d58 100644 (file)
@@ -239,8 +239,13 @@ bool SparcAsmPrinter::doFinalization(Module &M) {
   const TargetData &TD = TM.getTargetData();
 
   // Print out module-level global variables here.
-  for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I)
+  for (Module::const_global_iterator I = M.global_begin(), E = M.global_end();
+       I != E; ++I)
     if (I->hasInitializer()) {   // External global require no code
+      // Check to see if this is a special global used by LLVM, if so, emit it.
+      if (EmitSpecialLLVMGlobal(I))
+        continue;
+      
       O << "\n\n";
       std::string name = Mang->getValueName(I);
       Constant *C = I->getInitializer();