[llvm-commits] CVS: llvm/lib/Transforms/IPO/Internalize.cpp
Chris Lattner
sabre at nondot.org
Wed Jun 6 13:52:03 PDT 2007
Changes in directory llvm/lib/Transforms/IPO:
Internalize.cpp updated: 1.49 -> 1.50
---
Log message:
simplify this code and fix PR1493: http://llvm.org/PR1493 , now that llvm-gcc3 is dead.
---
Diffs of the changes: (+2 -17)
Internalize.cpp | 19 ++-----------------
1 files changed, 2 insertions(+), 17 deletions(-)
Index: llvm/lib/Transforms/IPO/Internalize.cpp
diff -u llvm/lib/Transforms/IPO/Internalize.cpp:1.49 llvm/lib/Transforms/IPO/Internalize.cpp:1.50
--- llvm/lib/Transforms/IPO/Internalize.cpp:1.49 Sun May 6 08:37:16 2007
+++ llvm/lib/Transforms/IPO/Internalize.cpp Wed Jun 6 15:51:41 2007
@@ -128,29 +128,14 @@
ExternalNames.insert("llvm.dbg.compile_units");
ExternalNames.insert("llvm.dbg.global_variables");
ExternalNames.insert("llvm.dbg.subprograms");
+ ExternalNames.insert("llvm.global_ctors");
+ ExternalNames.insert("llvm.global_dtors");
// Mark all global variables with initializers as internal as well.
for (Module::global_iterator I = M.global_begin(), E = M.global_end();
I != E; ++I)
if (!I->isDeclaration() && !I->hasInternalLinkage() &&
!ExternalNames.count(I->getName())) {
- // Special case handling of the global ctor and dtor list. When we
- // internalize it, we mark it constant, which allows elimination of
- // the list if it's empty.
- //
- if (I->hasAppendingLinkage() && (I->getName() == "llvm.global_ctors" ||
- I->getName() == "llvm.global_dtors")) {
- // If the global ctors/dtors list has no uses, do not internalize it, as
- // there is no __main in this program, so the asmprinter should handle
- // it.
- if (I->use_empty()) continue;
-
- // Otherwise, also mark the list constant, as we know that it will not
- // be mutated any longer, and the makes simple IPO xforms automatically
- // better.
- I->setConstant(true);
- }
-
I->setLinkage(GlobalValue::InternalLinkage);
Changed = true;
++NumGlobals;
More information about the llvm-commits
mailing list