[llvm-commits] CVS: llvm/lib/CodeGen/AsmPrinter.cpp

Chris Lattner lattner at cs.uiuc.edu
Thu Jan 12 11:17:36 PST 2006



Changes in directory llvm/lib/CodeGen:

AsmPrinter.cpp updated: 1.36 -> 1.37
---
Log message:

If using __main, emit global ctor/dtor list like any other global


---
Diffs of the changes:  (+2 -2)

 AsmPrinter.cpp |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Index: llvm/lib/CodeGen/AsmPrinter.cpp
diff -u llvm/lib/CodeGen/AsmPrinter.cpp:1.36 llvm/lib/CodeGen/AsmPrinter.cpp:1.37
--- llvm/lib/CodeGen/AsmPrinter.cpp:1.36	Wed Jan  4 16:28:25 2006
+++ llvm/lib/CodeGen/AsmPrinter.cpp	Thu Jan 12 13:17:23 2006
@@ -120,14 +120,14 @@
   if (GV->getName() == "llvm.used")
     return true;  // No need to emit this at all.
 
-  if (GV->getName() == "llvm.global_ctors") {
+  if (GV->getName() == "llvm.global_ctors" && GV->use_empty()) {
     SwitchSection(StaticCtorsSection, 0);
     EmitAlignment(2, 0);
     EmitXXStructorList(GV->getInitializer());
     return true;
   } 
   
-  if (GV->getName() == "llvm.global_dtors") {
+  if (GV->getName() == "llvm.global_dtors" && GV->use_empty()) {
     SwitchSection(StaticDtorsSection, 0);
     EmitAlignment(2, 0);
     EmitXXStructorList(GV->getInitializer());






More information about the llvm-commits mailing list