added a bunch of gcc builtins
[smatch.git] / scope.h
blobf120821d5d1d34886bd0aca0129f15c50bab04dc
1 #ifndef SCOPE_H
2 #define SCOPE_H
3 /*
4 * Symbol scoping is pretty simple.
6 * Copyright (C) 2003 Transmeta Corp.
7 * 2003 Linus Torvalds
9 * Licensed under the Open Software License version 1.1
12 struct scope {
13 struct token *token; /* Scope start information */
14 struct symbol_list *symbols; /* List of symbols in this scope */
15 struct scope *next;
18 extern struct scope
19 *block_scope,
20 *function_scope,
21 *file_scope,
22 *global_scope;
24 static inline int toplevel(struct scope *scope)
26 return scope == file_scope || scope == global_scope;
29 extern void start_file_scope(void);
30 extern void end_file_scope(void);
32 extern void start_symbol_scope(void);
33 extern void end_symbol_scope(void);
35 extern void start_function_scope(void);
36 extern void end_function_scope(void);
38 extern void bind_scope(struct symbol *, struct scope *);
40 #endif