summaryrefslogtreecommitdiff
path: root/include/llvm/MC/MCDisassembler.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/MC/MCDisassembler.h')
-rw-r--r--include/llvm/MC/MCDisassembler.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/llvm/MC/MCDisassembler.h b/include/llvm/MC/MCDisassembler.h
index 7c5d160caf..169304ebd6 100644
--- a/include/llvm/MC/MCDisassembler.h
+++ b/include/llvm/MC/MCDisassembler.h
@@ -56,8 +56,8 @@ public:
};
/// Constructor - Performs initial setup for the disassembler.
- MCDisassembler(const MCSubtargetInfo &STI)
- : STI(STI), Symbolizer(), CommentStream(nullptr) {}
+ MCDisassembler(const MCSubtargetInfo &STI, MCContext &Ctx)
+ : Ctx(Ctx), STI(STI), Symbolizer(), CommentStream(nullptr) {}
virtual ~MCDisassembler();
@@ -83,6 +83,8 @@ public:
uint64_t address,
raw_ostream &vStream,
raw_ostream &cStream) const = 0;
+private:
+ MCContext &Ctx;
protected:
// Subtarget information, for instruction decoding predicates if required.
@@ -102,6 +104,8 @@ public:
/// This takes ownership of \p Symzer, and deletes the previously set one.
void setSymbolizer(std::unique_ptr<MCSymbolizer> Symzer);
+ MCContext& getContext() const { return Ctx; }
+
const MCSubtargetInfo& getSubtargetInfo() const { return STI; }
// Marked mutable because we cache it inside the disassembler, rather than