aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/test-parsing.c
AgeCommit message (Collapse)AuthorFilesLines
2018-06-21ptrlist: remove the now unneeded FOR_EACH_PTR_NOTAG()Luc Van Oostenryck1-2/+2
Now that FOR_EACH_PTR() doesn't strip the tag anymore, there is no more needs for FOR_EACH_PTR_NOTAG() as both do the same. So convert the few uses to FOR_EACH_PTR() and remove its definition. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
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>
2007-03-09Fix typos in commentsJosh Triplett1-1/+1
Signed-off-by: Josh Triplett <josh@freedesktop.org>
2006-12-04cleanup write to argument array hackChristopher Li1-4/+6
The sparse interface is a kind of snaky that it change the input argument array. The function sparse() does the same hack just to skip the files. This patch add the ptr list for string. So sparse_initialize will return list of file to compile. The string pointer is not aligned at word boundary. This patch introduce non taged version of the ptr list iteration function. Signed-off-by: Christopher Li <sparse@chrisli.org>
2005-11-02Handle symbols from "-include" file tooLinus Torvalds1-2/+13
Noted by Mitesh Shah Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-08-03Update the calling interface to "sparse()".Linus Torvalds1-6/+9
Start off with sparse_initialize(argc, argv); which will return the number of filenames found. You can then use that, or just check if *argv is NULL in a loop like while (*argv) list = sparse(argv); where you get the declaration list for each file in turn.
2005-04-07Split out the blob allocator from lib.c into allocate.c.Linus Torvalds1-0/+1
It's disgusting how intimate lib.c is with all the types, and this is slowly trying to split things up a bit. Now the intimate part is in allocate.c, but maybe we can get to the point where each allocation user just declares its own allocation strategy, and just uses the generic routines in allocate.c
2005-04-07Clean up test-parsing too.Linus Torvalds1-41/+1
2005-04-07Make "translation_unit()" do symbol evaluation too.Linus Torvalds1-5/+5
Not only do all users want it, the list of used symbols is not stable until after the tree has been evaluated.
2005-04-07Get rid of the old "iterate()" interfaces.Linus Torvalds1-4/+8
Use FOR_EACH_PTR() instead, or the much fancier iterators for basic blocks.
2005-04-07Print out the proper filename on open failure.Linus Torvalds1-1/+1
Pointed out by Mitesh shah <mshah@teja.com>
2005-04-07Make "next_path" be per-stream for better "include_next".Linus Torvalds1-1/+1
Maybe this makes us gcc-compatible. Maybe it doesn't.
2005-04-07Initialize C type system after parsing the command line arguments.Linus Torvalds1-0/+3
This makes "-m64" actually work.
2005-04-07[PATCH] compilation fix for test-parsing.cAndries E. Brouwer1-1/+1
An extra semicolon results in an empty statement, causing the "declaration after statement" problem. Newer versions of gcc will silently accept it, but older versions won't.
2005-04-07o create create_builtin_streamArnaldo Carvalho de Melo1-3/+1
Moving the common builtin stream creation to lib.c
2005-04-07o move add_pre_buffer, handle_switch and friends to lib.cArnaldo Carvalho de Melo1-52/+8
This way we can reuse this thing on the utilities, this time check and test-parsing are the ones using it.
2005-04-07Update copyright notices to reflect the fact that TransmetaLinus Torvalds1-0/+1
isn't the sole copyright owner these days.
2005-04-07Split tree evaluation into two phases: the first phaseLinus Torvalds1-1/+2
does type evaluation, the second one does value evaluation and inline expansion. This has the advantage that by the time we do value evaluation and inline expansion, we have traversed the tree fully once, which allows us to take advantage of function-global information, ie we know whether symbols have ever been accessed etc.
2005-04-07Make the example clients be under the OSL v1.1 too. Linus Torvalds1-1/+3
2005-04-07Clean up: mark local stuff 'static', and remove unused function.Linus Torvalds1-12/+6
Use the "used_list" to build up the symbol tree, so that we automatically get new symbols that get discovered during evaluation.
2005-04-07Disable allocation statistics printing for now. Linus Torvalds1-0/+2
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-07Evaluate more expression types: conditional expressions, statementLinus Torvalds1-58/+4
expressions, post-op expressions. Move some of the evaluation functions from test-parsing.c to evaluate.c
2005-04-07Evaluate initializers separately. We'll need this to handleLinus Torvalds1-1/+1
type discovery (initializers are not independent expressions).
2005-04-07Parse initializers properly. We parsed them before, but we didn'tLinus Torvalds1-0/+2
add them to the parse tree. We now do.
2005-04-07Add support for tokenizing a pre-allocated string instead of a file.Linus Torvalds1-0/+49
Use the new string tokenization to handle some simple command line switches like -Dxxxx=yyyy - by simply adding lines to a buffer that is tokenized and inserted before the actual file.
2005-04-07Make a function call point an expression type of its own, andLinus Torvalds1-0/+2
make the arguments use a proper argument list instead of being a comma-expression (which has totally different type semantics). Evaluate assignments and function calls (and their arguments). Show function calls in the debug info.
2005-04-07Add tree evaluation to a few more statement types (iterators,Linus Torvalds1-0/+16
switch and case-statements). Handle varying functions.
2005-04-07Fix indirect type parsing (functions, arrays, bitfields). UpdateLinus Torvalds1-4/+6
users to match. Examine array type sizes. Evaluate 'sizeof()', and realize that you can dereference arrays as well as pointers.
2005-04-07Add preprocessor directives to manipulate the include path.Linus Torvalds1-14/+0
2005-04-07Start "evaluating" expression trees. That is, evaluate the types ofLinus Torvalds1-1/+47
the expressions, and turn constant expressions (enums and constant tokens) into "value expressions" - their actual values.
2005-04-07Like other type definitions, typedefs too can have multipleLinus Torvalds1-0/+3
type entries, ie typedef struct type type_t, *typep_t; and we shouldn't just expect one.
2005-04-07Parse type qualifiers properly instead of re-using the declarationLinus Torvalds1-0/+1
specifiers parsing (which is a proper superset of the much more limited parsing that we wanted at this point). Parse void and ellipsis arguments in function argument lists. Parse named structure member initializers.
2005-04-07Move includepath[] array out of pre-processor, since we wantLinus Torvalds1-3/+33
to change it from the callers..
2005-04-07Add copyright statements and file comments. Add a FAQ, README, andLinus Torvalds1-0/+7
placeholder LICENSE file.
2005-04-07Ok, move closer to a proper type parser. It's still way tooLinus Torvalds1-0/+1
confused and ugly, but it will slowly be getting there. I think.
2005-04-07Make iterators take a helper datum, and tell the callback whetherLinus Torvalds1-1/+1
the entry is the first or last. Make printouts prettier by using the new iterator functionality.
2005-04-07Fix fd leak in tokenization.Linus Torvalds1-0/+1
2005-04-07Whitespace and comment fixes for testersLinus Torvalds1-0/+9
2005-04-07Teach the preprocessing pass to handle 'include' and Linus Torvalds1-1/+1
'elif'.
2005-04-07Add initial preprocessor pass (doesn't actually do much)Linus Torvalds1-1/+1
Make tokens know about newlines
2005-04-07Implement space-efficient allocator for small data structures. WeLinus Torvalds1-0/+2
do not want any allocation overhead when some of the data structures average a length of 2.8 bytes (integer constant tokens). Fix up integer constant token parsing (don't try to evaluate them at parse-time, we just lose information that way).
2005-04-07Add allocators for statisticsLinus Torvalds1-0/+7
2005-04-07Parse a lot more types (including complex structures and unions andLinus Torvalds1-3/+2
function pointers). Still missing enum initializer parsing, but we fake it for now. This actually parses the header files, and stumbles only when it starts seeing its first real statements (it can do expression statements, but that's about it).
2005-04-07Start binding typedefs. More work needed, but this parses correctly:Linus Torvalds1-9/+4
typedef int a; a b = 0; Use new 'add_symbol()' infrastructure.
2005-04-07Add more type parsing: function and array declarators, functionLinus Torvalds1-5/+5
parameter lists etc. It can now parse things like const volatile int hello(const int (*argc)(void), const char *const* argv); apparently correctly.
2005-04-07Make for more readable "expected xxxx" messages.Linus Torvalds1-3/+6
Start parsing pointer, array and function types.
2005-04-07First cuts at simple type declaration and statement parsing.Linus Torvalds1-3/+4
2005-04-07Start handling minimal semantic information, needed for types.Linus Torvalds1-0/+2
This adds a layer of symbol information on top of the raw tokens.
2005-04-07Add simple recursive-descent C expression parsing (but we only do theLinus Torvalds1-0/+27
simple binops so far, type parsing is still way off). Clean up and update tokenization.