Name Date Size #Lines LOC

..14-Feb-2021-

Documentation/H14-Feb-2021-

compat/H14-Feb-2021-

cwchash/H14-Feb-2021-

gvpr/H14-Feb-2021-

smatch_data/H14-Feb-2021-

smatch_scripts/H14-Feb-2021-

validation/H14-Feb-2021-

FAQH A D14-Feb-20213.3 KiB7556

GPL-2H A D14-Feb-202117.7 KiB340281

LICENSEH A D14-Feb-20213.1 KiB7152

MakefileH A D14-Feb-202111.7 KiB393315

READMEH A D14-Feb-20213 KiB7358

allocate.cH A D14-Feb-20214.6 KiB156103

allocate.hH A D14-Feb-20212.7 KiB9784

ast-inspect.cH A D14-Feb-20216.8 KiB223196

ast-inspect.hH A D14-Feb-2021330 1810

ast-model.cH A D14-Feb-202114.4 KiB470240

ast-model.hH A D14-Feb-20212.2 KiB9155

ast-view.cH A D14-Feb-20211.1 KiB5035

ast-view.hH A D14-Feb-202195 83

avl.cH A D14-Feb-202111.4 KiB525348

avl.hH A D14-Feb-20214 KiB14259

bitmap.hH A D14-Feb-20211.4 KiB5242

bits.hH A D14-Feb-20211.2 KiB6241

builtin.cH A D14-Feb-202124.4 KiB559438

c2xml.cH A D14-Feb-20217.7 KiB335248

cgccH A D14-Feb-202112.3 KiB402328

cgcc.1H A D14-Feb-20211 KiB3836

char.cH A D14-Feb-20213.2 KiB147140

char.hH A D14-Feb-2021148 32

check_64bit_shift.cH A D14-Feb-20212.4 KiB9962

check_access_ok_math.cH A D14-Feb-20212.5 KiB11175

check_all_func_returns.cH A D14-Feb-20212.5 KiB8942

check_allocating_enough_data.cH A D14-Feb-20211.6 KiB5632

check_allocation_funcs.cH A D14-Feb-20212.5 KiB10774

check_arm64_tagged.cH A D14-Feb-20216.7 KiB261145

check_array_condition.cH A D14-Feb-20211.3 KiB5322

check_assign_vs_compare.cH A D14-Feb-20211.5 KiB6536

check_atomic_inc_dec.cH A D14-Feb-202112 KiB477367

check_bit_shift.cH A D14-Feb-20214 KiB170127

check_bogus_irqrestore.cH A D14-Feb-20211.2 KiB4118

check_bogus_loop.cH A D14-Feb-20212.2 KiB9662

check_buffer_too_small_for_struct.cH A D14-Feb-20212.9 KiB11478

check_call_tree.cH A D14-Feb-20211.1 KiB4321

check_capable.cH A D14-Feb-20213.3 KiB12585

check_cast_assign.cH A D14-Feb-20211.6 KiB6237

check_check_deref.cH A D14-Feb-20214 KiB172113

check_cmn_err.cH A D14-Feb-20211.3 KiB5321

check_container_of.cH A D14-Feb-20211.9 KiB7036

check_continue_vs_break.cH A D14-Feb-20212.9 KiB12982

check_debug.cH A D14-Feb-202122.4 KiB850677

check_debug.hH A D14-Feb-20213 KiB8659

check_deref.cH A D14-Feb-20216.9 KiB297227

check_deref_check.cH A D14-Feb-20212.3 KiB9862

check_dereferences_param.cH A D14-Feb-20213 KiB13187

check_dev_queue_xmit.cH A D14-Feb-20213.2 KiB13392

check_dma_mapping_error.cH A D14-Feb-20212.2 KiB8556

check_dma_on_stack.cH A D14-Feb-20212.1 KiB8561

check_double_checking.cH A D14-Feb-20215.9 KiB285206

check_err_ptr.cH A D14-Feb-20211.9 KiB8355

check_err_ptr_deref.cH A D14-Feb-20216.5 KiB242184

check_expects_err_ptr.cH A D14-Feb-20212.2 KiB9563

check_free.cH A D14-Feb-20215.8 KiB303227

check_free_strict.cH A D14-Feb-20217.4 KiB366280

check_freeing_devm.cH A D14-Feb-20212.3 KiB8656

check_freeing_null.cH A D14-Feb-20211.3 KiB4826

check_frees_argument.cH A D14-Feb-20213.4 KiB145102

check_frees_param.cH A D14-Feb-20212.6 KiB10663

check_frees_param_strict.cH A D14-Feb-20213.9 KiB163112

check_get_user_overflow.cH A D14-Feb-20214.7 KiB189145

check_gfp_dma.cH A D14-Feb-20211.6 KiB5228

check_held_dev.cH A D14-Feb-20213.4 KiB13692

check_implicit_dependencies.cH A D14-Feb-20217.5 KiB310209

check_implicit_dependencies_tester.cH A D14-Feb-20214.2 KiB169109

check_impossible_mask.cH A D14-Feb-20212.6 KiB12383

check_indenting.cH A D14-Feb-20215.7 KiB238163

check_index_overflow.cH A D14-Feb-20218.1 KiB368250

check_info_leak.cH A D14-Feb-20212.4 KiB9565

check_input_free_device.cH A D14-Feb-20211.8 KiB7038

check_kernel.cH A D14-Feb-202113.1 KiB490371

check_kernel_printf.cH A D14-Feb-202153.1 KiB1,4881,156

check_kmalloc_to_bugon.cH A D14-Feb-20211.7 KiB6843

check_kmalloc_wrong_size.cH A D14-Feb-20212.5 KiB9663

check_kunmap.cH A D14-Feb-20212.3 KiB8859

check_leaks.cH A D14-Feb-20215.6 KiB271190

check_list.hH A D14-Feb-20215.6 KiB229203

check_locking.cH A D14-Feb-202140.3 KiB1,2941,091

check_logical_instead_of_bitwise.cH A D14-Feb-20211.7 KiB7342

check_macro_side_effects.cH A D14-Feb-20213.6 KiB171125

check_macros.cH A D14-Feb-20212.1 KiB7953

check_memcpy_overflow.cH A D14-Feb-20218.4 KiB373301

check_memset.cH A D14-Feb-20211.6 KiB6135

check_min_t.cH A D14-Feb-20211.4 KiB5731

check_missing_break.cH A D14-Feb-20214.2 KiB190120

check_mod_timer.cH A D14-Feb-20211.2 KiB4219

check_no_effect.cH A D14-Feb-20211.4 KiB5836

check_no_if_block.cH A D14-Feb-20211.5 KiB5936

check_no_return.cH A D14-Feb-20211.3 KiB5129

check_nospec.cH A D14-Feb-20216.6 KiB278213

check_off_by_one_relative.cH A D14-Feb-20213.3 KiB14398

check_or_vs_and.cH A D14-Feb-20214.6 KiB193143

check_param_mapper.cH A D14-Feb-20211.6 KiB7032

check_passes_sizeof.cH A D14-Feb-20212.5 KiB10370

check_platform_device_put.cH A D14-Feb-20212.1 KiB7142

check_pointer_math.cH A D14-Feb-20213.2 KiB13896

check_precedence.cH A D14-Feb-20213.4 KiB154115

check_proc_create.cH A D14-Feb-20211.8 KiB6136

check_puts_argument.cH A D14-Feb-20213.2 KiB13491

check_readl_infinite_loops.cH A D14-Feb-20213.6 KiB166122

check_release_resource.cH A D14-Feb-20212.4 KiB9154

check_resource_size.cH A D14-Feb-20212.3 KiB9059

check_return.cH A D14-Feb-20211.6 KiB6237

check_return_cast.cH A D14-Feb-20211.4 KiB5326

check_return_efault.cH A D14-Feb-20213.5 KiB13388

check_return_enomem.cH A D14-Feb-20212.1 KiB8145

check_return_negative_var.cH A D14-Feb-20211.4 KiB6033

check_rosenberg.cH A D14-Feb-20219.8 KiB435339

check_select.cH A D14-Feb-20211 KiB3817

check_shift_to_zero.cH A D14-Feb-20212.1 KiB9862

check_signed.cH A D14-Feb-20217.4 KiB312231

check_signed_integer_overflow_check.cH A D14-Feb-20212.5 KiB11269

check_sizeof.cH A D14-Feb-20213.8 KiB158115

check_snprintf.cH A D14-Feb-20212.2 KiB8859

check_snprintf_overflow.cH A D14-Feb-20212 KiB6442

check_spectre.cH A D14-Feb-20214.6 KiB217155

check_spectre_second_half.cH A D14-Feb-20212.9 KiB12682

check_sprintf_overflow.cH A D14-Feb-20211.7 KiB5836

check_stack.cH A D14-Feb-20212 KiB8652

check_strcpy_overflow.cH A D14-Feb-20211.8 KiB6334

check_string_len.cH A D14-Feb-20215.2 KiB269202

check_struct_type.cH A D14-Feb-20211.9 KiB6540

check_syscall_arg_type.cH A D14-Feb-20213.5 KiB170123

check_template.cH A D14-Feb-20213 KiB10953

check_test_bit.cH A D14-Feb-20211.6 KiB5530

check_testing_index_after_use.cH A D14-Feb-20213 KiB11679

check_trinity_generator.cH A D14-Feb-20212.4 KiB9960

check_type.cH A D14-Feb-20211.6 KiB6538

check_uninitialized.cH A D14-Feb-20219.1 KiB402303

check_unreachable.cH A D14-Feb-20216.4 KiB292217

check_unused_ret.cH A D14-Feb-20215.2 KiB220148

check_unwind.cH A D14-Feb-20216.8 KiB233173

check_wait_for_common.cH A D14-Feb-20211.2 KiB4219

check_wine.cH A D14-Feb-20211.2 KiB5020

check_wine_WtoA.cH A D14-Feb-20211.9 KiB9153

check_wine_filehandles.cH A D14-Feb-20212.3 KiB9757

check_wrong_size_arg.cH A D14-Feb-20212.3 KiB9564

check_zero_to_err_ptr.cH A D14-Feb-20214.2 KiB173131

compat-bsd.cH A D14-Feb-20211.3 KiB3710

compat-cygwin.cH A D14-Feb-20211.7 KiB5727

compat-linux.cH A D14-Feb-2021119 85

compat-mingw.cH A D14-Feb-20211.6 KiB5424

compat-solaris.cH A D14-Feb-2021685 3427

compat.hH A D14-Feb-2021685 277

compile-i386.cH A D14-Feb-202154.8 KiB2,3961,823

compile.cH A D14-Feb-20212.4 KiB8748

compile.hH A D14-Feb-2021199 117

cse.cH A D14-Feb-20218.2 KiB372273

cse.hH A D14-Feb-2021176 127

ctags.cH A D14-Feb-20215.6 KiB228176

dissect.cH A D14-Feb-202114.2 KiB614473

dissect.hH A D14-Feb-2021563 3020

dominate.cH A D14-Feb-20213.4 KiB154115

dominate.hH A D14-Feb-2021258 147

evaluate.cH A D14-Feb-202193.2 KiB3,7462,963

evaluate.hH A D14-Feb-2021721 2910

example.cH A D14-Feb-202144 KiB1,9581,546

expand.cH A D14-Feb-202131 KiB1,3741,070

expand.hH A D14-Feb-20211.5 KiB357

expression.cH A D14-Feb-202124.3 KiB913750

expression.hH A D14-Feb-20218.8 KiB336196

flow.cH A D14-Feb-202118.7 KiB818597

flow.hH A D14-Feb-20211.5 KiB5037

flowgraph.cH A D14-Feb-20214.7 KiB220152

flowgraph.hH A D14-Feb-2021266 149

gcc-attr-list.hH A D14-Feb-20214.4 KiB211210

gdbhelpersH A D14-Feb-20215.4 KiB308254

graph.cH A D14-Feb-20215.7 KiB207138

ident-list.hH A D14-Feb-20212.1 KiB8358

inline.cH A D14-Feb-202115.4 KiB584475

ir.cH A D14-Feb-20214 KiB207164

ir.hH A D14-Feb-2021101 95

lib.cH A D14-Feb-202139.5 KiB1,6591,319

lib.hH A D14-Feb-20219.1 KiB333255

linearize.cH A D14-Feb-202163.1 KiB2,5102,070

linearize.hH A D14-Feb-20217.8 KiB331275

liveness.cH A D14-Feb-20217.1 KiB331254

liveness.hH A D14-Feb-2021227 127

machine.hH A D14-Feb-20211.8 KiB8474

macro_table.cH A D14-Feb-20212.8 KiB9756

memops.cH A D14-Feb-20215 KiB214176

obfuscate.cH A D14-Feb-20212.2 KiB7742

opcode.cH A D14-Feb-20211.4 KiB3915

opcode.defH A D14-Feb-20215.8 KiB115100

opcode.hH A D14-Feb-2021649 3427

optimize.cH A D14-Feb-20212.4 KiB12673

optimize.hH A D14-Feb-2021122 105

parse.cH A D14-Feb-202185.4 KiB3,1152,576

parse.dtdH A D14-Feb-20211.6 KiB5245

parse.hH A D14-Feb-20214.5 KiB155114

pre-process.cH A D14-Feb-202156.3 KiB2,4131,944

ptrlist.cH A D14-Feb-202110.6 KiB506327

ptrlist.hH A D14-Feb-20218.7 KiB293215

ptrmap.cH A D14-Feb-20212.6 KiB11072

ptrmap.hH A D14-Feb-2021865 2923

scope.cH A D14-Feb-20213.6 KiB15098

scope.hH A D14-Feb-20212 KiB6329

show-parse.cH A D14-Feb-202128 KiB1,194977

simplify.cH A D14-Feb-202140.9 KiB1,8081,386

smatch.cH A D14-Feb-20218.5 KiB370288

smatch.hH A D14-Feb-202149.7 KiB1,4451,188

smatch_about_fn_ptr_arg.cH A D14-Feb-20215.2 KiB233173

smatch_address.cH A D14-Feb-20218.1 KiB349225

smatch_annotate.cH A D14-Feb-20211.5 KiB4816

smatch_array_values.cH A D14-Feb-20215.3 KiB225169

smatch_assigned_expr.cH A D14-Feb-20213.7 KiB155108

smatch_bits.cH A D14-Feb-202111.2 KiB478349

smatch_buf_comparison.cH A D14-Feb-202120.3 KiB854665

smatch_buf_size.cH A D14-Feb-202122.6 KiB985781

smatch_capped.cH A D14-Feb-20218.2 KiB351267

smatch_common_functions.cH A D14-Feb-20212.7 KiB9664

smatch_comparison.cH A D14-Feb-202165.6 KiB2,7972,256

smatch_conditions.cH A D14-Feb-202118.7 KiB755514

smatch_constraints.cH A D14-Feb-202112.4 KiB530390

smatch_constraints_required.cH A D14-Feb-202112.1 KiB495392

smatch_container_of.cH A D14-Feb-202114.3 KiB648506

smatch_data_source.cH A D14-Feb-20212.7 KiB12692

smatch_db.cH A D14-Feb-202167.1 KiB2,8202,279

smatch_equiv.cH A D14-Feb-20216.6 KiB276197

smatch_estate.cH A D14-Feb-202110.3 KiB483369

smatch_expression_stacks.cH A D14-Feb-20211.3 KiB4723

smatch_expression_stacks.hH A D14-Feb-2021276 54

smatch_expressions.cH A D14-Feb-20217 KiB334267

smatch_extra.cH A D14-Feb-202173.9 KiB2,9562,388

smatch_extra.hH A D14-Feb-202112.1 KiB243176

smatch_files.cH A D14-Feb-20211.5 KiB6440

smatch_flow.cH A D14-Feb-202146.5 KiB1,9451,603

smatch_fn_arg_link.cH A D14-Feb-20214.8 KiB213152

smatch_fresh_alloc.cH A D14-Feb-20215 KiB220158

smatch_function_hashtable.hH A D14-Feb-20213.8 KiB10978

smatch_function_hooks.cH A D14-Feb-202132.8 KiB1,3041,024

smatch_function_info.cH A D14-Feb-20211.1 KiB4518

smatch_function_ptrs.cH A D14-Feb-202110.2 KiB463358

smatch_helper.cH A D14-Feb-202126.2 KiB1,2711,031

smatch_hooks.cH A D14-Feb-20217.2 KiB287228

smatch_ignore.cH A D14-Feb-20212.6 KiB11581

smatch_imaginary_absolute.cH A D14-Feb-20212.2 KiB8540

smatch_implied.cH A D14-Feb-202133.5 KiB1,254942

smatch_impossible.cH A D14-Feb-20212.7 KiB11072

smatch_integer_overflow.cH A D14-Feb-20216.1 KiB293222

smatch_kernel_user_data.cH A D14-Feb-202136.8 KiB1,5401,192

smatch_links.cH A D14-Feb-20212.7 KiB11167

smatch_math.cH A D14-Feb-202145.5 KiB1,9201,526

smatch_mem_tracker.cH A D14-Feb-20211.8 KiB9158

smatch_modification_hooks.cH A D14-Feb-20216.8 KiB293210

smatch_mtag.cH A D14-Feb-202111.8 KiB475296

smatch_mtag_data.cH A D14-Feb-20217.2 KiB346254

smatch_mtag_map.cH A D14-Feb-20211.7 KiB6634

smatch_nul_terminator.cH A D14-Feb-20217.4 KiB328253

smatch_param_cleared.cH A D14-Feb-20215.4 KiB206138

smatch_param_compare_limit.cH A D14-Feb-20219.2 KiB375279

smatch_param_filter.cH A D14-Feb-20215.1 KiB220144

smatch_param_limit.cH A D14-Feb-20215.5 KiB212125

smatch_param_set.cH A D14-Feb-20217.4 KiB341249

smatch_param_to_mtag_data.cH A D14-Feb-20215.5 KiB222144

smatch_param_used.cH A D14-Feb-20212.8 KiB12583

smatch_parameter_names.cH A D14-Feb-20211.1 KiB4421

smatch_parse_call_math.cH A D14-Feb-202112.6 KiB646513

smatch_parsed_conditions.cH A D14-Feb-20213.1 KiB12263

smatch_passes_array_size.cH A D14-Feb-20212.1 KiB8861

smatch_project.cH A D14-Feb-20214.9 KiB219161

smatch_ranges.cH A D14-Feb-202152.3 KiB2,1621,763

smatch_real_absolute.cH A D14-Feb-20214 KiB15391

smatch_recurse.cH A D14-Feb-20214.1 KiB192155

smatch_return_to_param.cH A D14-Feb-20215.8 KiB240164

smatch_returns.cH A D14-Feb-20213.6 KiB13993

smatch_scope.cH A D14-Feb-20212.5 KiB11167

smatch_slist.cH A D14-Feb-202124.6 KiB1,092810

smatch_slist.hH A D14-Feb-20213.7 KiB10075

smatch_start_states.cH A D14-Feb-20211.6 KiB6835

smatch_statement_count.cH A D14-Feb-20212.1 KiB9055

smatch_states.cH A D14-Feb-202127.1 KiB1,239934

smatch_stored_conditions.cH A D14-Feb-20217.1 KiB324230

smatch_string_list.cH A D14-Feb-20211.8 KiB8556

smatch_strings.cH A D14-Feb-20213.7 KiB157109

smatch_strlen.cH A D14-Feb-20218.7 KiB364270

smatch_struct_assignment.cH A D14-Feb-202113.9 KiB585426

smatch_sval.cH A D14-Feb-202117.8 KiB881728

smatch_tracker.cH A D14-Feb-20212.4 KiB10672

smatch_type.cH A D14-Feb-202118.5 KiB908740

smatch_type_links.cH A D14-Feb-20212 KiB7524

smatch_type_val.cH A D14-Feb-202115.7 KiB689530

smatch_unknown_value.cH A D14-Feb-20211.9 KiB7339

smatch_untracked_param.cH A D14-Feb-20217.2 KiB314220

smatch_var_sym.cH A D14-Feb-20215 KiB243184

sort.cH A D14-Feb-20215.6 KiB291228

sparse-llvm-disH A D14-Feb-2021271 168

sparse-llvm.cH A D14-Feb-202131.6 KiB1,3721,109

sparse.1H A D14-Feb-202116.8 KiB495424

sparse.cH A D14-Feb-20218.3 KiB349272

sparsecH A D14-Feb-2021888 6246

sparseiH A D14-Feb-2021404 3224

ssa.cH A D14-Feb-20218.6 KiB403315

ssa.hH A D14-Feb-202198 95

sset.cH A D14-Feb-2021578 2916

sset.hH A D14-Feb-20211.1 KiB5736

stats.cH A D14-Feb-20211.7 KiB6350

storage.cH A D14-Feb-20217.4 KiB308243

storage.hH A D14-Feb-20211.7 KiB8059

symbol.cH A D14-Feb-202124.6 KiB832642

symbol.hH A D14-Feb-202114.5 KiB535418

target.cH A D14-Feb-20213.1 KiB164129

target.hH A D14-Feb-20211.5 KiB7745

test-dissect.cH A D14-Feb-20212.1 KiB9873

test-inspect.cH A D14-Feb-2021854 4436

test-lexing.cH A D14-Feb-20211.7 KiB5021

test-linearize.cH A D14-Feb-20212 KiB7038

test-parsing.cH A D14-Feb-20212.4 KiB9250

test-sort.cH A D14-Feb-2021852 4738

test-unssa.cH A D14-Feb-20211.7 KiB9072

token.hH A D14-Feb-20216.7 KiB257183

token_store.cH A D14-Feb-20213.8 KiB178127

tokenize.cH A D14-Feb-202123 KiB1,033848

unssa.cH A D14-Feb-20213.5 KiB14379

utils.cH A D14-Feb-2021715 4834

utils.hH A D14-Feb-20211.2 KiB449

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