diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-07-19 00:33:43 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-07-19 00:33:43 +0000 |
commit | 0261243f6e6cbeb12f7d66657964f9b6508c2328 (patch) | |
tree | 5f821e4fbdbf78c6a09bc045da6eeb8c8f50e458 /tools/edis | |
parent | 754b9c9c271a3167720222cf379c12a17951392d (diff) | |
download | external_llvm-0261243f6e6cbeb12f7d66657964f9b6508c2328.zip external_llvm-0261243f6e6cbeb12f7d66657964f9b6508c2328.tar.gz external_llvm-0261243f6e6cbeb12f7d66657964f9b6508c2328.tar.bz2 |
edis: Save the TargetMachine in the EDDisassembler object.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108663 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/edis')
-rw-r--r-- | tools/edis/EDDisassembler.cpp | 9 | ||||
-rw-r--r-- | tools/edis/EDDisassembler.h | 3 |
2 files changed, 7 insertions, 5 deletions
diff --git a/tools/edis/EDDisassembler.cpp b/tools/edis/EDDisassembler.cpp index 5a59e34..83505c3 100644 --- a/tools/edis/EDDisassembler.cpp +++ b/tools/edis/EDDisassembler.cpp @@ -175,11 +175,10 @@ EDDisassembler::EDDisassembler(CPUKey &key) : std::string featureString; - OwningPtr<const TargetMachine> - targetMachine(Tgt->createTargetMachine(tripleString, - featureString)); + TargetMachine.reset(Tgt->createTargetMachine(tripleString, + featureString)); - const TargetRegisterInfo *registerInfo = targetMachine->getRegisterInfo(); + const TargetRegisterInfo *registerInfo = TargetMachine->getRegisterInfo(); if (!registerInfo) return; @@ -209,7 +208,7 @@ EDDisassembler::EDDisassembler(CPUKey &key) : SpecificAsmLexer.reset(Tgt->createAsmLexer(*AsmInfo)); SpecificAsmLexer->InstallLexer(*GenericAsmLexer); - initMaps(*targetMachine->getRegisterInfo()); + initMaps(*TargetMachine->getRegisterInfo()); Valid = true; } diff --git a/tools/edis/EDDisassembler.h b/tools/edis/EDDisassembler.h index 74a260e..913ae84 100644 --- a/tools/edis/EDDisassembler.h +++ b/tools/edis/EDDisassembler.h @@ -47,6 +47,7 @@ class MCStreamer; template <typename T> class SmallVectorImpl; class SourceMgr; class Target; +class TargetMachine; class TargetRegisterInfo; struct EDInstInfo; @@ -127,6 +128,8 @@ struct EDDisassembler { CPUKey Key; /// The LLVM target corresponding to the disassembler const llvm::Target *Tgt; + /// The target machien instance. + llvm::OwningPtr<llvm::TargetMachine> TargetMachine; /// The assembly information for the target architecture llvm::OwningPtr<const llvm::MCAsmInfo> AsmInfo; /// The disassembler for the target architecture |