mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 08:17:40 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user