New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PATCH] comment out dead code in Opcode:: #14429
Comments
From @bulk88Created by @bulk88See attached patch. Perl Info
|
From @bulk880001-comment-out-dead-code-in-Opcode.patchFrom ce9d4b3c885049ca5e821e7035830fd2795afd12 Mon Sep 17 00:00:00 2001
From: Daniel Dragan <bulk88@hotmail.com>
Date: Tue, 20 Jan 2015 00:16:57 -0500
Subject: [PATCH] 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.
---
ext/Opcode/Opcode.xs | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/ext/Opcode/Opcode.xs b/ext/Opcode/Opcode.xs
index 3b6d275..c1170e9 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);
--
1.7.9.msysgit.0
|
From @tonycozOn Mon Jan 19 21:38:37 2015, bulk88 wrote:
I considered suggesting adding a mechanism to set this at runtime but no-one has asked for it in the last 17 years, so it probably isn't needed. With your patch it's fairly simple to edit to return to the previous behaviour (and perhaps set opcode_debug in BOOT), so a user can easily enable debugging either at runtime or build-time. I'll apply this in a couple of day unless someone objects. Tony |
The RT System itself - Status changed from 'new' to 'open' |
@tonycoz - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#123632 (status was 'resolved')
Searchable as RT123632$
The text was updated successfully, but these errors were encountered: