[llvm-exegesis] Fix wrong index type.
authorGuillaume Chatelet <gchatelet@google.com>
Tue, 9 Oct 2018 10:06:19 +0000 (10:06 +0000)
committerGuillaume Chatelet <gchatelet@google.com>
Tue, 9 Oct 2018 10:06:19 +0000 (10:06 +0000)
llvm-svn: 344032

llvm/tools/llvm-exegesis/lib/MCInstrDescView.cpp
llvm/tools/llvm-exegesis/lib/MCInstrDescView.h

index 2661e42..3f3b4f4 100644 (file)
 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];
index 967d964..898e515 100644 (file)
@@ -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