Rename "register.c" into "liveness.c". That's what it does.
[smatch.git] / compile.c
blobedbd44b49d573cb72e3a679633bac381af37306b
1 /*
2 * Example trivial client program that uses the sparse library
3 * and x86 backend.
5 * Copyright (C) 2003 Transmeta Corp.
6 * 2003 Linus Torvalds
7 * Copyright 2003 Jeff Garzik
9 * Licensed under the Open Software License version 1.1
12 #include <stdarg.h>
13 #include <stdlib.h>
14 #include <stdio.h>
15 #include <string.h>
16 #include <ctype.h>
17 #include <unistd.h>
18 #include <fcntl.h>
20 #include "lib.h"
21 #include "token.h"
22 #include "parse.h"
23 #include "symbol.h"
24 #include "expression.h"
25 #include "compile.h"
27 static void clean_up_symbols(struct symbol_list *list)
29 struct symbol *sym;
31 FOR_EACH_PTR(list, sym) {
32 expand_symbol(sym);
33 emit_one_symbol(sym);
34 } END_FOR_EACH_PTR(sym);
37 int main(int argc, char **argv)
39 const char *basename, *filename;
40 struct symbol_list *list;
42 list = sparse(argc, argv);
44 filename = input_streams[1].name;
45 basename = strrchr(filename, '/');
46 if (basename)
47 filename = basename+1;
49 // Do type evaluation and simplification
50 emit_unit_begin(filename);
51 clean_up_symbols(list);
52 emit_unit_end();
54 #if 0
55 // And show the allocation statistics
56 show_ident_alloc();
57 show_token_alloc();
58 show_symbol_alloc();
59 show_expression_alloc();
60 show_statement_alloc();
61 show_string_alloc();
62 show_bytes_alloc();
63 #endif
64 return 0;