lv.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* $Id$ */
  2. /*
  3. * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
  4. * See the copyright notice in the ACK home directory, in the file "Copyright".
  5. */
  6. /* L I V E V A R I A B L E S A N A L Y S I S
  7. *
  8. * L V . H
  9. */
  10. #define USE(b) (b)->b_extend->bx_lv.bx_use
  11. #define DEF(b) (b)->b_extend->bx_lv.bx_def
  12. #define L_IN(b) (b)->b_extend->bx_lv.bx_lin
  13. #define L_OUT(b) (b)->b_extend->bx_lv.bx_lout
  14. extern short nrglobals; /* number of global variables for which
  15. * ud-info is maintained.
  16. */
  17. extern short nrvars; /* total number of variables (global + local)
  18. * for which ud-info is maintained.
  19. */
  20. /* Every global variable for which ud-info is maintained has
  21. * a 'global variable number' (o_globnr). Every useful local
  22. * has a 'local variable number', which is its index in the
  23. * 'locals' table. All these variables also have a
  24. * 'variable number'. Conversions exist between these numbers.
  25. */
  26. #define TO_GLOBAL(v) (v)
  27. #define TO_LOCAL(v) (v - nrglobals)
  28. #define GLOB_TO_VARNR(v) (v)
  29. #define LOC_TO_VARNR(v) (v + nrglobals)
  30. #define IS_GLOBAL(v) (v <= nrglobals)
  31. #define IS_LOCAL(v) (v > nrglobals)
  32. #define REGVAR(lc) lc->lc_flags |= LCF_REG
  33. #define IS_REGVAR(lc) (lc->lc_flags & LCF_REG)
  34. #define BADLC(lc) lc->lc_flags |= LCF_BAD
  35. #define IS_BADLC(lc) (lc->lc_flags & LCF_BAD)
  36. #define LIVE(lc) lc->lc_flags |= LCF_LIVE
  37. #define DEAD(lc) lc->lc_flags &= ~LCF_LIVE
  38. #define IS_LIVE(lc) (lc->lc_flags & LCF_LIVE)
  39. #define IS_DEAD(lc) (!(lc->lc_flags & LCF_LIVE))