Once again, remember that basic blocks may not have any instructions.
[smatch.git] / obfuscate.c
blobaa1a32fdbc3db05820a02cc8c291934ca1cdf342
1 /*
2 * Example trivial client program that uses the sparse library
3 * to tokenize, pre-process and parse a C file, and prints out
4 * the results.
6 * Copyright (C) 2003 Transmeta Corp.
7 * 2003-2004 Linus Torvalds
9 * Licensed under the Open Software License version 1.1
11 #include <stdarg.h>
12 #include <stdlib.h>
13 #include <stdio.h>
14 #include <string.h>
15 #include <ctype.h>
16 #include <unistd.h>
17 #include <fcntl.h>
19 #include "lib.h"
20 #include "token.h"
21 #include "parse.h"
22 #include "symbol.h"
23 #include "expression.h"
24 #include "linearize.h"
26 static void emit_entrypoint(struct entrypoint *ep)
31 static void emit_symbol(struct symbol *sym)
33 struct entrypoint *ep;
34 ep = linearize_symbol(sym);
35 if (ep)
36 emit_entrypoint(ep);
39 static void emit_symbol_list(struct symbol_list *list)
41 struct symbol *sym;
43 FOR_EACH_PTR(list, sym) {
44 expand_symbol(sym);
45 emit_symbol(sym);
46 } END_FOR_EACH_PTR(sym);
49 int main(int argc, char **argv)
51 emit_symbol_list(sparse(argc, argv));
52 return 0;