mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-30 16:33:57 +00:00
R600/SI: Don't crash when getting immediate operand size
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230147 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
dc9d5dcdd7
commit
9036390498
@ -254,6 +254,13 @@ public:
|
||||
// instruction opcode.
|
||||
unsigned getOpSize(uint16_t Opcode, unsigned OpNo) const {
|
||||
const MCOperandInfo &OpInfo = get(Opcode).OpInfo[OpNo];
|
||||
|
||||
if (OpInfo.RegClass == -1) {
|
||||
// If this is an immediate operand, this must be a 32-bit literal.
|
||||
assert(OpInfo.OperandType == MCOI::OPERAND_IMMEDIATE);
|
||||
return 4;
|
||||
}
|
||||
|
||||
return RI.getRegClass(OpInfo.RegClass)->getSize();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user