[MachineOutliner] Move hasAddressTaken check to MachineOutliner.cpp
*Mostly* NFC. Still updating the test though just for completeness.
This moves the hasAddressTaken check to MachineOutliner.cpp and replaces it
with a per-basic block test rather than a per-function test. The old test was
too conservative and was preventing functions in C programs from being
outlined even though they were safe to outline.
This was mostly a problem in C sources.
llvm-svn: 322425
diff --git a/llvm/lib/CodeGen/MachineOutliner.cpp b/llvm/lib/CodeGen/MachineOutliner.cpp
index 58d5461..0ee04f7 100644
--- a/llvm/lib/CodeGen/MachineOutliner.cpp
+++ b/llvm/lib/CodeGen/MachineOutliner.cpp
@@ -1357,8 +1357,8 @@
// If it is, look at each MachineBasicBlock in the function.
for (MachineBasicBlock &MBB : MF) {
- // Is there anything in MBB?
- if (MBB.empty())
+ // Is there anything in MBB? And is it the target of an indirect branch?
+ if (MBB.empty() || MBB.hasAddressTaken())
continue;
// If yes, map it.