aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/LiveVariables.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2008-08-04 23:54:43 +0000
committerOwen Anderson <resistor@mac.com>2008-08-04 23:54:43 +0000
commita102290bdcc20fbc421ac706714cf98c19adc35c (patch)
treec6935c9b899a6dccb4c780fb4d289093e0a41747 /llvm/lib/CodeGen/LiveVariables.cpp
parent61f67624c3a3fc56f6445e9f533d06fbcfa0ef18 (diff)
downloadllvm-a102290bdcc20fbc421ac706714cf98c19adc35c.zip
llvm-a102290bdcc20fbc421ac706714cf98c19adc35c.tar.gz
llvm-a102290bdcc20fbc421ac706714cf98c19adc35c.tar.bz2
- 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. llvm-svn: 54333
Diffstat (limited to 'llvm/lib/CodeGen/LiveVariables.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveVariables.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/LiveVariables.cpp b/llvm/lib/CodeGen/LiveVariables.cpp
index 82016ed..dbe650c 100644
--- a/llvm/lib/CodeGen/LiveVariables.cpp
+++ b/llvm/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)