diff options
author | Andrea Di Biagio <Andrea_DiBiagio@sn.scee.net> | 2018-12-17 14:00:37 +0000 |
---|---|---|
committer | Andrea Di Biagio <Andrea_DiBiagio@sn.scee.net> | 2018-12-17 14:00:37 +0000 |
commit | 450606759351dabe1b975e3b48be80db9030c51a (patch) | |
tree | 94af1518f641a1c47df1a850b2521b8bb999c9e9 /llvm/tools/llvm-mca/llvm-mca.cpp | |
parent | 54058b5055c16fb700854223d6453a35c3c59ea8 (diff) | |
download | bcm5719-llvm-450606759351dabe1b975e3b48be80db9030c51a.tar.gz bcm5719-llvm-450606759351dabe1b975e3b48be80db9030c51a.zip |
[MCA] Don't assume that createMCInstrAnalysis() always returns a valid pointer.
Class InstrBuilder wrongly assumed that llvm targets were always able to return
a non-null pointer when createMCInstrAnalysis() was called on them.
This was causing crashes when simulating executions for targets that don't
provide an MCInstrAnalysis object.
This patch fixes the issue by making MCInstrAnalysis optional.
llvm-svn: 349352
Diffstat (limited to 'llvm/tools/llvm-mca/llvm-mca.cpp')
-rw-r--r-- | llvm/tools/llvm-mca/llvm-mca.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/tools/llvm-mca/llvm-mca.cpp b/llvm/tools/llvm-mca/llvm-mca.cpp index 310b0bfad93..d0da3b85c28 100644 --- a/llvm/tools/llvm-mca/llvm-mca.cpp +++ b/llvm/tools/llvm-mca/llvm-mca.cpp @@ -378,7 +378,7 @@ int main(int argc, char **argv) { Width = DispatchWidth; // Create an instruction builder. - mca::InstrBuilder IB(*STI, *MCII, *MRI, *MCIA); + mca::InstrBuilder IB(*STI, *MCII, *MRI, MCIA.get()); // Create a context to control ownership of the pipeline hardware. mca::Context MCA(*MRI, *STI); |