Hook into PassManager's analysis verification.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Mon, 30 Jul 2012 20:57:50 +0000 (20:57 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Mon, 30 Jul 2012 20:57:50 +0000 (20:57 +0000)
By overriding Pass::verifyAnalysis(), the pass contents will be verified
by the pass manager.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160994 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/EarlyIfConversion.cpp
lib/CodeGen/MachineTraceMetrics.cpp
lib/CodeGen/MachineTraceMetrics.h

index f5cf107de7e2be97a2d4824ae98afe90bc0fe20a..e49b9d3e18effc791487d5b5859f793afc861d97 100644 (file)
@@ -586,13 +586,13 @@ void EarlyIfConverter::updateLoops(ArrayRef<MachineBasicBlock*> Removed) {
 
 /// Invalidate MachineTraceMetrics before if-conversion.
 void EarlyIfConverter::invalidateTraces() {
-  Traces->verify();
+  Traces->verifyAnalysis();
   Traces->invalidate(IfConv.Head);
   Traces->invalidate(IfConv.Tail);
   Traces->invalidate(IfConv.TBB);
   Traces->invalidate(IfConv.FBB);
   DEBUG(if (MinInstr) MinInstr->print(dbgs()));
-  Traces->verify();
+  Traces->verifyAnalysis();
 }
 
 /// Apply cost model and heuristics to the if-conversion in IfConv.
index cf0d9c64412e72f5fc734402c7cd46d1185d584d..c31e6bd92a90e6730d3cc415f75948c2337bfab1 100644 (file)
@@ -284,7 +284,7 @@ void MachineTraceMetrics::invalidate(const MachineBasicBlock *MBB) {
       Ensembles[i]->invalidate(MBB);
 }
 
-void MachineTraceMetrics::verify() const {
+void MachineTraceMetrics::verifyAnalysis() const {
 #ifndef NDEBUG
   assert(BlockInfo.size() == MF->getNumBlockIDs() && "Outdated BlockInfo size");
   for (unsigned i = 0; i != TS_NumStrategies; ++i)
index fa4970a07c8c2fd8ca98bf7755e3c45537383f00..56ea74ea85ff7324b915af3d2f40a4c6798f59e0 100644 (file)
@@ -75,6 +75,7 @@ public:
   void getAnalysisUsage(AnalysisUsage&) const;
   bool runOnMachineFunction(MachineFunction&);
   void releaseMemory();
+  void verifyAnalysis() const;
 
   friend class Ensemble;
   friend class Trace;
@@ -212,10 +213,6 @@ 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;