[llvm-mca] [llvm-mca] Improved error handling and error reporting from class InstrBui...
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Wed, 24 Oct 2018 10:56:47 +0000 (10:56 +0000)
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Wed, 24 Oct 2018 10:56:47 +0000 (10:56 +0000)
commit083addf75192ff07eccd002eceeeacd085054217
tree724d9216029784e31e31e21542d39ee6d7b99de5
parent5a74a9cf5f9eb012d97075e3d85f7a8698a97a3e
[llvm-mca] [llvm-mca] Improved error handling and error reporting from class InstrBuilder.

A new class named InstructionError has been added to Support.h in order to
improve the error reporting from class InstrBuilder.
The llvm-mca driver is responsible for handling InstructionError objects, and
printing them out to stderr.

The goal of this patch is to remove all the remaining error handling logic from
the library code.
In particular, this allows us to:
 - Simplify the logic in InstrBuilder by removing a needless dependency from
MCInstrPrinter.
 - Centralize all the error halding logic in a new function named 'runPipeline'
(see llvm-mca.cpp).

This is also a first step towards generalizing class InstrBuilder, so that in
future, we will be able to reuse its logic to also "lower" MachineInstr to
mca::Instruction objects.

Differential Revision: https://reviews.llvm.org/D53585

llvm-svn: 345129
llvm/test/tools/llvm-mca/ARM/unsupported-write-variant.s [new file with mode: 0644]
llvm/tools/llvm-mca/include/InstrBuilder.h
llvm/tools/llvm-mca/include/Support.h
llvm/tools/llvm-mca/lib/InstrBuilder.cpp
llvm/tools/llvm-mca/llvm-mca.cpp