aboutsummaryrefslogtreecommitdiffstats
path: root/allocate.h
diff options
context:
space:
mode:
authorJosh Triplett <josht@us.ibm.com>2006-08-30 10:14:53 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-08-30 16:07:55 -0700
commit37475a6c1c3e66219e68d912d5eb833f4098fd72 (patch)
treed4b87d24a087663e44c900929f3f7cd5b8cc9914 /allocate.h
parentc974e38bfdf1484f39b473577f1dd047706384e4 (diff)
downloadsparse-37475a6c1c3e66219e68d912d5eb833f4098fd72.tar.gz
sparse-37475a6c1c3e66219e68d912d5eb833f4098fd72.tar.xz
sparse-37475a6c1c3e66219e68d912d5eb833f4098fd72.zip
[PATCH] Parse and track multiple contexts by expression
sparse currently only tracks one global context for __context__ and __attribute__((context)). This adds support for parsing an additional argument to each of these which gives a context expression. For __attribute__((context)), store each context attribute as a separate context structure containing the expression, the entry context, and the exit context, and keep a list of these structures in the ctype. For __context__, store the context expression in the context instruction. Modify the various frontends to adapt to this change, without changing functionality. This change should not affect parsing of programs which worked with previous versions of sparse, unless those programs use comma expressions as arguments to __context__ or __attribute__((context)), which seems highly dubious and unlikely. sparse with -Wcontext generates identical output with or without this change on Linux 2.6.18-rc4. Signed-off-by: Josh Triplett <josh@freedesktop.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'allocate.h')
-rw-r--r--allocate.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/allocate.h b/allocate.h
index ab6bd0a..33703fe 100644
--- a/allocate.h
+++ b/allocate.h
@@ -61,6 +61,7 @@ extern void show_allocations(struct allocator_struct *);
DECLARE_ALLOCATOR(ident);
DECLARE_ALLOCATOR(token);
+DECLARE_ALLOCATOR(context);
DECLARE_ALLOCATOR(symbol);
DECLARE_ALLOCATOR(expression);
DECLARE_ALLOCATOR(statement);