MEGAPATCH checkin.

For details, See: docs/2002-06-25-MegaPatchInfo.txt


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2778 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2002-06-25 16:13:21 +00:00
parent 18961504fc
commit 0b12b5f50e
26 changed files with 654 additions and 726 deletions
+7 -7
View File
@@ -17,10 +17,10 @@ static Statistic<> NumChanged("internalize\t- Number of functions internal'd");
class InternalizePass : public Pass {
const char *getPassName() const { return "Internalize Functions"; }
virtual bool run(Module *M) {
virtual bool run(Module &M) {
bool FoundMain = false; // Look for a function named main...
for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I)
if ((*I)->getName() == "main" && !(*I)->isExternal()) {
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
if (I->getName() == "main" && !I->isExternal()) {
FoundMain = true;
break;
}
@@ -30,10 +30,10 @@ class InternalizePass : public Pass {
bool Changed = false;
// Found a main function, mark all functions not named main as internal.
for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I)
if ((*I)->getName() != "main" && // Leave the main function external
!(*I)->isExternal()) { // Function must be defined here
(*I)->setInternalLinkage(true);
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
if (I->getName() != "main" && // Leave the main function external
!I->isExternal()) { // Function must be defined here
I->setInternalLinkage(true);
Changed = true;
++NumChanged;
}