[llvm-commits] [llvm] r161004 - /llvm/trunk/lib/CodeGen/MachineTraceMetrics.cpp
Jakob Stoklund Olesen
stoklund at 2pi.dk
Mon Jul 30 16:15:12 PDT 2012
Author: stoklund
Date: Mon Jul 30 18:15:12 2012
New Revision: 161004
URL: http://llvm.org/viewvc/llvm-project?rev=161004&view=rev
Log:
Avoid looking at stale data in verifyAnalysis().
Modified:
llvm/trunk/lib/CodeGen/MachineTraceMetrics.cpp
Modified: llvm/trunk/lib/CodeGen/MachineTraceMetrics.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineTraceMetrics.cpp?rev=161004&r1=161003&r2=161004&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineTraceMetrics.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineTraceMetrics.cpp Mon Jul 30 18:15:12 2012
@@ -33,7 +33,7 @@
"machine-trace-metrics", "Machine Trace Metrics", false, true)
MachineTraceMetrics::MachineTraceMetrics()
- : MachineFunctionPass(ID), TII(0), TRI(0), MRI(0), Loops(0) {
+ : MachineFunctionPass(ID), MF(0), TII(0), TRI(0), MRI(0), Loops(0) {
std::fill(Ensembles, array_endof(Ensembles), (Ensemble*)0);
}
@@ -55,6 +55,7 @@
}
void MachineTraceMetrics::releaseMemory() {
+ MF = 0;
BlockInfo.clear();
for (unsigned i = 0; i != TS_NumStrategies; ++i) {
delete Ensembles[i];
@@ -290,6 +291,8 @@
}
void MachineTraceMetrics::verifyAnalysis() const {
+ if (!MF)
+ return;
#ifndef NDEBUG
assert(BlockInfo.size() == MF->getNumBlockIDs() && "Outdated BlockInfo size");
for (unsigned i = 0; i != TS_NumStrategies; ++i)
More information about the llvm-commits
mailing list