summaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/LiveRangeEdit.h
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-05-19 05:25:46 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-05-19 05:25:46 +0000
commit20942dcd8634ad75091fe89669868cfebf74e869 (patch)
treead09246c752d9222d40946d1144773d1439d7f80 /include/llvm/CodeGen/LiveRangeEdit.h
parent791e629deef7e4a410e67527da26405916415d3a (diff)
downloadllvm-20942dcd8634ad75091fe89669868cfebf74e869.tar.gz
llvm-20942dcd8634ad75091fe89669868cfebf74e869.tar.bz2
llvm-20942dcd8634ad75091fe89669868cfebf74e869.tar.xz
Allow LiveRangeEdit to be created with a NULL parent.
The dead code elimination with callbacks is still useful. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157100 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/LiveRangeEdit.h')
-rw-r--r--include/llvm/CodeGen/LiveRangeEdit.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/include/llvm/CodeGen/LiveRangeEdit.h b/include/llvm/CodeGen/LiveRangeEdit.h
index 1831a07a8f..def7b00ce7 100644
--- a/include/llvm/CodeGen/LiveRangeEdit.h
+++ b/include/llvm/CodeGen/LiveRangeEdit.h
@@ -55,7 +55,7 @@ public:
};
private:
- LiveInterval &Parent;
+ LiveInterval *Parent;
SmallVectorImpl<LiveInterval*> &NewRegs;
MachineRegisterInfo &MRI;
LiveIntervals &LIS;
@@ -99,7 +99,7 @@ public:
/// @param vrm Map of virtual registers to physical registers for this
/// function. If NULL, no virtual register map updates will
/// be done. This could be the case if called before Regalloc.
- LiveRangeEdit(LiveInterval &parent,
+ LiveRangeEdit(LiveInterval *parent,
SmallVectorImpl<LiveInterval*> &newRegs,
MachineFunction &MF,
LiveIntervals &lis,
@@ -112,8 +112,11 @@ public:
FirstNew(newRegs.size()),
ScannedRemattable(false) {}
- LiveInterval &getParent() const { return Parent; }
- unsigned getReg() const { return Parent.reg; }
+ LiveInterval &getParent() const {
+ assert(Parent && "No parent LiveInterval");
+ return *Parent;
+ }
+ unsigned getReg() const { return getParent().reg; }
/// Iterator for accessing the new registers added by this edit.
typedef SmallVectorImpl<LiveInterval*>::const_iterator iterator;