aboutsummaryrefslogtreecommitdiffstats
path: root/scope.c
diff options
context:
space:
mode:
authorChristopher Li <sparse@chrisli.org>2006-11-30 02:16:08 -0800
committerJosh Triplett <josh@freedesktop.org>2006-12-04 18:02:12 -0800
commit9c1b0a2fd4347f90c5813d5ed130fd814857ee3e (patch)
tree95a081212f421d8900f77e7b508c2094eb1ad33a /scope.c
parentfe288c4a04841e9aefedf75ab036265c8950f7d9 (diff)
downloadsparse-9c1b0a2fd4347f90c5813d5ed130fd814857ee3e.tar.gz
delay removing file scope
Sparse only returns the used symbol. By the time it return the symbol, it already destroyed the file scope. This patch preserve the file scope. The caller can examine the unused symbols. e.g. If I want to generate ctags base on sparse, it need those unused symbols. Signed-off-by: Christopher Li <sparse@chrisli.org>
Diffstat (limited to 'scope.c')
-rw-r--r--scope.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/scope.c b/scope.c
index 6b8b705b..3afab836 100644
--- a/scope.c
+++ b/scope.c
@@ -96,6 +96,13 @@ void end_file_scope(void)
end_scope(&file_scope);
}
+void new_file_scope(void)
+{
+ if (file_scope != &builtin_scope)
+ end_file_scope();
+ start_file_scope();
+}
+
void end_symbol_scope(void)
{
end_scope(&block_scope);