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:
Chris Lattner
2006-08-27 22:42:52 +00:00
parent 21a82e6fc7
commit 7f8897f22e
76 changed files with 107 additions and 149 deletions

View File

@ -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;