summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2016-06-07 19:16:31 -0400
committerTavian Barnes <tavianator@tavianator.com>2016-06-07 19:16:31 -0400
commitcbb7cc9bf6d49ba922010f77c06cbea23f8e39de (patch)
treea450efc6b3aabda1ac3ec1bf93e0c4e6c2c774c7
parent8b55d62f4ec9739884e75feeba785014db71aca5 (diff)
downloadbfs-cbb7cc9bf6d49ba922010f77c06cbea23f8e39de.tar.xz
At -O3, replace command lines with no actions by -false.
-rw-r--r--parse.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/parse.c b/parse.c
index 30ee491..4f86647 100644
--- a/parse.c
+++ b/parse.c
@@ -1616,6 +1616,11 @@ struct cmdline *parse_cmdline(int argc, char *argv[]) {
}
}
+ if (cmdline->optlevel >= 3 && cmdline->expr->pure) {
+ free_expr(cmdline->expr);
+ cmdline->expr = &expr_false;
+ }
+
if (cmdline->nroots == 0) {
if (!cmdline_add_root(cmdline, ".")) {
goto fail;