summaryrefslogtreecommitdiff
path: root/ext/Opcode
diff options
context:
space:
mode:
authorDaniel Dragan <bulk88@hotmail.com>2015-01-20 00:16:57 -0500
committerTony Cook <tony@develop-help.com>2015-01-29 10:21:28 +1100
commitc5abc2c9ea98df41b36f74e551876c226f9f4b4d (patch)
treeff531bd6844b121a4903277c86a40c13b63d44fa /ext/Opcode
parent2a403855670ae8592c5a3ca4396e6e909a4fc593 (diff)
downloadperl-c5abc2c9ea98df41b36f74e551876c226f9f4b4d.tar.gz
comment out dead code in Opcode::
opcode_debug has never had an API to turn it on/set it to non-0 since Opcode::'s initial commit 6badd1a5d1 in 5.003001. Making opcode_debug a constant allows the CC to constant fold away the code, the warn string literals, and makes the my_cxt_t struct slightly smaller. Dont remove the code entirely since someone might find it useful one day.
Diffstat (limited to 'ext/Opcode')
-rw-r--r--ext/Opcode/Opcode.xs11
1 files changed, 9 insertions, 2 deletions
diff --git a/ext/Opcode/Opcode.xs b/ext/Opcode/Opcode.xs
index 3b6d27525f..c1170e98aa 100644
--- a/ext/Opcode/Opcode.xs
+++ b/ext/Opcode/Opcode.xs
@@ -13,7 +13,9 @@ typedef struct {
HV * x_op_named_bits; /* cache shared for whole process */
SV * x_opset_all; /* mask with all bits set */
IV x_opset_len; /* length of opmasks in bytes */
- int x_opcode_debug;
+#if 0
+ int x_opcode_debug; /* unused warn() emitting debugging code */
+#endif
} my_cxt_t;
START_MY_CXT
@@ -21,7 +23,12 @@ START_MY_CXT
#define op_named_bits (MY_CXT.x_op_named_bits)
#define opset_all (MY_CXT.x_opset_all)
#define opset_len (MY_CXT.x_opset_len)
-#define opcode_debug (MY_CXT.x_opcode_debug)
+#if 0
+# define opcode_debug (MY_CXT.x_opcode_debug)
+#else
+ /* no API to turn this on at runtime, so constant fold the code away */
+# define opcode_debug 0
+#endif
static SV *new_opset (pTHX_ SV *old_opset);
static int verify_opset (pTHX_ SV *opset, int fatal);