diff options
author | Matt Davis <Matthew.Davis@sony.com> | 2018-11-07 19:20:04 +0000 |
---|---|---|
committer | Matt Davis <Matthew.Davis@sony.com> | 2018-11-07 19:20:04 +0000 |
commit | 23f7106eccb32ee25cc1dbe8a39f17ca543fa3b9 (patch) | |
tree | 2a5e9512974fd0691dc28d9695170efa3ff26cb0 /llvm/tools/llvm-mca/CodeRegion.h | |
parent | 2a6f3f5fa20b231ba75294430af2bd3c9cb5db28 (diff) | |
download | bcm5719-llvm-23f7106eccb32ee25cc1dbe8a39f17ca543fa3b9.tar.gz bcm5719-llvm-23f7106eccb32ee25cc1dbe8a39f17ca543fa3b9.zip |
[llvm-mca] Move the AssembleInput logic into its own class.
Summary:
This patch introduces a CodeRegionGenerator class which is responsible for parsing some type of input and creating a 'CodeRegions' instance for use by llvm-mca. In the future, we will also have a CodeRegionGenerator subclass for converting an input object file into CodeRegions. For now, we only have the subclass for converting input assembly into CodeRegions.
This is mostly a NFC patch, as the logic remains close to the original, but now encapsulated in its own class and moved outside of llvm-mca.cpp.
Reviewers: andreadb, courbet, RKSimon
Reviewed By: andreadb
Subscribers: mgorny, tschuett, gbedwell, llvm-commits
Differential Revision: https://reviews.llvm.org/D54179
llvm-svn: 346344
Diffstat (limited to 'llvm/tools/llvm-mca/CodeRegion.h')
-rw-r--r-- | llvm/tools/llvm-mca/CodeRegion.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/tools/llvm-mca/CodeRegion.h b/llvm/tools/llvm-mca/CodeRegion.h index 6ca2bd15128..867aa18bb4f 100644 --- a/llvm/tools/llvm-mca/CodeRegion.h +++ b/llvm/tools/llvm-mca/CodeRegion.h @@ -106,6 +106,7 @@ public: void beginRegion(llvm::StringRef Description, llvm::SMLoc Loc); void endRegion(llvm::SMLoc Loc); void addInstruction(const llvm::MCInst &Instruction); + llvm::SourceMgr &getSourceMgr() const { return SM; } CodeRegions(llvm::SourceMgr &S) : SM(S) { // Create a default region for the input code sequence. |