[llvm-commits] CVS: llvm/lib/Transforms/IPO/Internalize.cpp
Chris Lattner
lattner at cs.uiuc.edu
Thu Jun 26 00:31:01 PDT 2003
Changes in directory llvm/lib/Transforms/IPO:
Internalize.cpp updated: 1.16 -> 1.17
---
Log message:
When internalizing global ctor/dtor list, also mark it constant. This is gross, but
until DSA is working all of the time and is totally reliable, we do this.
---
Diffs of the changes:
Index: llvm/lib/Transforms/IPO/Internalize.cpp
diff -u llvm/lib/Transforms/IPO/Internalize.cpp:1.16 llvm/lib/Transforms/IPO/Internalize.cpp:1.17
--- llvm/lib/Transforms/IPO/Internalize.cpp:1.16 Thu May 22 15:27:13 2003
+++ llvm/lib/Transforms/IPO/Internalize.cpp Thu Jun 26 00:30:40 2003
@@ -87,6 +87,14 @@
for (Module::giterator I = M.gbegin(), E = M.gend(); I != E; ++I)
if (!I->isExternal() && !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"))
+ I->setConstant(true);
+
I->setLinkage(GlobalValue::InternalLinkage);
Changed = true;
++NumGlobals;
More information about the llvm-commits
mailing list