NameDateSize

..05-Feb-20204

allocate.c21-Nov-20194.6 KiB

allocate.h21-Nov-20192.7 KiB

ast-inspect.c05-Jan-20196.8 KiB

ast-inspect.h05-Jan-2019330

ast-model.c05-Jan-201914.4 KiB

ast-model.h05-Jan-20192.2 KiB

ast-view.c05-Jan-20191.1 KiB

ast-view.h05-Jan-201995

avl.c05-Jan-201911.4 KiB

avl.h05-Jan-20194 KiB

bitmap.h05-Jan-20191.4 KiB

bits.h21-Nov-20191.2 KiB

builtin.c21-Nov-201924.4 KiB

c2xml.c21-Nov-20197.7 KiB

cgcc21-Nov-201912.3 KiB

cgcc.105-Jan-20191 KiB

char.c21-Nov-20193.2 KiB

char.h05-Jan-2019148

check_64bit_shift.c12-Aug-20192.4 KiB

check_access_ok_math.c21-Nov-20192.5 KiB

check_all_func_returns.c05-Jan-20192.5 KiB

check_allocating_enough_data.c05-Jan-20191.5 KiB

check_allocation_funcs.c05-Jan-20192.5 KiB

check_arm64_tagged.c25-Nov-20196.7 KiB

check_array_condition.c05-Jan-20191.3 KiB

check_assign_vs_compare.c05-Jan-20191.5 KiB

check_atomic_inc_dec.c05-Jan-20196.5 KiB

check_bit_shift.c05-Jan-20194 KiB

check_bogus_irqrestore.c05-Jan-20191.2 KiB

check_bogus_loop.c05-Jan-20192.2 KiB

check_buffer_too_small_for_struct.c12-Aug-20192.9 KiB

check_call_tree.c05-Jan-20191.1 KiB

check_capable.c05-Jan-20193.3 KiB

check_cast_assign.c05-Jan-20191.6 KiB

check_check_deref.c21-Nov-20194 KiB

check_cmn_err.c12-Aug-20191.3 KiB

check_container_of.c05-Jan-20191.9 KiB

check_continue_vs_break.c21-Nov-20192.9 KiB

check_debug.c10-Jan-202021.2 KiB

check_debug.h10-Jan-20202.9 KiB

check_deref.c21-Nov-20196.9 KiB

check_deref_check.c21-Nov-20192.3 KiB

check_dereferences_param.c21-Nov-20193 KiB

check_dev_queue_xmit.c05-Jan-20193.2 KiB

check_dma_mapping_error.c12-Aug-20192.2 KiB

check_dma_on_stack.c05-Jan-20192.1 KiB

check_double_checking.c21-Nov-20195.9 KiB

check_err_ptr.c05-Jan-20192 KiB

check_err_ptr_deref.c12-Aug-20196.5 KiB

check_expects_err_ptr.c05-Jan-20192.2 KiB

check_free.c21-Nov-20195.8 KiB

check_free_strict.c21-Nov-20197.4 KiB

check_freeing_devm.c05-Jan-20192.3 KiB

check_freeing_null.c05-Jan-20191.3 KiB

check_frees_argument.c05-Jan-20193.4 KiB

check_frees_param.c10-Jan-20202.6 KiB

check_frees_param_strict.c05-Jan-20193.9 KiB

check_get_user_overflow.c21-Nov-20194.7 KiB

check_gfp_dma.c05-Jan-20191.6 KiB

check_held_dev.c12-Aug-20193.4 KiB

check_implicit_dependencies.c05-Jan-20197.5 KiB

check_implicit_dependencies_tester.c05-Jan-20194.2 KiB

check_impossible_mask.c05-Jan-20192.6 KiB

check_indenting.c05-Jan-20195.7 KiB

check_index_overflow.c05-Jan-20198.1 KiB

check_info_leak.c05-Jan-20192.4 KiB

check_input_free_device.c05-Jan-20191.8 KiB

check_kernel.c21-Nov-201912.6 KiB

check_kernel_printf.c12-Aug-201953.1 KiB

check_kmalloc_to_bugon.c05-Jan-20191.7 KiB

check_kmalloc_wrong_size.c05-Jan-20192.5 KiB

check_kunmap.c05-Jan-20192.3 KiB

check_leaks.c05-Jan-20195.6 KiB

check_list.h03-Feb-20205.6 KiB

check_locking.c03-Feb-202040.3 KiB

check_logical_instead_of_bitwise.c05-Jan-20191.7 KiB

check_macro_side_effects.c12-Aug-20193.6 KiB

check_macros.c05-Jan-20192.1 KiB

check_memcpy_overflow.c05-Jan-20198.4 KiB

check_memset.c21-Nov-20191.6 KiB

check_min_t.c05-Jan-20191.4 KiB

check_missing_break.c12-Aug-20194.2 KiB

check_mod_timer.c05-Jan-20191.2 KiB

check_no_effect.c05-Jan-20191.4 KiB

check_no_if_block.c05-Jan-20191.5 KiB

check_no_return.c12-Aug-20191.3 KiB

check_nospec.c21-Nov-20196.6 KiB

check_off_by_one_relative.c12-Aug-20193.3 KiB

check_or_vs_and.c05-Jan-20194.6 KiB

check_param_mapper.c10-Jan-20201.6 KiB

check_passes_sizeof.c05-Jan-20192.5 KiB

check_platform_device_put.c05-Jan-20192.1 KiB

check_pointer_math.c05-Jan-20193.2 KiB

check_precedence.c12-Aug-20193.4 KiB

check_proc_create.c05-Jan-20191.8 KiB

check_puts_argument.c05-Jan-20193.2 KiB

check_readl_infinite_loops.c21-Nov-20193.6 KiB

check_release_resource.c05-Jan-20192.4 KiB

check_resource_size.c05-Jan-20192.3 KiB

check_return.c05-Jan-20191.6 KiB

check_return_cast.c12-Aug-20191.4 KiB

check_return_efault.c05-Jan-20193.5 KiB

check_return_enomem.c05-Jan-20192.1 KiB

check_return_negative_var.c05-Jan-20191.4 KiB

check_rosenberg.c21-Nov-20199.8 KiB

check_select.c05-Jan-20191 KiB

check_shift_to_zero.c12-Aug-20192.2 KiB

check_signed.c05-Jan-20197.4 KiB

check_signed_integer_overflow_check.c05-Jan-20192.5 KiB

check_sizeof.c05-Jan-20193.8 KiB

check_snprintf.c12-Aug-20192.2 KiB

check_snprintf_overflow.c05-Jan-20192 KiB

check_spectre.c12-Aug-20194.6 KiB

check_spectre_second_half.c12-Aug-20192.9 KiB

check_sprintf_overflow.c05-Jan-20191.7 KiB

check_stack.c05-Jan-20192 KiB

check_strcpy_overflow.c05-Jan-20191.8 KiB

check_string_len.c12-Aug-20195.2 KiB

check_struct_type.c05-Jan-20191.9 KiB

check_syscall_arg_type.c12-Aug-20193.5 KiB

check_template.c05-Jan-20193 KiB

check_test_bit.c05-Jan-20191.6 KiB

check_testing_index_after_use.c21-Nov-20193 KiB

check_trinity_generator.c05-Jan-20192.4 KiB

check_type.c05-Jan-20191.6 KiB

check_uninitialized.c21-Nov-20199.1 KiB

check_unreachable.c22-Aug-20196.4 KiB

check_unused_ret.c05-Jan-20195.2 KiB

check_unwind.c21-Nov-20196.8 KiB

check_wait_for_common.c05-Jan-20191.2 KiB

check_wine.c05-Jan-20191.2 KiB

check_wine_filehandles.c05-Jan-20192.3 KiB

check_wine_WtoA.c12-Aug-20191.9 KiB

check_wrong_size_arg.c05-Jan-20192.3 KiB

check_zero_to_err_ptr.c12-Aug-20194.2 KiB

compat/05-Jan-20195

compat-bsd.c05-Jan-20191.3 KiB

compat-cygwin.c05-Jan-20191.7 KiB

compat-linux.c05-Jan-2019119

compat-mingw.c05-Jan-20191.6 KiB

compat-solaris.c05-Jan-2019685

compat.h21-Nov-2019685

compile-i386.c21-Nov-201954.8 KiB

compile.c21-Nov-20192.4 KiB

compile.h05-Jan-2019199

cse.c21-Nov-20198.2 KiB

cse.h21-Nov-2019176

ctags.c21-Nov-20195.6 KiB

cwchash/05-Jan-201911

dissect.c05-Jan-201914.2 KiB

dissect.h05-Jan-2019563

Documentation/21-Nov-201920

dominate.c21-Nov-20193.4 KiB

dominate.h21-Nov-2019258

evaluate.c21-Nov-201993.2 KiB

evaluate.h21-Nov-2019721

example.c21-Nov-201944 KiB

expand.c21-Nov-201931 KiB

expand.h05-Jan-20191.5 KiB

expression.c21-Nov-201924.3 KiB

expression.h21-Nov-20198.8 KiB

FAQ05-Jan-20193.3 KiB

flow.c21-Nov-201918.7 KiB

flow.h21-Nov-20191.5 KiB

flowgraph.c21-Nov-20194.7 KiB

flowgraph.h21-Nov-2019266

gcc-attr-list.h21-Nov-20194.4 KiB

gdbhelpers21-Nov-20195.4 KiB

GPL-205-Jan-201917.7 KiB

graph.c21-Nov-20195.7 KiB

gvpr/05-Jan-20195

ident-list.h25-Nov-20192.1 KiB

inline.c21-Nov-201915.4 KiB

ir.c21-Nov-20194 KiB

ir.h21-Nov-2019101

lib.c03-Feb-202039.5 KiB

lib.h03-Feb-20209.1 KiB

LICENSE05-Jan-20193.1 KiB

linearize.c21-Nov-201963.1 KiB

linearize.h21-Nov-20197.8 KiB

liveness.c21-Nov-20197.1 KiB

liveness.h21-Nov-2019227

machine.h03-Feb-20201.8 KiB

macro_table.c21-Nov-20192.8 KiB

Makefile03-Feb-202011.7 KiB

memops.c21-Nov-20195 KiB

obfuscate.c21-Nov-20192.2 KiB

opcode.c21-Nov-20191.4 KiB

opcode.def21-Nov-20195.8 KiB

opcode.h21-Nov-2019649

optimize.c21-Nov-20192.4 KiB

optimize.h21-Nov-2019122

parse.c21-Nov-201985.4 KiB

parse.dtd05-Jan-20191.6 KiB

parse.h21-Nov-20194.5 KiB

pre-process.c03-Feb-202056.3 KiB

ptrlist.c21-Nov-201910.6 KiB

ptrlist.h21-Nov-20198.7 KiB

ptrmap.c21-Nov-20192.6 KiB

ptrmap.h21-Nov-2019865

README21-Nov-20193 KiB

scope.c05-Jan-20193.6 KiB

scope.h21-Nov-20192 KiB

show-parse.c21-Nov-201928 KiB

simplify.c21-Nov-201940.9 KiB

smatch.c10-Jan-20208.5 KiB

smatch.h03-Feb-202048.7 KiB

smatch_about_fn_ptr_arg.c12-Aug-20195.2 KiB

smatch_address.c10-Jan-20208.1 KiB

smatch_annotate.c05-Jan-20191.5 KiB

smatch_array_values.c21-Nov-20195.3 KiB

smatch_assigned_expr.c21-Nov-20193.7 KiB

smatch_bits.c21-Nov-201910.4 KiB

smatch_buf_comparison.c12-Aug-201920.3 KiB

smatch_buf_size.c10-Jan-202022 KiB

smatch_capped.c12-Aug-20198.1 KiB

smatch_common_functions.c21-Nov-20192.7 KiB

smatch_comparison.c10-Jan-202065.6 KiB

smatch_conditions.c21-Nov-201918.7 KiB

smatch_constraints.c12-Aug-201912.4 KiB

smatch_constraints_required.c12-Aug-201912.1 KiB

smatch_container_of.c03-Feb-202014.3 KiB

smatch_data/10-Jan-202059

smatch_data_source.c12-Aug-20192.7 KiB

smatch_db.c03-Feb-202063.8 KiB

smatch_equiv.c12-Aug-20196.6 KiB

smatch_estate.c21-Nov-20199.8 KiB

smatch_expression_stacks.c05-Jan-20191.3 KiB

smatch_expression_stacks.h05-Jan-2019276

smatch_expressions.c10-Jan-20207 KiB

smatch_extra.c10-Jan-202074 KiB

smatch_extra.h10-Jan-202011.9 KiB

smatch_files.c05-Jan-20191.5 KiB

smatch_flow.c21-Nov-201946.4 KiB

smatch_fn_arg_link.c05-Jan-20194.8 KiB

smatch_fresh_alloc.c03-Feb-20204.4 KiB

smatch_function_hashtable.h05-Jan-20193.8 KiB

smatch_function_hooks.c10-Jan-202031.8 KiB

smatch_function_info.c05-Jan-20191.1 KiB

smatch_function_ptrs.c21-Nov-201910.2 KiB

smatch_helper.c10-Jan-202025.6 KiB

smatch_hooks.c21-Nov-20197.2 KiB

smatch_ignore.c12-Aug-20192.6 KiB

smatch_imaginary_absolute.c12-Aug-20192.2 KiB

smatch_implied.c10-Jan-202031.3 KiB

smatch_impossible.c05-Jan-20192.7 KiB

smatch_integer_overflow.c21-Nov-20196.1 KiB

smatch_kernel_user_data.c25-Nov-201937.1 KiB

smatch_links.c12-Aug-20192.7 KiB

smatch_math.c03-Feb-202044.8 KiB

smatch_mem_tracker.c21-Nov-20191.8 KiB

smatch_modification_hooks.c21-Nov-20196.8 KiB

smatch_mtag.c03-Feb-202011.2 KiB

smatch_mtag_data.c21-Nov-20196 KiB

smatch_mtag_map.c12-Aug-20191.6 KiB

smatch_nul_terminator.c21-Nov-20197.4 KiB

smatch_param_cleared.c05-Jan-20195.4 KiB

smatch_param_compare_limit.c12-Aug-20199.2 KiB

smatch_param_filter.c21-Nov-20195.1 KiB

smatch_param_limit.c21-Nov-20195.5 KiB

smatch_param_set.c21-Nov-20197.4 KiB

smatch_param_to_mtag_data.c21-Nov-20195.5 KiB

smatch_param_used.c21-Nov-20192.8 KiB

smatch_parameter_names.c05-Jan-20191.1 KiB

smatch_parse_call_math.c21-Nov-201912.6 KiB

smatch_parsed_conditions.c10-Jan-20203.1 KiB

smatch_passes_array_size.c12-Aug-20192.1 KiB

smatch_project.c05-Jan-20194.9 KiB

smatch_ranges.c10-Jan-202052.3 KiB

smatch_real_absolute.c21-Nov-20193.8 KiB

smatch_recurse.c05-Jan-20194.1 KiB

smatch_return_to_param.c12-Aug-20195.8 KiB

smatch_returns.c21-Nov-20193.6 KiB

smatch_scope.c05-Jan-20192.5 KiB

smatch_scripts/10-Jan-202041

smatch_slist.c03-Feb-202024.5 KiB

smatch_slist.h12-Aug-20193.7 KiB

smatch_start_states.c05-Jan-20191.6 KiB

smatch_statement_count.c12-Aug-20192.1 KiB

smatch_states.c10-Jan-202025.8 KiB

smatch_stored_conditions.c12-Aug-20197.1 KiB

smatch_string_list.c12-Aug-20191.8 KiB

smatch_strings.c05-Jan-20193.7 KiB

smatch_strlen.c12-Aug-20198.7 KiB

smatch_struct_assignment.c21-Nov-201913.7 KiB

smatch_sval.c10-Jan-202017.8 KiB

smatch_tracker.c05-Jan-20192.4 KiB

smatch_type.c03-Feb-202017.7 KiB

smatch_type_links.c05-Jan-20192 KiB

smatch_type_val.c21-Nov-201915.7 KiB

smatch_unknown_value.c05-Jan-20191.9 KiB

smatch_untracked_param.c21-Nov-20197.2 KiB

smatch_var_sym.c05-Jan-20195 KiB

sort.c21-Nov-20195.6 KiB

sparse-llvm-dis21-Nov-2019271

sparse-llvm.c21-Nov-201931.6 KiB

sparse.121-Nov-201916.8 KiB

sparse.c21-Nov-20198.3 KiB

sparsec21-Nov-2019888

sparsei21-Nov-2019404

ssa.c21-Nov-20198.6 KiB

ssa.h21-Nov-201998

sset.c21-Nov-2019578

sset.h21-Nov-20191.1 KiB

stats.c05-Jan-20191.7 KiB

storage.c05-Jan-20197.4 KiB

storage.h05-Jan-20191.7 KiB

symbol.c21-Nov-201924.6 KiB

symbol.h21-Nov-201914.5 KiB

target.c21-Nov-20193.1 KiB

target.h21-Nov-20191.5 KiB

test-dissect.c21-Nov-20192.1 KiB

test-inspect.c21-Nov-2019854

test-lexing.c21-Nov-20191.7 KiB

test-linearize.c21-Nov-20192 KiB

test-parsing.c21-Nov-20192.4 KiB

test-sort.c05-Jan-2019852

test-unssa.c21-Nov-20191.7 KiB

token.h21-Nov-20196.6 KiB

token_store.c05-Jan-20193.8 KiB

tokenize.c21-Nov-201923 KiB

unssa.c21-Nov-20193.5 KiB

utils.c21-Nov-2019715

utils.h21-Nov-20191.2 KiB

validation/03-Feb-2020483

README

1For parsing implicit dependencies, see smatch_scripts/implicit_dependencies.
2=======
3  sparse (sp��rs), adj,., spars-er, spars-est.
4	1. thinly scattered or distributed; "a sparse population"
5	2. thin; not thick or dense: "sparse hair"
6	3. scanty; meager.
7	4. semantic parse
8  	[ from Latin: spars(us) scattered, past participle of
9	  spargere 'to sparge' ]
10
11	Antonym: abundant
12
13Sparse is a semantic parser of source files: it's neither a compiler
14(although it could be used as a front-end for one) nor is it a
15preprocessor (although it contains as a part of it a preprocessing
16phase).
17
18It is meant to be a small - and simple - library.  Scanty and meager,
19and partly because of that easy to use.  It has one mission in life:
20create a semantic parse tree for some arbitrary user for further
21analysis.  It's not a tokenizer, nor is it some generic context-free
22parser.  In fact, context (semantics) is what it's all about - figuring
23out not just what the grouping of tokens are, but what the _types_ are
24that the grouping implies.
25
26And no, it doesn't use lex and yacc (or flex and bison).  In my personal
27opinion, the result of using lex/yacc tends to end up just having to
28fight the assumptions the tools make.
29
30The parsing is done in five phases:
31
32 - full-file tokenization
33 - pre-processing (which can cause another tokenization phase of another
34   file)
35 - semantic parsing.
36 - lazy type evaluation
37 - inline function expansion and tree simplification
38
39Note the "full file" part. Partly for efficiency, but mostly for ease of
40use, there are no "partial results". The library completely parses one
41whole source file, and builds up the _complete_ parse tree in memory.
42
43Also note the "lazy" in the type evaluation.  The semantic parsing
44itself will know which symbols are typedefines (required for parsing C
45correctly), but it will not have calculated what the details of the
46different types are.  That will be done only on demand, as the back-end
47requires the information. 
48
49This means that a user of the library will literally just need to do
50
51  struct string_list *filelist = NULL;
52  char *file;
53
54  action(sparse_initialize(argc, argv, filelist));
55
56  FOR_EACH_PTR(filelist, file) {
57    action(sparse(file));
58  } END_FOR_EACH_PTR(file);
59
60and he is now done - having a full C parse of the file he opened.  The
61library doesn't need any more setup, and once done does not impose any
62more requirements.  The user is free to do whatever he wants with the
63parse tree that got built up, and needs not worry about the library ever
64again.  There is no extra state, there are no parser callbacks, there is
65only the parse tree that is described by the header files. The action
66funtion takes a pointer to a symbol_list and does whatever it likes with it.
67
68The library also contains (as an example user) a few clients that do the
69preprocessing, parsing and type evaluation and just print out the
70results.  These clients were done to verify and debug the library, and
71also as trivial examples of what you can do with the parse tree once it
72is formed, so that users can see how the tree is organized.
73