From fe5b0b488e874f95b23cc435babfc3be87db34f4 Mon Sep 17 00:00:00 2001 From: Guillaume Chatelet Date: Tue, 9 Oct 2018 10:06:19 +0000 Subject: [PATCH] [llvm-exegesis] Fix wrong index type. llvm-svn: 344032 --- llvm/tools/llvm-exegesis/lib/MCInstrDescView.cpp | 3 ++- llvm/tools/llvm-exegesis/lib/MCInstrDescView.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/llvm/tools/llvm-exegesis/lib/MCInstrDescView.cpp b/llvm/tools/llvm-exegesis/lib/MCInstrDescView.cpp index 2661e42..3f3b4f4 100644 --- a/llvm/tools/llvm-exegesis/lib/MCInstrDescView.cpp +++ b/llvm/tools/llvm-exegesis/lib/MCInstrDescView.cpp @@ -18,9 +18,10 @@ namespace exegesis { unsigned Variable::getIndex() const { - assert(Index >= 0); + assert(Index >= 0 && "Index must be set"); return Index; } + unsigned Variable::getPrimaryOperandIndex() const { assert(!TiedOperands.empty()); return TiedOperands[0]; diff --git a/llvm/tools/llvm-exegesis/lib/MCInstrDescView.h b/llvm/tools/llvm-exegesis/lib/MCInstrDescView.h index 967d964..898e515 100644 --- a/llvm/tools/llvm-exegesis/lib/MCInstrDescView.h +++ b/llvm/tools/llvm-exegesis/lib/MCInstrDescView.h @@ -47,7 +47,7 @@ struct Variable { llvm::MCOperand AssignedValue; // The index of this Variable in Instruction.Variables and its associated // Value in InstructionBuilder.VariableValues. - unsigned Index = -1; + int Index = -1; }; // MCOperandInfo can only represents Explicit operands. This object gives a -- 2.7.4