1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 12:43:36 +01:00

[MachineOutliner] Reduce scope of variable and stop duplicate getMF() calls. NFCI.

This commit is contained in:
Simon Pilgrim 2019-11-05 15:58:04 +00:00
parent 4275ea1a33
commit 9827ef622e

View File

@ -904,10 +904,10 @@ struct MachineOutliner : public ModulePass {
/// Return a DISubprogram for OF if one exists, and null otherwise. Helper
/// function for remark emission.
DISubprogram *getSubprogramOrNull(const OutlinedFunction &OF) {
DISubprogram *SP;
for (const Candidate &C : OF.Candidates)
if (C.getMF() && (SP = C.getMF()->getFunction().getSubprogram()))
return SP;
if (MachineFunction *MF = C.getMF())
if (DISubprogram *SP = MF->getFunction().getSubprogram())
return SP;
return nullptr;
}