mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-21 12:38:45 +00:00
Simplify funcresolve a bit more
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6480 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
567cceea49
commit
40c4959e9f
@ -183,19 +183,19 @@ static bool ResolveFunctions(Module &M, std::vector<GlobalValue*> &Globals,
|
|||||||
Changed = true;
|
Changed = true;
|
||||||
++NumResolved;
|
++NumResolved;
|
||||||
} else {
|
} else {
|
||||||
std::cerr << "Couldn't cleanup this function call, must be an"
|
|
||||||
<< " argument or something!" << CI;
|
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
} else if (ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(U)) {
|
|
||||||
Constant *NewCPR = ConstantPointerRef::get(Concrete);
|
|
||||||
CPR->replaceAllUsesWith(ConstantExpr::getCast(NewCPR,CPR->getType()));
|
|
||||||
CPR->destroyConstant();
|
|
||||||
} else {
|
} else {
|
||||||
std::cerr << "Cannot convert use of function: " << U << "\n";
|
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If there are any more uses that we could not resolve, force them to use
|
||||||
|
// a casted pointer now.
|
||||||
|
if (!Old->use_empty()) {
|
||||||
|
Constant *NewCPR = ConstantPointerRef::get(Concrete);
|
||||||
|
Old->replaceAllUsesWith(ConstantExpr::getCast(NewCPR, Old->getType()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return Changed;
|
return Changed;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user