Branch: Tag:

2004-03-15

2004-03-15 15:24:29 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Cleaned up handling of COMPILATION_FORCE_RESOLVE.

Rev: src/language.yacc:1.316
Rev: src/las.c:1.325
Rev: src/program.h:1.180

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: program.h,v 1.179 2004/03/13 13:22:40 grubba Exp $ + || $Id: program.h,v 1.180 2004/03/15 15:24:29 grubba Exp $   */      #ifndef PROGRAM_H
31:    /* This flag is set when resolve functions should force the lookup so    * that we don't get a placeholder back. Used for inherits. */   #define COMPILATION_FORCE_RESOLVE 0x02 + /* #define FORCE_RESOLVE_DEBUG */ + /* Helper macros for force_resolve */ + #ifdef FORCE_RESOLVE_DEBUG + #define DO_IF_FRD(X) X + #else /* !FORCE_RESOLVE_DEBUG */ + #define DO_IF_FRD(X) + #endif /* FORCE_RESOLVE_DEBUG */ + #define SET_FORCE_RESOLVE(OLD) do { \ +  int tmp_ = (OLD) = Pike_compiler->flags; \ +  Pike_compiler->flags |= COMPILATION_FORCE_RESOLVE; \ +  DO_IF_FRD(fprintf(stderr, \ +  "Force resolve on. Flags:0x%04x (0x%04x)\n", \ +  Pike_compiler->flags, tmp_)); \ +  } while(0) + #define UNSET_FORCE_RESOLVE(OLD) do { \ +  int tmp_ = (Pike_compiler->flags & ~COMPILATION_FORCE_RESOLVE) | \ +  ((OLD) & COMPILATION_FORCE_RESOLVE); \ +  DO_IF_FRD(fprintf(stderr, \ +  "Force resolve unset. Flags:0x%04x (0x%04x)\n", \ +  tmp_, Pike_compiler->flags)); \ +  Pike_compiler->flags = tmp_; \ +  } while(0)      extern struct pike_string *this_program_string;