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:
parent
4275ea1a33
commit
9827ef622e
@ -904,10 +904,10 @@ struct MachineOutliner : public ModulePass {
|
|||||||
/// Return a DISubprogram for OF if one exists, and null otherwise. Helper
|
/// Return a DISubprogram for OF if one exists, and null otherwise. Helper
|
||||||
/// function for remark emission.
|
/// function for remark emission.
|
||||||
DISubprogram *getSubprogramOrNull(const OutlinedFunction &OF) {
|
DISubprogram *getSubprogramOrNull(const OutlinedFunction &OF) {
|
||||||
DISubprogram *SP;
|
|
||||||
for (const Candidate &C : OF.Candidates)
|
for (const Candidate &C : OF.Candidates)
|
||||||
if (C.getMF() && (SP = C.getMF()->getFunction().getSubprogram()))
|
if (MachineFunction *MF = C.getMF())
|
||||||
return SP;
|
if (DISubprogram *SP = MF->getFunction().getSubprogram())
|
||||||
|
return SP;
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user