forked from OSchip/llvm-project
Silly assertion. Forgot variable_ops instructions can have arbitrary number of
operands. llvm-svn: 32592
This commit is contained in:
parent
2455e6937b
commit
16057e7454
|
@ -132,8 +132,10 @@ public:
|
||||||
/// it is set. Returns -1 if it is not set.
|
/// it is set. Returns -1 if it is not set.
|
||||||
int getOperandConstraint(unsigned OpNum,
|
int getOperandConstraint(unsigned OpNum,
|
||||||
TOI::OperandConstraint Constraint) const {
|
TOI::OperandConstraint Constraint) const {
|
||||||
assert(OpNum < numOperands && "Invalid operand # of TargetInstrInfo");
|
assert((OpNum < numOperands || (Flags & M_VARIABLE_OPS)) &&
|
||||||
if (OpInfo[OpNum].Constraints & (1 << Constraint)) {
|
"Invalid operand # of TargetInstrInfo");
|
||||||
|
if (OpNum < numOperands &&
|
||||||
|
(OpInfo[OpNum].Constraints & (1 << Constraint))) {
|
||||||
unsigned Pos = 16 + Constraint * 4;
|
unsigned Pos = 16 + Constraint * 4;
|
||||||
return (int)(OpInfo[OpNum].Constraints >> Pos) & 0xf;
|
return (int)(OpInfo[OpNum].Constraints >> Pos) & 0xf;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue