ud_defs.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. /* U S E - D E F I N I T I O N A N A L Y S I S
  7. *
  8. * U D _ D E F S . H
  9. */
  10. extern short nrdefs; /* total number of definitions */
  11. extern short nrexpldefs; /* number of explicit definitions */
  12. extern line_p *defs; /* map of explicit definitions */
  13. extern cset *vardefs; /* set of explicit defs. of all variables */
  14. void make_defs(proc_p p);
  15. /* Compute defs[], vardefs[]
  16. * and CHGVARS(b) (for every b).
  17. */
  18. void gen_sets(proc_p p);
  19. /* Compute GEN(b) (for every b).
  20. */
  21. void kill_sets(proc_p p);
  22. /*Compute KILL(b) (for every b).
  23. */
  24. bool does_expl_def(line_p l);
  25. /* See if instruction l does an explicit
  26. * definition (e.g. a STL).
  27. */
  28. bool does_impl_def(line_p l);
  29. /* See if instruction l does an implicit
  30. * definition (e.g. a CAL).
  31. */
  32. /* Two kinds of definitions exist:
  33. * - an explicit definition is an assignment to a single
  34. * variable (e.g. a STL, STE, INE).
  35. * - an implicit definition is an assignment to a variable
  36. * performed via a subroutine call or an
  37. * indirect assignment (through a pointer).
  38. * Every explicit definition has an 'explicit definition number',
  39. * which is its index in the 'defs' table.
  40. * Every implicit definition has an 'implicit definition number',
  41. * which is the 'variable number' of the changed variable.
  42. * Every such definition also has a 'definition number'.
  43. * Conversions exist between these numbers.
  44. */
  45. #define TO_EXPLICIT(defnr) (defnr - nrvars)
  46. #define TO_IMPLICIT(defnr) (defnr)
  47. #define EXPL_TO_DEFNR(explnr) (explnr + nrvars)
  48. #define IMPL_TO_DEFNR(implnr) (implnr)
  49. #define IMPLICIT_DEF(v) (v)
  50. #define IMPL_VAR(defnr) (defnr)
  51. #define IS_IMPL_DEF(defnr) (defnr <= nrvars)