edis: Save the TargetMachine in the EDDisassembler object.

llvm-svn: 108663
This commit is contained in:
Daniel Dunbar 2010-07-19 00:33:43 +00:00
parent de7f658346
commit 2747a00d4f
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