mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 13:11:39 +01:00
Don't try to materialize a function that isn't materializable anyways. This
fixes a crash using FPM on a Function that isn't owned by a Module. llvm-svn: 96273
This commit is contained in:
parent
1357e1c99a
commit
1dcde6b319
@ -1220,9 +1220,11 @@ void FunctionPassManager::add(Pass *P) {
|
||||
/// so, return true.
|
||||
///
|
||||
bool FunctionPassManager::run(Function &F) {
|
||||
std::string errstr;
|
||||
if (F.Materialize(&errstr)) {
|
||||
llvm_report_error("Error reading bitcode file: " + errstr);
|
||||
if (F.isMaterializable()) {
|
||||
std::string errstr;
|
||||
if (F.Materialize(&errstr)) {
|
||||
llvm_report_error("Error reading bitcode file: " + errstr);
|
||||
}
|
||||
}
|
||||
return FPM->run(F);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user