diff options
author | Lang Hames <lhames@gmail.com> | 2014-04-15 04:40:56 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2014-04-15 04:40:56 +0000 |
commit | a1bc0f56623b4ca1851d27c9f64cccdfdc055c06 (patch) | |
tree | dd9fe4641d2c5e95538962439dc0030c923df47a /llvm/lib/Target/Sparc/Disassembler/SparcDisassembler.cpp | |
parent | 33ec29ace9e2437fa818fba61d3ed8c558bba6ce (diff) | |
download | bcm5719-llvm-a1bc0f56623b4ca1851d27c9f64cccdfdc055c06.tar.gz bcm5719-llvm-a1bc0f56623b4ca1851d27c9f64cccdfdc055c06.zip |
[MC] Require an MCContext when constructing an MCDisassembler.
This patch re-introduces the MCContext member that was removed from
MCDisassembler in r206063, and requires that an MCContext be passed in at
MCDisassembler construction time. (Previously the MCContext member had been
initialized in an ad-hoc fashion after construction). The MCCContext member
can be used by MCDisassembler sub-classes to construct constant or
target-specific MCExprs.
This patch updates disassemblers for in-tree targets, and provides the
MCRegisterInfo instance that some disassemblers were using through the
MCContext (previously those backends were constructing their own
MCRegisterInfo instances).
llvm-svn: 206241
Diffstat (limited to 'llvm/lib/Target/Sparc/Disassembler/SparcDisassembler.cpp')
-rw-r--r-- | llvm/lib/Target/Sparc/Disassembler/SparcDisassembler.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/llvm/lib/Target/Sparc/Disassembler/SparcDisassembler.cpp b/llvm/lib/Target/Sparc/Disassembler/SparcDisassembler.cpp index 5cd99d6bfe0..6cd1b30491c 100644 --- a/llvm/lib/Target/Sparc/Disassembler/SparcDisassembler.cpp +++ b/llvm/lib/Target/Sparc/Disassembler/SparcDisassembler.cpp @@ -32,13 +32,11 @@ class SparcDisassembler : public MCDisassembler { public: /// Constructor - Initializes the disassembler. /// - SparcDisassembler(const MCSubtargetInfo &STI, const MCRegisterInfo *Info) : - MCDisassembler(STI), RegInfo(Info) + SparcDisassembler(const MCSubtargetInfo &STI, MCContext &Ctx) : + MCDisassembler(STI, Ctx) {} virtual ~SparcDisassembler() {} - const MCRegisterInfo *getRegInfo() const { return RegInfo.get(); } - /// getInstruction - See MCDisassembler. virtual DecodeStatus getInstruction(MCInst &instr, uint64_t &size, @@ -46,8 +44,6 @@ public: uint64_t address, raw_ostream &vStream, raw_ostream &cStream) const; -private: - OwningPtr<const MCRegisterInfo> RegInfo; }; } @@ -58,8 +54,9 @@ namespace llvm { static MCDisassembler *createSparcDisassembler( const Target &T, - const MCSubtargetInfo &STI) { - return new SparcDisassembler(STI, T.createMCRegInfo("")); + const MCSubtargetInfo &STI, + MCContext &Ctx) { + return new SparcDisassembler(STI, Ctx); } |