summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-mca/llvm-mca.cpp
diff options
context:
space:
mode:
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>2018-03-26 14:25:52 +0000
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>2018-03-26 14:25:52 +0000
commit5ffd2c3cfca82ecc7ab00b8e1b034a118ca5a27b (patch)
tree7b051e6b4ae65e930f5e77adbe002fd7272e9f1f /llvm/tools/llvm-mca/llvm-mca.cpp
parent2455fef497a09cf358daf43ea910eb5a23542980 (diff)
downloadbcm5719-llvm-5ffd2c3cfca82ecc7ab00b8e1b034a118ca5a27b.tar.gz
bcm5719-llvm-5ffd2c3cfca82ecc7ab00b8e1b034a118ca5a27b.zip
[llvm-mca] Fix how views are added to the InstructionTables.
This should fix the stack-use-after-scope reported by the asan buildbots after revision 328493. llvm-svn: 328499
Diffstat (limited to 'llvm/tools/llvm-mca/llvm-mca.cpp')
-rw-r--r--llvm/tools/llvm-mca/llvm-mca.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/llvm/tools/llvm-mca/llvm-mca.cpp b/llvm/tools/llvm-mca/llvm-mca.cpp
index cae4c2741b1..49d50476354 100644
--- a/llvm/tools/llvm-mca/llvm-mca.cpp
+++ b/llvm/tools/llvm-mca/llvm-mca.cpp
@@ -273,8 +273,8 @@ int main(int argc, char **argv) {
std::unique_ptr<buffer_ostream> BOS;
- std::unique_ptr<mca::SourceMgr> S =
- llvm::make_unique<mca::SourceMgr>(PrintInstructionTables ? 1 : Iterations);
+ std::unique_ptr<mca::SourceMgr> S = llvm::make_unique<mca::SourceMgr>(
+ PrintInstructionTables ? 1 : Iterations);
MCStreamerWrapper Str(Ctx, S->getSequence());
std::unique_ptr<MCInstrInfo> MCII(TheTarget->createMCInstrInfo());
@@ -343,14 +343,13 @@ int main(int argc, char **argv) {
mca::InstructionTables IT(STI->getSchedModel(), *IB, *S);
if (PrintInstructionInfoView) {
- mca::InstructionInfoView IIV(*STI, *MCII, *S, *IP);
- IT.addEventListener(&IIV);
+ IT.addView(
+ llvm::make_unique<mca::InstructionInfoView>(*STI, *MCII, *S, *IP));
}
- mca::ResourcePressureView RPV(*STI, *IP, *S);
- IT.addEventListener(&RPV);
+ IT.addView(llvm::make_unique<mca::ResourcePressureView>(*STI, *IP, *S));
IT.run();
- RPV.printView(TOF->os());
+ IT.printReport(TOF->os());
TOF->keep();
return 0;
}
OpenPOWER on IntegriCloud