Skip to content

Commit 6a80728

Browse files
authored
[clang][bytecode][NFC] Limit pointer and array ops to integer indices (#168022)
AluOpcode includes fixed point as well, which isn't possible here.
1 parent 851f8f7 commit 6a80728

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

clang/lib/AST/ByteCode/Opcodes.td

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,14 @@ def NarrowPtr : Opcode;
361361
// [Pointer] -> [Pointer]
362362
def ExpandPtr : Opcode;
363363
// [Pointer, Offset] -> [Pointer]
364-
def ArrayElemPtr : AluOpcode;
365-
def ArrayElemPtrPop : AluOpcode;
364+
def ArrayElemPtr : Opcode {
365+
let Types = [IntegralTypeClass];
366+
let HasGroup = 1;
367+
}
368+
def ArrayElemPtrPop : Opcode {
369+
let Types = [IntegralTypeClass];
370+
let HasGroup = 1;
371+
}
366372

367373
def ArrayElemPop : Opcode {
368374
let Args = [ArgUint32];
@@ -536,9 +542,15 @@ def InitElemPop : Opcode {
536542
//===----------------------------------------------------------------------===//
537543

538544
// [Pointer, Integral] -> [Pointer]
539-
def AddOffset : AluOpcode;
545+
def AddOffset : Opcode {
546+
let Types = [IntegralTypeClass];
547+
let HasGroup = 1;
548+
}
540549
// [Pointer, Integral] -> [Pointer]
541-
def SubOffset : AluOpcode;
550+
def SubOffset : Opcode {
551+
let Types = [IntegralTypeClass];
552+
let HasGroup = 1;
553+
}
542554

543555
// [Pointer, Pointer] -> [Integral]
544556
def SubPtr : Opcode {

0 commit comments

Comments
 (0)