OSDN Git Service

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 ad42ca3..6f45fb5 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 d779104..09d388b 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 3be81a5..4565a99 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();