[llvm] r225954 - Use the operand vector instead so inline assembly can be validated too
David Majnemer
david.majnemer at gmail.com
Tue Jan 13 22:14:36 PST 2015
Author: majnemer
Date: Wed Jan 14 00:14:36 2015
New Revision: 225954
URL: http://llvm.org/viewvc/llvm-project?rev=225954&view=rev
Log:
Use the operand vector instead so inline assembly can be validated too
The buildbots got upset after r225941, this should hopefully fix things.
Modified:
llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
Modified: llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp?rev=225954&r1=225953&r2=225954&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp Wed Jan 14 00:14:36 2015
@@ -2277,11 +2277,11 @@ bool X86AsmParser::validateInstruction(M
switch (Inst.getOpcode()) {
default: return true;
case X86::INT:
- if (Inst.getNumOperands() == 0)
- return true;
- assert(Inst.getOperand(0).isImm() && "expected immediate");
- if (Inst.getOperand(0).getImm() > 255) {
- Error(Ops[1]->getStartLoc(), "interrupt vector must be in range [0-255]");
+ X86Operand &Op = static_cast<X86Operand &>(*Ops[1]);
+ assert(Op.isImm() && "expected immediate");
+ int64_t Res;
+ if (!Op.getImm()->EvaluateAsAbsolute(Res) || Res > 255) {
+ Error(Op.getStartLoc(), "interrupt vector must be in range [0-255]");
return false;
}
return true;
More information about the llvm-commits
mailing list