We need to pass the TargetMachine object to the InstPrinter if we are printing

the alias of an InstAlias instead of the thing being aliased. Because we need to
know the features that are valid for an InstAlias.

This is part of a work-in-progress.

llvm-svn: 127986
This commit is contained in:
Bill Wendling
2011-03-21 04:13:46 +00:00
parent 701822a48e
commit 00f0cddfd4
18 changed files with 90 additions and 32 deletions

View File

@@ -127,7 +127,8 @@ static bool ByteArrayFromString(ByteArrayTy &ByteArray,
return false;
}
int Disassembler::disassemble(const Target &T, const std::string &Triple,
int Disassembler::disassemble(const Target &T, TargetMachine &TM,
const std::string &Triple,
MemoryBuffer &Buffer,
raw_ostream &Out) {
// Set up disassembler.
@@ -145,7 +146,7 @@ int Disassembler::disassemble(const Target &T, const std::string &Triple,
}
int AsmPrinterVariant = AsmInfo->getAssemblerDialect();
OwningPtr<MCInstPrinter> IP(T.createMCInstPrinter(AsmPrinterVariant,
OwningPtr<MCInstPrinter> IP(T.createMCInstPrinter(TM, AsmPrinterVariant,
*AsmInfo));
if (!IP) {
errs() << "error: no instruction printer for target " << Triple << '\n';