[llvm-commits] [llvm] r41286 - /llvm/trunk/lib/CodeGen/AsmPrinter.cpp

Andrew Lenharth alenhar2 at cs.uiuc.edu
Wed Aug 22 12:33:11 PDT 2007


Author: alenhar2
Date: Wed Aug 22 14:33:11 2007
New Revision: 41286

URL: http://llvm.org/viewvc/llvm-project?rev=41286&view=rev
Log:
move this check.  ppc outputs .no_dead_strip properly

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter.cpp

Modified: llvm/trunk/lib/CodeGen/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter.cpp?rev=41286&r1=41285&r2=41286&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter.cpp Wed Aug 22 14:33:11 2007
@@ -314,6 +314,12 @@
 /// special global used by LLVM.  If so, emit it and return true, otherwise
 /// do nothing and return false.
 bool AsmPrinter::EmitSpecialLLVMGlobal(const GlobalVariable *GV) {
+  if (GV->getName() == "llvm.used") {
+    if (TAI->getUsedDirective() != 0)    // No need to emit this at all.
+      EmitLLVMUsedList(GV->getInitializer());
+    return true;
+  }
+
   // Ignore debug and non-emitted data.
   if (GV->getSection() == "llvm.metadata") return true;
   
@@ -321,12 +327,6 @@
 
   assert(GV->hasInitializer() && "Not a special LLVM global!");
   
-  if (GV->getName() == "llvm.used") {
-    if (TAI->getUsedDirective() != 0)    // No need to emit this at all.
-      EmitLLVMUsedList(GV->getInitializer());
-    return true;
-  }
-
   const TargetData *TD = TM.getTargetData();
   unsigned Align = Log2_32(TD->getPointerPrefAlignment());
   if (GV->getName() == "llvm.global_ctors" && GV->use_empty()) {





More information about the llvm-commits mailing list