File 8791-Generate-macros-for-BEAM-opcodes-and-arities-in-beam.patch of Package erlang
From fefec233daeca51da5d74a0d6fe3dcbf6c831662 Mon Sep 17 00:00:00 2001
From: Richard Carlsson <carlsson.richard@gmail.com>
Date: Mon, 15 Dec 2025 22:06:56 +0100
Subject: [PATCH] Generate macros for BEAM opcodes and arities in
beam_opcodes.hrl
---
erts/emulator/utils/beam_makeops | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/erts/emulator/utils/beam_makeops b/erts/emulator/utils/beam_makeops
index a1c45a8878..5ed07d8657 100755
--- a/erts/emulator/utils/beam_makeops
+++ b/erts/emulator/utils/beam_makeops
@@ -1255,7 +1255,11 @@ sub compiler_output {
print "-define(tag_$tag_type[$i], $i).\n";
}
print "\n";
-
+ for ($i = 0; $i < @gen_opname; $i++) {
+ next unless defined $gen_opname[$i];
+ print "-define(BEAMop_$gen_opname[$i], $i).\n";
+ print "-define(BEAMop_ARGS_$gen_opname[$i], $gen_arity[$i]).\n";
+ }
}
#
--
2.51.0