[llvm] r325428 - Fix signed/unsigned comparison warning in AsmGenMatcher generated code. NFCI.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Sat Feb 17 04:29:47 PST 2018
Author: rksimon
Date: Sat Feb 17 04:29:47 2018
New Revision: 325428
URL: http://llvm.org/viewvc/llvm-project?rev=325428&view=rev
Log:
Fix signed/unsigned comparison warning in AsmGenMatcher generated code. NFCI.
Modified:
llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
Modified: llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp?rev=325428&r1=325427&r2=325428&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp Sat Feb 17 04:29:47 2018
@@ -1982,8 +1982,8 @@ static void emitConvertFuncs(CodeGenTarg
<< "&>(*Operands[OpIdx]).addRegOperands(Inst, 1);\n";
CvtOS << " break;\n";
CvtOS << " case CVT_Tied: {\n";
- CvtOS << " assert(OpIdx < (std::end(TiedAsmOperandTable) -\n";
- CvtOS << " std::begin(TiedAsmOperandTable)) &&\n";
+ CvtOS << " assert(OpIdx < (size_t)(std::end(TiedAsmOperandTable) -\n";
+ CvtOS << " std::begin(TiedAsmOperandTable)) &&\n";
CvtOS << " \"Tied operand not found\");\n";
CvtOS << " unsigned TiedResOpnd = TiedAsmOperandTable[OpIdx][0];\n";
CvtOS << " Inst.addOperand(Inst.getOperand(TiedResOpnd));\n";
@@ -2982,8 +2982,8 @@ static void emitAsmTiedOperandConstraint
OS << " switch (*p) {\n";
OS << " case CVT_Tied: {\n";
OS << " unsigned OpIdx = *(p+1);\n";
- OS << " assert(OpIdx < (std::end(TiedAsmOperandTable) -\n";
- OS << " std::begin(TiedAsmOperandTable)) &&\n";
+ OS << " assert(OpIdx < (size_t)(std::end(TiedAsmOperandTable) -\n";
+ OS << " std::begin(TiedAsmOperandTable)) &&\n";
OS << " \"Tied operand not found\");\n";
OS << " unsigned OpndNum1 = TiedAsmOperandTable[OpIdx][1];\n";
OS << " unsigned OpndNum2 = TiedAsmOperandTable[OpIdx][2];\n";
More information about the llvm-commits
mailing list