summaryrefslogtreecommitdiff
path: root/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
commitbd3ba461eb5578a81ba09ff7bd7eb271d1130196 (patch)
treef97e9269835f2a482c4f28f14e48de796079d007 /lib/CodeGen/LiveVariables.cpp
parentb42a6261225e5a1b9a75b9aa11732944046d7999 (diff)
downloadllvm-bd3ba461eb5578a81ba09ff7bd7eb271d1130196.tar.gz
llvm-bd3ba461eb5578a81ba09ff7bd7eb271d1130196.tar.bz2
llvm-bd3ba461eb5578a81ba09ff7bd7eb271d1130196.tar.xz
- 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.cpp7
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)