summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org>2019-02-08 13:40:17 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2019-02-08 13:40:17 (GMT)
commit3fea1f0f49fef3fb860597fe3e6297053a3ad6a1 (patch) (side-by-side diff)
tree893d41e20c8b55597ab823d1b8dd8be097a40fd0
parent413a7852958d2c7549616016d3a3cd6de48ff048 (diff)
downloadcflow-3fea1f0f49fef3fb860597fe3e6297053a3ad6a1.tar.gz
cflow-3fea1f0f49fef3fb860597fe3e6297053a3ad6a1.tar.bz2
Include in output functions that don't call other functions
* src/output.c (tree_output): When outputting all graphs, skip only functions that have no source file information. * src/parser.c (declare): Don't install symbols with empty declarations.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--src/output.c8
-rw-r--r--src/parser.c9
2 files changed, 12 insertions, 5 deletions
diff --git a/src/output.c b/src/output.c
index 7eaf7ac..41634a4 100644
--- a/src/output.c
+++ b/src/output.c
@@ -401,10 +401,10 @@ tree_output()
if (all_functions) {
for (i = 0; i < num; i++) {
- if (symbols[i]->callee == NULL)
- continue;
- direct_tree(0, 0, symbols[i]);
- separator();
+ if (symbols[i]->source) {
+ direct_tree(0, 0, symbols[i]);
+ separator();
+ }
}
}
}
diff --git a/src/parser.c b/src/parser.c
index e2c5f62..2b173c2 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -406,6 +406,12 @@ undo_save_stack()
save_end = -1;
}
+int
+save_stack_is_empty()
+{
+ return save_end <= 0;
+}
+
char *
finish_save_stack(char *name)
{
@@ -1146,7 +1152,8 @@ declare(Ident *ident, int maybe_knr)
&& (!maybe_knr || get_knr_args(ident) == 0)
&& !(tok.type == LBRACE || tok.type == LBRACE0 || tok.type == TYPE
|| tok.type == PARM_WRAPPER))
- || (ident->parmcnt < 0 && ident->storage == ExplicitExternStorage)) {
+ || (ident->parmcnt < 0 && ident->storage == ExplicitExternStorage)
+ || save_stack_is_empty()) {
undo_save_stack();
/* add_external()?? */
return;

Return to:

Send suggestions and report system problems to the System administrator.