aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@home.transmeta.com>2003-04-02 10:24:35 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:00:03 -0700
commitb1f9e93e9137ab7a8462b9d89ac160e3aae4e81f (patch)
tree47911fabe194e0c5811e14efad774603ceb04cb8 /scope.h
parentAdd some limited attribute parsing. "packed", "aligned" and "type". (diff)
downloadsparse-b1f9e93e9137ab7a8462b9d89ac160e3aae4e81f.tar.gz
sparse-b1f9e93e9137ab7a8462b9d89ac160e3aae4e81f.tar.bz2
sparse-b1f9e93e9137ab7a8462b9d89ac160e3aae4e81f.zip
Expose scoping to symbol binders - we'll need this to check
whether it is a re-definition (ie new declaration in the same scope).
Diffstat (limited to 'scope.h')
-rw-r--r--scope.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/scope.h b/scope.h
index d295d19..f1e5cef 100644
--- a/scope.h
+++ b/scope.h
@@ -12,12 +12,22 @@ struct scope {
struct scope *next;
};
+static inline int toplevel(struct scope *scope)
+{
+ return scope->next == scope;
+}
+
+extern struct scope
+ *block_scope,
+ *function_scope,
+ *file_scope;
+
extern void start_symbol_scope(void);
extern void end_symbol_scope(void);
extern void start_function_scope(void);
extern void end_function_scope(void);
-extern void bind_scope(struct symbol *);
+extern void bind_scope(struct symbol *, struct scope *);
#endif