Print this page
11972 resync smatch

Split Close
Expand all
Collapse all
          --- old/usr/src/tools/smatch/src/test-unssa.c
          +++ new/usr/src/tools/smatch/src/test-unssa.c
↓ open down ↓ 4 lines elided ↑ open up ↑
   5    5  #include "expression.h"
   6    6  #include "linearize.h"
   7    7  #include "flow.h"
   8    8  
   9    9  
  10   10  static void output_bb(struct basic_block *bb, unsigned long generation)
  11   11  {
  12   12          struct instruction *insn;
  13   13  
  14   14          bb->generation = generation;
  15      -        printf(".L%u\n", bb->nr);
       15 +        printf("%s\n", show_label(bb));
  16   16  
  17   17          FOR_EACH_PTR(bb->insns, insn) {
  18   18                  if (!insn->bb)
  19   19                          continue;
  20   20                  printf("\t%s\n", show_instruction(insn));
  21   21          }
  22   22          END_FOR_EACH_PTR(insn);
  23   23  
  24   24          printf("\n");
  25   25  }
↓ open down ↓ 29 lines elided ↑ open up ↑
  55   55          return 0;
  56   56  }
  57   57  
  58   58  static int compile(struct symbol_list *list)
  59   59  {
  60   60          struct symbol *sym;
  61   61          FOR_EACH_PTR(list, sym) {
  62   62                  struct entrypoint *ep;
  63   63                  expand_symbol(sym);
  64   64                  ep = linearize_symbol(sym);
       65 +                if (!(fdump_ir & PASS_FINAL))
       66 +                        continue;
  65   67                  if (ep)
  66   68                          output_fn(ep);
  67   69                  else
  68   70                          output_data(sym);
  69   71          }
  70   72          END_FOR_EACH_PTR(sym);
  71   73  
  72   74          return 0;
  73   75  }
  74   76  
  75   77  int main(int argc, char **argv)
  76   78  {
  77   79          struct string_list * filelist = NULL;
  78   80          char *file;
  79   81  
  80   82          compile(sparse_initialize(argc, argv, &filelist));
  81      -        FOR_EACH_PTR_NOTAG(filelist, file) {
       83 +        FOR_EACH_PTR(filelist, file) {
  82   84                  compile(sparse(file));
  83      -        } END_FOR_EACH_PTR_NOTAG(file);
       85 +        } END_FOR_EACH_PTR(file);
  84   86  
  85   87          report_stats();
  86   88          return 0;
  87   89  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX