Skip to content

Commit 847e7b5

Browse files
committed
New LLVM instruction codes.
1 parent 9e3060d commit 847e7b5

File tree

1 file changed

+23
-4
lines changed
  • sulong/projects/com.oracle.truffle.llvm.parser/src/com/oracle/truffle/llvm/parser/listeners

1 file changed

+23
-4
lines changed

sulong/projects/com.oracle.truffle.llvm.parser/src/com/oracle/truffle/llvm/parser/listeners/Function.java

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2022, Oracle and/or its affiliates.
2+
* Copyright (c) 2016, 2025, Oracle and/or its affiliates.
33
*
44
* All rights reserved.
55
*
@@ -151,6 +151,12 @@ public final class Function implements ParserListener {
151151
private static final int INSTRUCTION_CALLBR = 57;
152152
private static final int INSTRUCTION_FREEZE = 58;
153153
private static final int INSTRUCTION_ATOMICRMW = 59;
154+
private static final int INSTRUCTION_BLOCKADDR_USERS = 60;
155+
private static final int INSTRUCTION_DEBUG_RECORD_VALUE = 61;
156+
private static final int INSTRUCTION_DEBUG_RECORD_DECLARE = 62;
157+
private static final int INSTRUCTION_DEBUG_RECORD_ASSIGN = 63;
158+
private static final int INSTRUCTION_DEBUG_RECORD_VALUE_SIMPLE = 64;
159+
private static final int INSTRUCTION_DEBUG_RECORD_LABEL = 65;
154160

155161
private final FunctionDefinition function;
156162

@@ -227,18 +233,31 @@ public void exit() {
227233
public void record(RecordBuffer buffer) {
228234
int opCode = buffer.getId();
229235

230-
// debug locations can occur after terminating instructions, we process them before we
236+
// debug instructions can occur after terminating instructions, we process them before we
231237
// replace the old block
232238
switch (opCode) {
239+
case INSTRUCTION_DECLAREBLOCKS:
240+
function.allocateBlocks(buffer.readInt());
241+
return;
242+
233243
case INSTRUCTION_DEBUG_LOC:
234244
parseDebugLocation(buffer); // intentional fallthrough
235245

236246
case INSTRUCTION_DEBUG_LOC_AGAIN:
237247
applyDebugLocation();
238248
return;
239249

240-
case INSTRUCTION_DECLAREBLOCKS:
241-
function.allocateBlocks(buffer.readInt());
250+
case INSTRUCTION_BLOCKADDR_USERS:
251+
// only needed by the IRLinker
252+
// since we consume only bitcode after linking, it's safe to ignore
253+
return;
254+
255+
case INSTRUCTION_DEBUG_RECORD_VALUE:
256+
case INSTRUCTION_DEBUG_RECORD_DECLARE:
257+
case INSTRUCTION_DEBUG_RECORD_ASSIGN:
258+
case INSTRUCTION_DEBUG_RECORD_VALUE_SIMPLE:
259+
case INSTRUCTION_DEBUG_RECORD_LABEL:
260+
// TODO parse debug info
242261
return;
243262

244263
default:

0 commit comments

Comments
 (0)