pike.git / src / peep.c

version» Context lines:

pike.git/src/peep.c:828:       return entry_point;   }      /**** Peephole optimizer ****/      static void do_optimization(int topop, int topush, ...);   static inline int opcode(int offset);   static inline int argument(int offset);   static inline int argument2(int offset); + static inline unsigned int check_local_var_flag(int var, int flag);      #include "peep_engine.c"      #ifndef PEEP_STACK_SIZE   #define PEEP_STACK_SIZE 256   #endif      /* Stack holding pending instructions.    * Note that instructions must be pushed in reverse order.    */
pike.git/src/peep.c:945:   }      static inline int argument2(int offset)   {    p_instr *a;    a=instr(offset);    if(a) return a->arg2;    return -1;   }    + /* This is used from two peep.in rules, merely because coverity did not +  * like accessing ...->variables[arguments(1)], as arguments() could in theory +  * return a negative value. Neither very pretty nor generic... */ + static inline unsigned int check_local_var_flag(int var, int flag) + { +  if (var >= 0) +  return Pike_compiler->compiler_frame->variable[var].flags & flag; +  +  return 0; + } +  +    static int advance(void)   {    p_instr *p;    if(stack_depth)    {    p = instrstack + --stack_depth;    }else{    if (eye >= len) return 0;    p = instructions + eye;    eye++;