Skip to content

Commit

Permalink
Bugfixes for edis. Code to initialize instruction
Browse files Browse the repository at this point in the history
state was being executed too lazily, and the LLVM
assembly syntax for the disassembler was not being
written into the proper disassembler state variable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100830 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
scallanan committed Apr 9, 2010
1 parent e60bb15 commit 4285b29
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions tools/edis/EDDisassembler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,9 @@ EDDisassembler::EDDisassembler(CPUKey &key) :

const char *triple = infoMap->String;

int syntaxVariant = getLLVMSyntaxVariant(key.Arch, key.Syntax);
LLVMSyntaxVariant = getLLVMSyntaxVariant(key.Arch, key.Syntax);

if (syntaxVariant < 0)
if (LLVMSyntaxVariant < 0)
return;

std::string tripleString(triple);
Expand Down Expand Up @@ -210,7 +210,7 @@ EDDisassembler::EDDisassembler(CPUKey &key) :

InstString.reset(new std::string);
InstStream.reset(new raw_string_ostream(*InstString));
InstPrinter.reset(Tgt->createMCInstPrinter(syntaxVariant, *AsmInfo));
InstPrinter.reset(Tgt->createMCInstPrinter(LLVMSyntaxVariant, *AsmInfo));

if (!InstPrinter)
return;
Expand Down
3 changes: 1 addition & 2 deletions tools/edis/EDInst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ EDInst::EDInst(llvm::MCInst *inst,
BranchTarget(-1),
MoveSource(-1),
MoveTarget(-1) {
OperandOrder = ThisInstInfo->operandOrders[Disassembler.llvmSyntaxVariant()];
}

EDInst::~EDInst() {
Expand Down Expand Up @@ -60,8 +61,6 @@ int EDInst::stringify() {

if (Disassembler.printInst(String, *Inst))
return StringifyResult.setResult(-1);

OperandOrder = ThisInstInfo->operandOrders[Disassembler.llvmSyntaxVariant()];

return StringifyResult.setResult(0);
}
Expand Down

0 comments on commit 4285b29

Please sign in to comment.