[llvm] 7ad2583 - [MachineOutliner] Reduce scope of variable and stop duplicate getMF() calls. NFCI.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 5 09:09:10 PST 2019
Author: Simon Pilgrim
Date: 2019-11-05T17:08:08Z
New Revision: 7ad258361357e4b49c33ff39ce8abdcdf747c702
URL: https://github.com/llvm/llvm-project/commit/7ad258361357e4b49c33ff39ce8abdcdf747c702
DIFF: https://github.com/llvm/llvm-project/commit/7ad258361357e4b49c33ff39ce8abdcdf747c702.diff
LOG: [MachineOutliner] Reduce scope of variable and stop duplicate getMF() calls. NFCI.
Added:
Modified:
llvm/lib/CodeGen/MachineOutliner.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/MachineOutliner.cpp b/llvm/lib/CodeGen/MachineOutliner.cpp
index c4c3f2f568b2..9c61bcee35c1 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;
}
More information about the llvm-commits
mailing list