mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-02 23:26:31 +00:00
Modernize the error handling of the Materialize function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220600 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -482,8 +482,11 @@ static GlobalObject *makeInternalReplacement(GlobalObject *GO) {
|
||||
Module *M = GO->getParent();
|
||||
GlobalObject *Ret;
|
||||
if (auto *F = dyn_cast<Function>(GO)) {
|
||||
if (F->isMaterializable())
|
||||
F->Materialize();
|
||||
if (F->isMaterializable()) {
|
||||
if (std::error_code EC = F->materialize())
|
||||
message(LDPL_FATAL, "LLVM gold plugin has failed to read a function");
|
||||
|
||||
}
|
||||
|
||||
auto *NewF = Function::Create(F->getFunctionType(), F->getLinkage(),
|
||||
F->getName(), M);
|
||||
|
Reference in New Issue
Block a user