1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00

[Attributor][NFC] Predetermine the module

It could happen that we delete the first function in the SCC in the
future so we should be careful accessing `Functions` after the manifest
stage.
This commit is contained in:
Johannes Doerfert 2020-03-16 20:18:07 -05:00
parent 0995eaf1ca
commit b96d38696d

View File

@ -8794,9 +8794,10 @@ static bool runAttributorOnFunctions(InformationCache &InfoCache,
A.identifyDefaultAbstractAttributes(*F);
}
Module &M = *Functions.front()->getParent();
(void)M;
ChangeStatus Changed = A.run();
assert(!verifyModule(*Functions.front()->getParent(), &errs()) &&
"Module verification failed!");
assert(!verifyModule(M, &errs()) && "Module verification failed!");
LLVM_DEBUG(dbgs() << "[Attributor] Done with " << Functions.size()
<< " functions, result: " << Changed << ".\n");
return Changed == ChangeStatus::CHANGED;