[llvm-exegesis] Factor out DisassemblerHelper from the Analysis class
authorPavel Kosov <kpdev42@gmail.com>
Tue, 4 Apr 2023 06:17:50 +0000 (09:17 +0300)
committerPavel Kosov <kpdev42@gmail.com>
Tue, 4 Apr 2023 06:17:50 +0000 (09:17 +0300)
commit39fc67b8af707f6bdcbcfbec1e17f14ffbaeecb8
treedb6cff084c67a2aca10014a0b2f4e55ee15befdb
parent1f60c8d025d55f6156c93a63aa3b01f27aabee39
[llvm-exegesis] Factor out DisassemblerHelper from the Analysis class

As part of preparing the reports, the Analysis class needs to print
machine instructions in a disassembled form. For this purpose, the class
has four fields (namely Context_, AsmInfo_, InstPrinter_ and Disasm_).
All the constructor of the Analysis class does is conditionally
initializing these four fields.

This commit factors out the logic for decoding machine code and printing
it in an assembler form into a separate DisassemblerHelper class.

~~

Huawei RRI, OS Lab

Reviewed By: courbet

Differential Revision: https://reviews.llvm.org/D147156
llvm/tools/llvm-exegesis/lib/Analysis.cpp
llvm/tools/llvm-exegesis/lib/Analysis.h
llvm/tools/llvm-exegesis/lib/CMakeLists.txt
llvm/tools/llvm-exegesis/lib/DisassemblerHelper.cpp [new file with mode: 0644]
llvm/tools/llvm-exegesis/lib/DisassemblerHelper.h [new file with mode: 0644]