projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bc49667
)
[MachineOutliner] Reduce scope of variable and stop duplicate getMF() calls. NFCI.
author
Simon Pilgrim
<llvm-dev@redking.me.uk>
Tue, 5 Nov 2019 15:58:04 +0000
(15:58 +0000)
committer
Simon Pilgrim
<llvm-dev@redking.me.uk>
Tue, 5 Nov 2019 17:08:08 +0000
(17:08 +0000)
llvm/lib/CodeGen/MachineOutliner.cpp
patch
|
blob
|
history
diff --git
a/llvm/lib/CodeGen/MachineOutliner.cpp
b/llvm/lib/CodeGen/MachineOutliner.cpp
index
c4c3f2f
..
9c61bce
100644
(file)
--- 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;
}