diff options
author | Owen Anderson <resistor@mac.com> | 2008-08-04 23:54:43 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2008-08-04 23:54:43 +0000 |
commit | bd3ba461eb5578a81ba09ff7bd7eb271d1130196 (patch) | |
tree | f97e9269835f2a482c4f28f14e48de796079d007 /lib/CodeGen/LiveVariables.cpp | |
parent | b42a6261225e5a1b9a75b9aa11732944046d7999 (diff) |
- Fix SelectionDAG to generate correct CFGs.
- Add a basic machine-level dead block eliminator.
These two have to go together, since many other parts of the code generator are unable to handle the unreachable blocks otherwise created.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54333 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveVariables.cpp')
-rw-r--r-- | lib/CodeGen/LiveVariables.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/CodeGen/LiveVariables.cpp b/lib/CodeGen/LiveVariables.cpp index 82016ed591..dbe650c0af 100644 --- a/lib/CodeGen/LiveVariables.cpp +++ b/lib/CodeGen/LiveVariables.cpp @@ -29,6 +29,7 @@ #include "llvm/CodeGen/LiveVariables.h" #include "llvm/CodeGen/MachineInstr.h" #include "llvm/CodeGen/MachineRegisterInfo.h" +#include "llvm/CodeGen/Passes.h" #include "llvm/Target/TargetRegisterInfo.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetMachine.h" @@ -43,6 +44,12 @@ using namespace llvm; char LiveVariables::ID = 0; static RegisterPass<LiveVariables> X("livevars", "Live Variable Analysis"); + +void LiveVariables::getAnalysisUsage(AnalysisUsage &AU) const { + AU.addRequiredID(UnreachableMachineBlockElimID); + AU.setPreservesAll(); +} + void LiveVariables::VarInfo::dump() const { cerr << " Alive in blocks: "; for (unsigned i = 0, e = AliveBlocks.size(); i != e; ++i) |