summaryrefslogtreecommitdiff
path: root/lib/CodeGen/MachineTraceMetrics.h
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-07-30 18:34:11 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-07-30 18:34:11 +0000
commita1b2bf79796d8c44b1321a69a7236b85c33ef7ca (patch)
treef937bb0b383e4c1c8f291ee313eaf1a4f94b6fd3 /lib/CodeGen/MachineTraceMetrics.h
parentee31ae12e8a7b843e97285b321cb1f485cd77248 (diff)
downloadllvm-a1b2bf79796d8c44b1321a69a7236b85c33ef7ca.tar.gz
llvm-a1b2bf79796d8c44b1321a69a7236b85c33ef7ca.tar.bz2
llvm-a1b2bf79796d8c44b1321a69a7236b85c33ef7ca.tar.xz
Add MachineTraceMetrics::verify().
This function verifies the consistency of cached data in the MachineTraceMetrics analysis. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160976 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineTraceMetrics.h')
-rw-r--r--lib/CodeGen/MachineTraceMetrics.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/CodeGen/MachineTraceMetrics.h b/lib/CodeGen/MachineTraceMetrics.h
index 40da272932..fa4970a07c 100644
--- a/lib/CodeGen/MachineTraceMetrics.h
+++ b/lib/CodeGen/MachineTraceMetrics.h
@@ -61,6 +61,7 @@ class MachineLoop;
class raw_ostream;
class MachineTraceMetrics : public MachineFunctionPass {
+ const MachineFunction *MF;
const TargetInstrInfo *TII;
const TargetRegisterInfo *TRI;
const MachineRegisterInfo *MRI;
@@ -178,7 +179,7 @@ public:
virtual const MachineBasicBlock *pickTracePred(const MachineBasicBlock*) =0;
virtual const MachineBasicBlock *pickTraceSucc(const MachineBasicBlock*) =0;
explicit Ensemble(MachineTraceMetrics*);
- MachineLoop *getLoopFor(const MachineBasicBlock*);
+ const MachineLoop *getLoopFor(const MachineBasicBlock*) const;
const TraceBlockInfo *getDepthResources(const MachineBasicBlock*) const;
const TraceBlockInfo *getHeightResources(const MachineBasicBlock*) const;
@@ -187,6 +188,7 @@ public:
virtual const char *getName() const =0;
void print(raw_ostream&) const;
void invalidate(const MachineBasicBlock *MBB);
+ void verify() const;
/// Get the trace that passes through MBB.
/// The trace is computed on demand.
@@ -210,6 +212,10 @@ public:
/// is erased, or the CFG is otherwise changed.
void invalidate(const MachineBasicBlock *MBB);
+ /// Verify the internal consistency of cached data.
+ /// This does nothing in NDEBUG builds.
+ void verify() const;
+
private:
// One entry per basic block, indexed by block number.
SmallVector<FixedBlockInfo, 4> BlockInfo;