aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/scope.h
AgeCommit message (Collapse)AuthorFilesLines
2020-05-21scope: add is_in_scope()Luc Van Oostenryck1-0/+2
Add an helper to check if a scope is included into another one. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2020-05-21scope: let labels have their own scopeLuc Van Oostenryck1-0/+4
It's invalid to jump inside a statement expression. So, concerning labels & gotos, a statement expression is like a kind of scope. So, in preparation for the detection of such jumps, create these new scopes and open/close them when entering/leaving statement expressions. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2020-05-21scope: s/{start,end}_symbol_scope/{start,end}_block_scope/Luc Van Oostenryck1-2/+2
The functions {start,end}_symbol_scope() haven't been renamed when separated scope have been introduced for functions & blocks. But these functions only start & end a block scope. So, rename them to their more direct name: {start,end}_block_scope(). Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2020-02-20struct_union_enum_specifier: always initialize sym->scopeOleg Nesterov1-0/+1
Currently it is not possible to figure out the scope of the private struct/union/enum type, its ->scope is NULL because bind_symbol() is not called. Change struct_union_enum_specifier() to set sym->scope = block_scope in this case, this is what bind_symbol() does when type has a name. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2017-06-29diet: remove unused struct scope::tokenLuc Van Oostenryck1-1/+0
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2014-08-02Make same_symbol list share the same scopeChristopher Li1-0/+1
Consider the following case, extern inline declare after extern declare of the same function. extern int g(int); extern __inline__ int g(int x) { return x; } Sparse will give the first function global scope and the second one file scope. Also the first one will get the function body from the second one. That cause the failure of the validation/extern-inlien.c This change rebind the scope of the same_symbol chain to the new scope. It will pass the extern-inline.c test case. Signed-off-by: Christopher Li <sparse@chrisli.org>
2013-11-29sparse: Relicense under the MIT licenseFranz Schrober1-1/+17
The old code was relicensed by Novafora Corporation, successor in interest to Transmeta Corporation, in 2009. Other authors were also asked about the change of their contributions to the MIT license and all with copyrightable changes agreed to it. Signed-off-by: Franz Schrober <franzschrober@yahoo.de> Acked-by: Adam DiCarlo <adam@bikko.org> Acked-by: Al Viro <viro@ZenIV.linux.org.uk> Acked-by: Alberto Bertogli <albertito@blitiri.com.ar> Acked-by: Alecs King <alecs@perlchina.org> Acked-by: Alexander Shishkin <alexander.shishckin@gmail.com> Acked-by: Alexey Dobriyan <adobriyan@gmail.com> Acked-by: Alexey Zaytsev <alexey.zaytsev@gmail.com> Acked-by: Andries E. Brouwer <Andries.Brouwer@cwi.nl> Acked-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> Acked-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Acked-by: Ben Pfaff <blp@nicira.com> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Bernd Petrovitsch <bernd@petrovitsch.priv.at> Acked-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Acked-by: Blue Swirl <blauwirbel@gmail.com> Acked-by: Chris Forbes <chrisf@ijw.co.nz> Acked-by: Chris Wedgwood <cw@f00f.org> Acked-by: Christopher Li <sparse@chrisli.org> Acked-by: Damien Lespiau <damien.lespiau@gmail.com> Acked-by: Dan Carpenter <error27@gmail.com> Acked-by: Dan McGee <dan@archlinux.org> Acked-by: Daniel De Graaf <danieldegraaf@gmail.com> Acked-by: Daniel Sheridan <dan.sheridan@postman.org.uk> Acked-by: Dave Jones <davej@redhat.com> Acked-by: David Given <dg@cowlark.com> Acked-by: David Miller <davem@redhat.com> Acked-by: David Mosberger-Tang <dmosberger@gmail.com> Acked-by: David Olien <David.Olien@lsi.com> Acked-by: Diego Elio Pettenò <flameeyes@flameeyes.eu> Acked-by: Emil Medve <Emilian.Medve@Freescale.com> Acked-by: Ethan Jackson <jacksone@nicira.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Acked-by: Frank Zago <fzago@systemfabricworks.com> Acked-by: Frederic Crozat <fcrozat@suse.com> Acked-by: Geoff Johnstone <geoff.johnstone@gmail.com> Acked-by: Hannes Eder <hannes@hanneseder.net> Acked-by: Jan Pokorný <pokorny_jan@seznam.cz> Acked-by: Jeff Garzik <jgarzik@redhat.com> Acked-by: Jiri Slaby <jslaby@suse.cz> Acked-by: Joe Perches <joe@perches.com> Acked-by: Joel Soete <rubisher@scarlet.be> Acked-by: Johannes Berg <johannes@sipsolutions.net> Acked-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net> Acked-by: Josh Triplett <josh@kernel.org> Acked-by: Kamil Dudka <kdudka@redhat.com> Acked-by: Kim Phillips <kim.phillips@linaro.org> Acked-by: KOSAKI Motohiro <kosaki.motohiro@gmail.com> Acked-by: Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Acked-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> Acked-by: Martin Nagy <nagy.martin@gmail.com> Acked-by: Masatake YAMATO <yamato@redhat.com> Acked-by: Mauro Dreissig <mukadr@gmail.com> Acked-by: Michael Büsch <m@bues.ch> Acked-by: Michael Stefaniuc <mstefani@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Mika Kukkonen <mikukkon@iki.fi> Acked-by: Mike Frysinger <vapier@gentoo.org> Acked-by: Mitesh Shah <Mitesh.Shah@synopsys.com> Acked-by: Morten Welinder <mortenw@gnome.org> Acked-by: Namhyung Kim <namhyung@gmail.com> Acked-by: Nicolas Kaiser <nikai@nikai.net> Acked-by: Oleg Nesterov <oleg@redhat.com> Acked-by: Pavel Roskin <proski@gnu.org> Acked-by: Pekka Enberg <penberg@cs.helsinki.fi> Acked-by: Peter Jones <pjones@redhat.com> Acked-by: Peter A Jonsson <pj@sics.se> Acked-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de> Acked-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Acked-by: Randy Dunlap <rdunlap@xenotime.net> Acked-by: Reinhard Tartler <siretart@tauware.de> Ached-by: Richard Knutsson <richard.knutsson@gmail.com> Acked-by: Rob Taylor <rob.taylor@codethink.co.uk> Acked-by: Rui Saraiva <rmpsaraiva@gmail.com> Acked-by: Ryan Anderson <ryan@michonline.com> Acked-by: Sam Ravnborg <sam@ravnborg.org> Acked-by: Samuel Bronson <naesten@gmail.com> Acked-by: Santtu Hyrkkö <santtu.hyrkko@gmail.com> Acked-by: Shakthi Kannan <shakthimaan@gmail.com> Acked-by: Stephen Hemminger <shemminger@linux-foundation.org> Acked-by: Thomas Schmid <Thomas.Schmid@br-automation.com> Acked-by: Tilman Sauerbeck <tilman@code-monkey.de> Acked-by: Vegard Nossum <vegardno@ifi.uio.no> Acked-by: Xi Wang <xi.wang@gmail.com> Acked-by: Yura Pakhuchiy <pakhuchiy@gmail.com> Signed-off-by: Christopher Li <sparse@chrisli.org>
2009-08-11make sparse headers self-compilable...Kamil Dudka1-0/+2
... and thus possible to include them in arbitrary order and without any external dependencies. Signed-off-by: Kamil Dudka <kdudka@redhat.com> Signed-off-by: Christopher Li <sparse@chrisli.org>
2007-07-29[PATCH] file and global scopes are the same for purposes of struct redefiningAl Viro1-0/+1
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2006-12-04delay removing file scopeChristopher Li1-0/+1
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>
2005-08-02Make macros have file scopeLinus Torvalds1-0/+2
Also, macros are special: they can be removed out of scope with #undef, which makes them slightly more interesting when we exit the scope.
2005-08-02Start work on proper scoping with multiple filesLinus Torvalds1-6/+8
Brought on by a query from Mitesh Shah. I claimed it should be easy, let's see if I was full of sh*t (this is just some very early infrastructure, not the whole thing by any means!)
2005-04-07Update copyright notices to reflect the fact that TransmetaLinus Torvalds1-0/+1
isn't the sole copyright owner these days.
2005-04-07Start updating the copyright license comments to the OSL,Linus Torvalds1-1/+3
preparing for a public release.
2005-04-07Expose scoping to symbol binders - we'll need this to checkLinus Torvalds1-1/+11
whether it is a re-definition (ie new declaration in the same scope).
2005-04-07Change the copyright to Transmeta Corp, that's likely to beLinus Torvalds1-1/+1
the real one when it goes out the door.
2005-04-07Separate scopes for blocks and functions. Function scopesLinus Torvalds1-0/+4
are a proper superset of block scopes: function scopes are created by a new function, block scopes by compound statements and statement expressions. Make labels use function scope.
2005-04-07Add copyright statements and file comments. Add a FAQ, README, andLinus Torvalds1-0/+5
placeholder LICENSE file.
2005-04-07Add symbol scoping for proper parsing.Linus Torvalds1-0/+14