aboutsummaryrefslogtreecommitdiffstats
path: root/compile.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-26 08:38:20 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-26 08:38:20 +0000
commit2a53f256da412858f27c37f3d5e62f70962c5bd2 (patch)
treee18df28b4e9bf5890513fff81d7e1ded719bceeb /compile.c
parent345c6932969d2a751d4a9fefb87ba1b3243b0839 (diff)
downloadruby-2a53f256da412858f27c37f3d5e62f70962c5bd2.tar.gz
compile.c: true conditions
* compile.c (compile_branch_condition): add more always-true conditions to optimize away unreachable branch. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/compile.c b/compile.c
index 7e3fe14d3f..90c021a501 100644
--- a/compile.c
+++ b/compile.c
@@ -2784,6 +2784,18 @@ compile_branch_condition(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * cond,
case NODE_LIT: /* NODE_LIT is always not true */
case NODE_TRUE:
case NODE_STR:
+ case NODE_DSTR:
+ case NODE_XSTR:
+ case NODE_DXSTR:
+ case NODE_DREGX:
+ case NODE_DREGX_ONCE:
+ case NODE_DSYM:
+ case NODE_ARRAY:
+ case NODE_ZARRAY:
+ case NODE_HASH:
+ case NODE_LAMBDA:
+ case NODE_DEFN:
+ case NODE_DEFS:
/* printf("useless condition eliminate (%s)\n", ruby_node_name(nd_type(cond))); */
ADD_INSNL(ret, nd_line(cond), jump, then_label);
break;