mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-23 01:24:30 +00:00
eliminate RegisterOpt. It does the same thing as RegisterPass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29925 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -43,7 +43,7 @@ namespace {
|
||||
|
||||
bool runOnModule(Module &M);
|
||||
};
|
||||
RegisterOpt<FunctionResolvingPass> X("funcresolve", "Resolve Functions");
|
||||
RegisterPass<FunctionResolvingPass> X("funcresolve", "Resolve Functions");
|
||||
}
|
||||
|
||||
ModulePass *llvm::createFunctionResolvingPass() {
|
||||
@ -314,7 +314,8 @@ bool FunctionResolvingPass::runOnModule(Module &M) {
|
||||
Globals[F->getName()].push_back(F);
|
||||
}
|
||||
|
||||
for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ) {
|
||||
for (Module::global_iterator I = M.global_begin(), E = M.global_end();
|
||||
I != E; ) {
|
||||
GlobalVariable *GV = I++;
|
||||
if (GV->use_empty() && GV->isExternal()) {
|
||||
M.getGlobalList().erase(GV);
|
||||
@ -346,7 +347,8 @@ bool FunctionResolvingPass::runOnModule(Module &M) {
|
||||
++I;
|
||||
}
|
||||
|
||||
for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; )
|
||||
for (Module::global_iterator I = M.global_begin(), E = M.global_end();
|
||||
I != E; )
|
||||
if (I->isExternal() && I->use_empty()) {
|
||||
GlobalVariable *GV = I;
|
||||
++I;
|
||||
|
Reference in New Issue
Block a user