2 * Example trivial client program that uses the sparse library
5 * Copyright (C) 2003 Transmeta Corp.
7 * Copyright 2003 Jeff Garzik
9 * Licensed under the Open Software License version 1.1
25 #include "expression.h"
28 static void clean_up_symbols(struct symbol_list
*list
)
32 FOR_EACH_PTR(list
, sym
) {
35 } END_FOR_EACH_PTR(sym
);
38 int main(int argc
, char **argv
)
41 struct string_list
*filelist
= NULL
;
43 clean_up_symbols(sparse_initialize(argc
, argv
, &filelist
));
44 FOR_EACH_PTR_NOTAG(filelist
, file
) {
45 struct symbol_list
*list
;
46 const char *basename
= strrchr(file
, '/');
47 basename
= basename
? basename
+1 : file
;
51 // Do type evaluation and simplification
52 emit_unit_begin(basename
);
53 clean_up_symbols(list
);
55 } END_FOR_EACH_PTR_NOTAG(file
);
58 // And show the allocation statistics
62 show_expression_alloc();
63 show_statement_alloc();