diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-11-05 15:58:04 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-11-05 17:08:08 +0000 |
commit | 7ad258361357e4b49c33ff39ce8abdcdf747c702 (patch) | |
tree | c25645a30982cb85c0afd4ef0f7c99e561d35ee7 | |
parent | bc496677d0ecc24e4372b714849b5ecc8636b3a8 (diff) | |
download | bcm5719-llvm-7ad258361357e4b49c33ff39ce8abdcdf747c702.tar.gz bcm5719-llvm-7ad258361357e4b49c33ff39ce8abdcdf747c702.zip |
[MachineOutliner] Reduce scope of variable and stop duplicate getMF() calls. NFCI.
-rw-r--r-- | llvm/lib/CodeGen/MachineOutliner.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/MachineOutliner.cpp b/llvm/lib/CodeGen/MachineOutliner.cpp index c4c3f2f568b..9c61bcee35c 100644 --- a/llvm/lib/CodeGen/MachineOutliner.cpp +++ b/llvm/lib/CodeGen/MachineOutliner.cpp @@ -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; } |