diff options
author | Evan Cheng <evan.cheng@apple.com> | 2011-07-20 19:50:42 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2011-07-20 19:50:42 +0000 |
commit | bbf3b0de8bedf01b0c5f162b25e9ee4ad0416df3 (patch) | |
tree | 1fde8debdd48103cfb187c74ff5a115f94a8c8d8 /llvm/lib/MC/MCDisassembler/Disassembler.cpp | |
parent | 81383c20e4c6aa506842397c53112eee7ed8efb0 (diff) | |
download | bcm5719-llvm-bbf3b0de8bedf01b0c5f162b25e9ee4ad0416df3.tar.gz bcm5719-llvm-bbf3b0de8bedf01b0c5f162b25e9ee4ad0416df3.zip |
Goodbye TargetAsmInfo. This eliminate last bit of CodeGen and Target in llvm-mc.
There is still a bit more refactoring left to do in Targets. But we are now very
close to fixing all the layering issues in MC.
llvm-svn: 135611
Diffstat (limited to 'llvm/lib/MC/MCDisassembler/Disassembler.cpp')
-rw-r--r-- | llvm/lib/MC/MCDisassembler/Disassembler.cpp | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/llvm/lib/MC/MCDisassembler/Disassembler.cpp b/llvm/lib/MC/MCDisassembler/Disassembler.cpp index a2aaced09bb..4c92c57a257 100644 --- a/llvm/lib/MC/MCDisassembler/Disassembler.cpp +++ b/llvm/lib/MC/MCDisassembler/Disassembler.cpp @@ -17,8 +17,6 @@ #include "llvm/MC/MCInstPrinter.h" #include "llvm/MC/MCRegisterInfo.h" #include "llvm/Target/TargetRegistry.h" -#include "llvm/Target/TargetAsmInfo.h" // FIXME. -#include "llvm/Target/TargetMachine.h" // FIXME. #include "llvm/Target/TargetSelect.h" #include "llvm/Support/MemoryObject.h" @@ -39,8 +37,6 @@ LLVMDisasmContextRef LLVMCreateDisasm(const char *TripleName, void *DisInfo, LLVMSymbolLookupCallback SymbolLookUp) { // Initialize targets and assembly printers/parsers. llvm::InitializeAllTargetInfos(); - // FIXME: We shouldn't need to initialize the Target(Machine)s. - llvm::InitializeAllTargets(); llvm::InitializeAllMCAsmInfos(); llvm::InitializeAllMCCodeGenInfos(); llvm::InitializeAllMCRegisterInfos(); @@ -64,19 +60,8 @@ LLVMDisasmContextRef LLVMCreateDisasm(const char *TripleName, void *DisInfo, std::string FeaturesStr; std::string CPU; - // FIXME: We shouldn't need to do this (and link in codegen). - // When we split this out, we should do it in a way that makes - // it straightforward to switch subtargets on the fly. - TargetMachine *TM = TheTarget->createTargetMachine(TripleName, CPU, - FeaturesStr); - assert(TM && "Unable to create target machine!"); - - // Get the target assembler info needed to setup the context. - const TargetAsmInfo *tai = new TargetAsmInfo(*TM); - assert(tai && "Unable to create target assembler!"); - // Set up the MCContext for creating symbols and MCExpr's. - MCContext *Ctx = new MCContext(*MAI, *MRI, 0, tai); + MCContext *Ctx = new MCContext(*MAI, *MRI, 0); assert(Ctx && "Unable to create MCContext!"); // Set up disassembler. @@ -92,7 +77,7 @@ LLVMDisasmContextRef LLVMCreateDisasm(const char *TripleName, void *DisInfo, LLVMDisasmContext *DC = new LLVMDisasmContext(TripleName, DisInfo, TagType, GetOpInfo, SymbolLookUp, - TheTarget, MAI, MRI, TM, tai, + TheTarget, MAI, MRI, Ctx, DisAsm, IP); assert(DC && "Allocation failure!"); return DC; |