StackFrame.h 1.4 KB

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