diff --git a/tools/edis/EDDisassembler.cpp b/tools/edis/EDDisassembler.cpp index 072df822bf30..ed7dfb1a4120 100644 --- a/tools/edis/EDDisassembler.cpp +++ b/tools/edis/EDDisassembler.cpp @@ -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); @@ -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; diff --git a/tools/edis/EDInst.cpp b/tools/edis/EDInst.cpp index 1b6a3607ba8e..de40770e9009 100644 --- a/tools/edis/EDInst.cpp +++ b/tools/edis/EDInst.cpp @@ -33,6 +33,7 @@ EDInst::EDInst(llvm::MCInst *inst, BranchTarget(-1), MoveSource(-1), MoveTarget(-1) { + OperandOrder = ThisInstInfo->operandOrders[Disassembler.llvmSyntaxVariant()]; } EDInst::~EDInst() { @@ -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); }