mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-26 23:38:31 +00:00
Don't accidentally create MachineFunctions in mir-debugify/mir-strip-debugify
We should only modify existing ones. Previously, we were creating MachineFunctions for externally-available functions. AFAICT this was benign in tree but ultimately led to asan bugs in our out of tree target.
This commit is contained in:
parent
9d5348b366
commit
a8cde5881b
@ -27,7 +27,10 @@ using namespace llvm;
|
||||
namespace {
|
||||
bool applyDebugifyMetadataToMachineFunction(MachineModuleInfo &MMI,
|
||||
DIBuilder &DIB, Function &F) {
|
||||
MachineFunction &MF = MMI.getOrCreateMachineFunction(F);
|
||||
MachineFunction *MaybeMF = MMI.getMachineFunction(F);
|
||||
if (!MaybeMF)
|
||||
return false;
|
||||
MachineFunction &MF = *MaybeMF;
|
||||
|
||||
DISubprogram *SP = F.getSubprogram();
|
||||
assert(SP && "IR Debugify just created it?");
|
||||
|
@ -45,7 +45,10 @@ struct StripDebugMachineModule : public ModulePass {
|
||||
|
||||
bool Changed = false;
|
||||
for (Function &F : M.functions()) {
|
||||
MachineFunction &MF = MMI.getOrCreateMachineFunction(F);
|
||||
MachineFunction *MaybeMF = MMI.getMachineFunction(F);
|
||||
if (!MaybeMF)
|
||||
continue;
|
||||
MachineFunction &MF = *MaybeMF;
|
||||
for (MachineBasicBlock &MBB : MF) {
|
||||
for (MachineBasicBlock::iterator I = MBB.begin(), E = MBB.end();
|
||||
I != E;) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user