[PATCH] D14013: [mips][ias] Range check uimmz operands.
Vasileios Kalintiris via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 26 06:36:13 PDT 2015
vkalintiris accepted this revision.
vkalintiris added a comment.
This revision is now accepted and ready to land.
LGTM. Added two minor nits.
================
Comment at: lib/Target/Mips/AsmParser/MipsAsmParser.cpp:3241-3242
@@ -3230,1 +3240,4 @@
+static SMLoc RefineErrorLoc(SMLoc Loc, OperandVector &Operands,
+ uint64_t &ErrorInfo) {
+ if (ErrorInfo != ~0ULL && ErrorInfo < Operands.size()) {
----------------
Const-ify `Operands` and avoid passing-by-ref of `ErrorInfo`.
================
Comment at: lib/Target/Mips/AsmParser/MipsAsmParser.cpp:3244
@@ +3243,3 @@
+ if (ErrorInfo != ~0ULL && ErrorInfo < Operands.size()) {
+ SMLoc ErrorLoc = ((MipsOperand &)*Operands[ErrorInfo]).getStartLoc();
+ if (ErrorLoc == SMLoc())
----------------
We don't need the cast if we use `->`.
http://reviews.llvm.org/D14013
More information about the llvm-commits
mailing list