diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2019-02-10 15:26:03 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2019-02-10 15:26:03 +0200 |
commit | b85e6151264722dcaf7dcd1ec2a75bcee295512c (patch) | |
tree | f30c25a60b37097cff69cee25f0deb54d7954145 /src | |
parent | b4038ea16c1709367f5c84939919785686481b55 (diff) | |
download | cflow-b85e6151264722dcaf7dcd1ec2a75bcee295512c.tar.gz cflow-b85e6151264722dcaf7dcd1ec2a75bcee295512c.tar.bz2 |
Finish implementation of --all
* doc/cflow.1: Document the --all --all behavior
* doc/cflow.texi: Likewise.
* src/main.c: Increment all_functions for each -A option.
* src/output.c (tree_output): If one --all option is used, output graphs
for all top-level functions (i.e. functions, not reachable from other ones).
If used twice, output graphs for all global function.
* tests/all.at: New test.
* tests/Makefile.am: Add new test.
* tests/testsuite.at: Likewise.
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 2 | ||||
-rw-r--r-- | src/output.c | 4 |
2 files changed, 3 insertions, 3 deletions
@@ -518,7 +518,7 @@ parse_opt (int key, char *arg, struct argp_state *state) | |||
518 | 518 | ||
519 | switch (key) { | 519 | switch (key) { |
520 | case 'A': | 520 | case 'A': |
521 | all_functions = 1; | 521 | all_functions++; |
522 | break; | 522 | break; |
523 | case 'a': | 523 | case 'a': |
524 | strict_ansi = 1; | 524 | strict_ansi = 1; |
diff --git a/src/output.c b/src/output.c index bf5af1f..625d29e 100644 --- a/src/output.c +++ b/src/output.c | |||
@@ -395,7 +395,7 @@ tree_output() | |||
395 | if ((main_sym = start_name ? lookup(start_name) : NULL) != NULL) { | 395 | if ((main_sym = start_name ? lookup(start_name) : NULL) != NULL) { |
396 | direct_tree(0, 0, main_sym); | 396 | direct_tree(0, 0, main_sym); |
397 | separator(); | 397 | separator(); |
398 | } else { | 398 | } else if (!all_functions) { |
399 | all_functions = 1; | 399 | all_functions = 1; |
400 | } | 400 | } |
401 | 401 | ||
@@ -403,7 +403,7 @@ tree_output() | |||
403 | for (i = 0; i < num; i++) { | 403 | for (i = 0; i < num; i++) { |
404 | if (main_sym != symbols[i] | 404 | if (main_sym != symbols[i] |
405 | && symbols[i]->source | 405 | && symbols[i]->source |
406 | && symbols[i]->caller == NULL) { | 406 | && (all_functions > 1 || symbols[i]->caller == NULL)) { |
407 | direct_tree(0, 0, symbols[i]); | 407 | direct_tree(0, 0, symbols[i]); |
408 | separator(); | 408 | separator(); |
409 | } | 409 | } |