[llvm-commits] [llvm] r147046 - in /llvm/trunk/lib/Target: MBlaze/Disassembler/MBlazeDisassembler.h X86/Disassembler/X86Disassembler.cpp X86/Disassembler/X86Disassembler.h
Craig Topper
craig.topper at gmail.com
Wed Dec 21 00:06:52 PST 2011
Author: ctopper
Date: Wed Dec 21 02:06:52 2011
New Revision: 147046
URL: http://llvm.org/viewvc/llvm-project?rev=147046&view=rev
Log:
Remove mode specific disassembler classes and just call X86GenericDisassembler constructor with appropriate argument in the creation functions. This removes a few tables that needed to be anchored.
Modified:
llvm/trunk/lib/Target/MBlaze/Disassembler/MBlazeDisassembler.h
llvm/trunk/lib/Target/X86/Disassembler/X86Disassembler.cpp
llvm/trunk/lib/Target/X86/Disassembler/X86Disassembler.h
Modified: llvm/trunk/lib/Target/MBlaze/Disassembler/MBlazeDisassembler.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MBlaze/Disassembler/MBlazeDisassembler.h?rev=147046&r1=147045&r2=147046&view=diff
==============================================================================
--- llvm/trunk/lib/Target/MBlaze/Disassembler/MBlazeDisassembler.h (original)
+++ llvm/trunk/lib/Target/MBlaze/Disassembler/MBlazeDisassembler.h Wed Dec 21 02:06:52 2011
@@ -17,8 +17,6 @@
#include "llvm/MC/MCDisassembler.h"
-struct InternalInstruction;
-
namespace llvm {
class MCInst;
Modified: llvm/trunk/lib/Target/X86/Disassembler/X86Disassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/Disassembler/X86Disassembler.cpp?rev=147046&r1=147045&r2=147046&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/Disassembler/X86Disassembler.cpp (original)
+++ llvm/trunk/lib/Target/X86/Disassembler/X86Disassembler.cpp Wed Dec 21 02:06:52 2011
@@ -79,12 +79,6 @@
return instInfoX86;
}
-void X86_16Disassembler::anchor() { }
-
-void X86_32Disassembler::anchor() { }
-
-void X86_64Disassembler::anchor() { }
-
/// regionReader - a callback function that wraps the readByte method from
/// MemoryObject.
///
@@ -597,11 +591,11 @@
}
static MCDisassembler *createX86_32Disassembler(const Target &T, const MCSubtargetInfo &STI) {
- return new X86Disassembler::X86_32Disassembler(STI);
+ return new X86Disassembler::X86GenericDisassembler(STI, MODE_32BIT);
}
static MCDisassembler *createX86_64Disassembler(const Target &T, const MCSubtargetInfo &STI) {
- return new X86Disassembler::X86_64Disassembler(STI);
+ return new X86Disassembler::X86GenericDisassembler(STI, MODE_64BIT);
}
extern "C" void LLVMInitializeX86Disassembler() {
Modified: llvm/trunk/lib/Target/X86/Disassembler/X86Disassembler.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/Disassembler/X86Disassembler.h?rev=147046&r1=147045&r2=147046&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/Disassembler/X86Disassembler.h (original)
+++ llvm/trunk/lib/Target/X86/Disassembler/X86Disassembler.h Wed Dec 21 02:06:52 2011
@@ -87,8 +87,6 @@
#include "llvm/MC/MCDisassembler.h"
-struct InternalInstruction;
-
namespace llvm {
class MCInst;
@@ -104,13 +102,14 @@
/// All each platform class should have to do is subclass the constructor, and
/// provide a different disassemblerMode value.
class X86GenericDisassembler : public MCDisassembler {
-protected:
+public:
/// Constructor - Initializes the disassembler.
///
/// @param mode - The X86 architecture mode to decode for.
X86GenericDisassembler(const MCSubtargetInfo &STI, DisassemblerMode mode);
-public:
+private:
~X86GenericDisassembler();
+public:
/// getInstruction - See MCDisassembler.
DecodeStatus getInstruction(MCInst &instr,
@@ -126,35 +125,8 @@
DisassemblerMode fMode;
};
-/// X86_16Disassembler - 16-bit X86 disassembler.
-class X86_16Disassembler : public X86GenericDisassembler {
- virtual void anchor();
-public:
- X86_16Disassembler(const MCSubtargetInfo &STI) :
- X86GenericDisassembler(STI, MODE_16BIT) {
- }
-};
-
-/// X86_32Disassembler - 32-bit X86 disassembler.
-class X86_32Disassembler : public X86GenericDisassembler {
- virtual void anchor();
-public:
- X86_32Disassembler(const MCSubtargetInfo &STI) :
- X86GenericDisassembler(STI, MODE_32BIT) {
- }
-};
-
-/// X86_64Disassembler - 64-bit X86 disassembler.
-class X86_64Disassembler : public X86GenericDisassembler {
- virtual void anchor();
-public:
- X86_64Disassembler(const MCSubtargetInfo &STI) :
- X86GenericDisassembler(STI, MODE_64BIT) {
- }
-};
-
} // namespace X86Disassembler
-
+
} // namespace llvm
-
+
#endif
More information about the llvm-commits
mailing list