Print this page
11972 resync smatch


  30 #include <unistd.h>
  31 #include <fcntl.h>
  32 
  33 #include "lib.h"
  34 #include "allocate.h"
  35 #include "token.h"
  36 #include "parse.h"
  37 #include "symbol.h"
  38 #include "expression.h"
  39 #include "linearize.h"
  40 
  41 static void clean_up_symbols(struct symbol_list *list)
  42 {
  43         struct symbol *sym;
  44 
  45         FOR_EACH_PTR(list, sym) {
  46                 struct entrypoint *ep;
  47 
  48                 expand_symbol(sym);
  49                 ep = linearize_symbol(sym);


  50                 if (ep)
  51                         show_entry(ep);
  52         } END_FOR_EACH_PTR(sym);
  53 }
  54 
  55 int main(int argc, char **argv)
  56 {
  57         struct string_list *filelist = NULL;
  58         char *file;
  59 
  60         clean_up_symbols(sparse_initialize(argc, argv, &filelist));
  61         FOR_EACH_PTR_NOTAG(filelist, file) {
  62                 clean_up_symbols(sparse(file));
  63         } END_FOR_EACH_PTR_NOTAG(file);
  64 
  65         report_stats();
  66         return 0;
  67 }


  30 #include <unistd.h>
  31 #include <fcntl.h>
  32 
  33 #include "lib.h"
  34 #include "allocate.h"
  35 #include "token.h"
  36 #include "parse.h"
  37 #include "symbol.h"
  38 #include "expression.h"
  39 #include "linearize.h"
  40 
  41 static void clean_up_symbols(struct symbol_list *list)
  42 {
  43         struct symbol *sym;
  44 
  45         FOR_EACH_PTR(list, sym) {
  46                 struct entrypoint *ep;
  47 
  48                 expand_symbol(sym);
  49                 ep = linearize_symbol(sym);
  50                 if (!(fdump_ir & PASS_FINAL))
  51                         continue;
  52                 if (ep)
  53                         show_entry(ep);
  54         } END_FOR_EACH_PTR(sym);
  55 }
  56 
  57 int main(int argc, char **argv)
  58 {
  59         struct string_list *filelist = NULL;
  60         char *file;
  61 
  62         clean_up_symbols(sparse_initialize(argc, argv, &filelist));
  63         FOR_EACH_PTR(filelist, file) {
  64                 clean_up_symbols(sparse(file));
  65         } END_FOR_EACH_PTR(file);
  66 
  67         report_stats();
  68         return 0;
  69 }