X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=blobdiff_plain;f=tools%2Fgold%2Fgold-plugin.cpp;h=2d50f49ffd786456b7e57740dd4ac998c248adcf;hp=8ebae0e498c496d0990b6857fce37586e51593bd;hb=c498284e46864744036b9e167cb960058618a4fc;hpb=44ccedc273eb5a30f51e1cd6bda95e697e754e94 diff --git a/tools/gold/gold-plugin.cpp b/tools/gold/gold-plugin.cpp index 8ebae0e498c..2d50f49ffd7 100644 --- a/tools/gold/gold-plugin.cpp +++ b/tools/gold/gold-plugin.cpp @@ -482,8 +482,11 @@ static GlobalObject *makeInternalReplacement(GlobalObject *GO) { Module *M = GO->getParent(); GlobalObject *Ret; if (auto *F = dyn_cast(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);