1
0
mirror of https://github.com/RPCS3/llvm.git synced 2024-12-30 16:34:03 +00:00

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
This commit is contained in:
Daniel Dunbar 2010-07-19 00:33:43 +00:00
parent 754b9c9c27
commit 0261243f6e
2 changed files with 7 additions and 5 deletions

View File

@ -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;
}

View File

@ -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