StackFrame.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #pragma once
  2. #include "types.h"
  3. #include "ast.h"
  4. #include "icode.h"
  5. #include "locident.h"
  6. #include "error.h"
  7. #include "graph.h"
  8. #include "bundle.h"
  9. /* STACK FRAME */
  10. struct STKSYM
  11. {
  12. COND_EXPR *actual; /* Expression tree of actual parameter */
  13. COND_EXPR *regs; /* For register arguments only */
  14. int16 off; /* Immediate off from BP (+:args, -:params) */
  15. byte regOff; /* Offset is a register (e.g. SI, DI) */
  16. Int size; /* Size */
  17. hlType type; /* Probable type */
  18. eDuVal duVal; /* DEF, USE, VAL */
  19. boolT hasMacro; /* This type needs a macro */
  20. char macro[10]; /* Macro name */
  21. char name[10]; /* Name for this symbol/argument */
  22. boolT invalid; /* Boolean: invalid entry in formal arg list*/
  23. STKSYM()
  24. {
  25. memset(this,0,sizeof(STKSYM));
  26. }
  27. };
  28. struct STKFRAME
  29. {
  30. std::vector<STKSYM> sym;
  31. //STKSYM * sym; /* Symbols */
  32. int16 m_minOff; /* Initial offset in stack frame*/
  33. int16 maxOff; /* Maximum offset in stack frame*/
  34. Int cb; /* Number of bytes in arguments */
  35. Int numArgs; /* No. of arguments in the table*/
  36. void adjustForArgType(Int numArg_, hlType actType_);
  37. STKFRAME() : sym(0),m_minOff(0),maxOff(0),cb(0),numArgs(0)
  38. {
  39. }
  40. Int getLocVar(Int off);
  41. };