Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

LLVM backend for Sparse

branch: master

Trivial: Remove redundant Makefile variable

Signed-off-by: Christopher Li <sparse@chrisli.org>
latest commit 9f97967a95
sparsecli sparsecli authored May 15, 2013
Octocat-spinner-32 Documentation I have updated the sparse.1 man page including the __bitwise May 19, 2012
Octocat-spinner-32 compat Add DEBUG mode, which enables various expensive debug options August 02, 2005
Octocat-spinner-32 gvpr Add shebang to gvpr scripts, make them executable, and change usage a… May 22, 2007
Octocat-spinner-32 validation fix SIGFPE caused by signed division overflow May 11, 2013
Octocat-spinner-32 .gitignore sparse, llvm: Initial commit August 23, 2011
Octocat-spinner-32 FAQ FAQ: update the website address and call it Wiki June 26, 2012
Octocat-spinner-32 LICENSE fix common misspellings with codespell August 20, 2011
Octocat-spinner-32 Makefile Trivial: Remove redundant Makefile variable May 15, 2013
Octocat-spinner-32 README fix common misspellings with codespell August 20, 2011
Octocat-spinner-32 allocate.c Make the ptrlist using the sparse allocator. February 22, 2007
Octocat-spinner-32 allocate.h allocate.h: Stop needlessly returning a void value in __DO_ALLOCATOR July 22, 2007
Octocat-spinner-32 ast-inspect.c inspect: Add switch statement and more August 12, 2011
Octocat-spinner-32 ast-inspect.h inspect: add some expression inspection July 13, 2010
Octocat-spinner-32 ast-model.c fix common misspellings with codespell August 20, 2011
Octocat-spinner-32 ast-model.h inspect: Add switch statement and more August 12, 2011
Octocat-spinner-32 ast-view.c inspect: Add switch statement and more August 12, 2011
Octocat-spinner-32 ast-view.h inspect: add custom ast treeview model July 13, 2010
Octocat-spinner-32 bitmap.h Add "bitmap.h" for some simple bitmap ops April 07, 2005
Octocat-spinner-32 c2xml.c Remove set but not used variable May 31, 2011
Octocat-spinner-32 cgcc Define __SIZEOF_POINTER__ April 21, 2013
Octocat-spinner-32 cgcc.1 Add a manpage for cgcc September 15, 2007
Octocat-spinner-32 char.c Get rid of gcc warning about enum values February 25, 2013
Octocat-spinner-32 char.h switch to delayed handling of escape sequences February 12, 2013
Octocat-spinner-32 compat-bsd.c OpenBSD support December 18, 2008
Octocat-spinner-32 compat-cygwin.c Remove stat-based file identity tests. April 07, 2005
Octocat-spinner-32 compat-linux.c Remove stat-based file identity tests. April 07, 2005
Octocat-spinner-32 compat-mingw.c Fix typos in comments March 09, 2007
Octocat-spinner-32 compat-solaris.c Remove stat-based file identity tests. April 07, 2005
Octocat-spinner-32 compat.h Fix typos in comments March 09, 2007
Octocat-spinner-32 compile-i386.c compile-i386: fix use-after-free in func_cleanup() June 04, 2012
Octocat-spinner-32 compile.c cleanup write to argument array hack December 04, 2006
Octocat-spinner-32 compile.h make sparse headers self-compilable... August 11, 2009
Octocat-spinner-32 cse.c cse: update PHI users when throwing away an instruction August 28, 2011
Octocat-spinner-32 ctags.c ctags: Handle some new namespaces and symbol types. August 06, 2007
Octocat-spinner-32 dissect.c fix handling of address_space in casts and assignments July 10, 2007
Octocat-spinner-32 dissect.h Coding style fix: in a pointer type, * goes with the name, not the type. January 27, 2007
Octocat-spinner-32 evaluate.c Allow forced attribute in function argument April 26, 2013
Octocat-spinner-32 example.c Unhardcode byte size being 8 bits. December 17, 2008
Octocat-spinner-32 expand.c fix SIGFPE caused by signed division overflow May 11, 2013
Octocat-spinner-32 expression.c Get rid of gcc warning about enum values February 25, 2013
Octocat-spinner-32 expression.h Proper variable length array warning April 08, 2013
Octocat-spinner-32 flow.c flow.c: make comment for `dominates' reflect code April 13, 2011
Octocat-spinner-32 flow.h make sparse headers self-compilable... August 11, 2009
Octocat-spinner-32 gdbhelpers Add support for TImode type (__int128_t) August 01, 2009
Octocat-spinner-32 graph.c Remove set but not used variable May 31, 2011
Octocat-spinner-32 ident-list.h Support #pragma once April 21, 2013
Octocat-spinner-32 inline.c Fix inlining switch statement. August 14, 2011
Octocat-spinner-32 lib.c Define __SIZEOF_POINTER__ April 21, 2013
Octocat-spinner-32 lib.h Warn about initialization of a char array with a too long constant C … April 19, 2013
Octocat-spinner-32 linearize.c sparse, llvm: Make function declaration accessible to backend February 04, 2012
Octocat-spinner-32 linearize.h sparse, llvm: Make function declaration accessible to backend February 04, 2012
Octocat-spinner-32 liveness.c unssa: track uses when replacing a phi node August 02, 2009
Octocat-spinner-32 memops.c memops.c: always true expression January 03, 2011
Octocat-spinner-32 obfuscate.c Fix typos in comments March 09, 2007
Octocat-spinner-32 parse.c Allow forced attribute in function argument April 26, 2013
Octocat-spinner-32 parse.dtd add c2xml program July 13, 2007
Octocat-spinner-32 parse.h Fix build with GCC 4.6 series. April 18, 2011
Octocat-spinner-32 pre-process.c Support #pragma once April 21, 2013
Octocat-spinner-32 ptrlist.c ptrlist.c: fix a typo in a comment June 26, 2012
Octocat-spinner-32 ptrlist.h remove unused "container" macro April 13, 2011
Octocat-spinner-32 scope.c Remove symbol.id_list June 11, 2008
Octocat-spinner-32 scope.h make sparse headers self-compilable... August 11, 2009
Octocat-spinner-32 show-parse.c sparse: Fix __builtin_safe_p for pure and const functions August 25, 2011
Octocat-spinner-32 simplify.c fix SIGFPE caused by signed division overflow May 11, 2013
Octocat-spinner-32 sort.c Fix typos in comments March 09, 2007
Octocat-spinner-32 sparse-llvm.c sparse, llvm: Fix type of loaded values October 10, 2012
Octocat-spinner-32 sparse.1 Add description for -Winit-cstring option April 19, 2013
Octocat-spinner-32 sparse.c use ARRAY_SIZE() when possible (continued) April 26, 2011
Octocat-spinner-32 sparse.pc.in Generate and install a pkg-config file. Add DESTDIR support to Makefile. December 05, 2006
Octocat-spinner-32 sparsec sparse, llvm: Make llc output to stdout in sparsec November 21, 2011
Octocat-spinner-32 storage.c [PATCH] makes some needlessly global code static June 27, 2005
Octocat-spinner-32 storage.h make sparse headers self-compilable... August 11, 2009
Octocat-spinner-32 symbol.c Proper variable length array warning April 08, 2013
Octocat-spinner-32 symbol.h Allow forced attribute in function argument April 26, 2013
Octocat-spinner-32 target.c Revert "sparse: Bump up sizeof(_Bool) to 8 bits" December 21, 2011
Octocat-spinner-32 target.h Add support for TImode type (__int128_t) August 01, 2009
Octocat-spinner-32 test-dissect.c cleanup write to argument array hack December 04, 2006
Octocat-spinner-32 test-inspect.c inspect: Add test-inspect program July 13, 2010
Octocat-spinner-32 test-lexing.c cleanup write to argument array hack December 04, 2006
Octocat-spinner-32 test-linearize.c cleanup write to argument array hack December 04, 2006
Octocat-spinner-32 test-parsing.c Fix typos in comments March 09, 2007
Octocat-spinner-32 test-sort.c Coding style fix: in a pointer type, * goes with the name, not the type. January 27, 2007
Octocat-spinner-32 test-unssa.c cleanup write to argument array hack December 04, 2006
Octocat-spinner-32 token.h Support #pragma once April 21, 2013
Octocat-spinner-32 tokenize.c Get rid of gcc warning about enum values February 25, 2013
Octocat-spinner-32 unssa.c unssa: track use of newly added pseudo May 04, 2012
README
  sparse (spärs), adj,., spars-er, spars-est.
	1. thinly scattered or distributed; "a sparse population"
	2. thin; not thick or dense: "sparse hair"
	3. scanty; meager.
	4. semantic parse
  	[ from Latin: spars(us) scattered, past participle of
	  spargere 'to sparge' ]

	Antonym: abundant

Sparse is a semantic parser of source files: it's neither a compiler
(although it could be used as a front-end for one) nor is it a
preprocessor (although it contains as a part of it a preprocessing
phase). 

It is meant to be a small - and simple - library.  Scanty and meager,
and partly because of that easy to use.  It has one mission in life:
create a semantic parse tree for some arbitrary user for further
analysis.  It's not a tokenizer, nor is it some generic context-free
parser.  In fact, context (semantics) is what it's all about - figuring
out not just what the grouping of tokens are, but what the _types_ are
that the grouping implies.

And no, it doesn't use lex and yacc (or flex and bison).  In my personal
opinion, the result of using lex/yacc tends to end up just having to
fight the assumptions the tools make. 

The parsing is done in five phases:

 - full-file tokenization
 - pre-processing (which can cause another tokenization phase of another
   file)
 - semantic parsing.
 - lazy type evaluation
 - inline function expansion and tree simplification

Note the "full file" part. Partly for efficiency, but mostly for ease of
use, there are no "partial results". The library completely parses one
whole source file, and builds up the _complete_ parse tree in memory.

Also note the "lazy" in the type evaluation.  The semantic parsing
itself will know which symbols are typedefines (required for parsing C
correctly), but it will not have calculated what the details of the
different types are.  That will be done only on demand, as the back-end
requires the information. 

This means that a user of the library will literally just need to do

  struct string_list *filelist = NULL;
  char *file;

  action(sparse_initialize(argc, argv, filelist));

  FOR_EACH_PTR_NOTAG(filelist, file) {
    action(sparse(file));
  } END_FOR_EACH_PTR_NOTAG(file);

and he is now done - having a full C parse of the file he opened.  The
library doesn't need any more setup, and once done does not impose any
more requirements.  The user is free to do whatever he wants with the
parse tree that got built up, and needs not worry about the library ever
again.  There is no extra state, there are no parser callbacks, there is
only the parse tree that is described by the header files. The action
function takes a pointer to a symbol_list and does whatever it likes with it.

The library also contains (as an example user) a few clients that do the
preprocessing, parsing and type evaluation and just print out the
results.  These clients were done to verify and debug the library, and
also as trivial examples of what you can do with the parse tree once it
is formed, so that users can see how the tree is organized. 
Something went wrong with that request. Please try again.