Sym.inl 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. #pragma once
  6. ///----------------------------------------------------------------------------
  7. ///
  8. /// Sym::IsStackSym
  9. ///
  10. ///----------------------------------------------------------------------------
  11. inline bool
  12. Sym::IsStackSym() const
  13. {
  14. return m_kind == SymKindStack;
  15. }
  16. ///----------------------------------------------------------------------------
  17. ///
  18. /// Sym::AsStackSym
  19. ///
  20. /// Use this symbol as a StackSym.
  21. ///
  22. ///----------------------------------------------------------------------------
  23. inline StackSym *
  24. Sym::AsStackSym()
  25. {
  26. AssertMsg(this->IsStackSym(), "Bad call to AsStackSym()");
  27. return reinterpret_cast<StackSym *>(this);
  28. }
  29. inline StackSym const *
  30. Sym::AsStackSym() const
  31. {
  32. AssertMsg(this->IsStackSym(), "Bad call to AsStackSym() const");
  33. return reinterpret_cast<StackSym const *>(this);
  34. }
  35. ///----------------------------------------------------------------------------
  36. ///
  37. /// Sym::IsStackSym
  38. ///
  39. ///----------------------------------------------------------------------------
  40. inline bool
  41. Sym::IsPropertySym() const
  42. {
  43. return m_kind == SymKindProperty;
  44. }
  45. ///----------------------------------------------------------------------------
  46. ///
  47. /// Sym::AsPropertySym
  48. ///
  49. /// Use this symbol as a PropertySym.
  50. ///
  51. ///----------------------------------------------------------------------------
  52. inline PropertySym *
  53. Sym::AsPropertySym()
  54. {
  55. AssertMsg(this->IsPropertySym(), "Bad call to AsPropertySym()");
  56. return reinterpret_cast<PropertySym *>(this);
  57. }
  58. inline PropertySym const *
  59. Sym::AsPropertySym() const
  60. {
  61. AssertMsg(this->IsPropertySym(), "Bad call to AsPropertySym() const");
  62. return reinterpret_cast<PropertySym const *>(this);
  63. }
  64. ///----------------------------------------------------------------------------
  65. ///
  66. /// Sym::IsArgSlotSym
  67. ///
  68. ///----------------------------------------------------------------------------
  69. inline bool
  70. StackSym::IsArgSlotSym() const
  71. {
  72. if(m_isArgSlotSym)
  73. {
  74. Assert(this->m_slotNum != 0);
  75. }
  76. return m_isArgSlotSym;
  77. }
  78. ///----------------------------------------------------------------------------
  79. ///
  80. /// Sym::IsParamSlotSym
  81. ///
  82. ///----------------------------------------------------------------------------
  83. inline bool
  84. StackSym::IsParamSlotSym() const
  85. {
  86. return m_isParamSym;
  87. }
  88. ///----------------------------------------------------------------------------
  89. ///
  90. /// Sym::IsAllocated
  91. ///
  92. ///----------------------------------------------------------------------------
  93. inline bool
  94. StackSym::IsAllocated() const
  95. {
  96. return m_allocated;
  97. }