Sym.inl 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. ///----------------------------------------------------------------------------
  30. ///
  31. /// Sym::IsStackSym
  32. ///
  33. ///----------------------------------------------------------------------------
  34. inline bool
  35. Sym::IsPropertySym() const
  36. {
  37. return m_kind == SymKindProperty;
  38. }
  39. ///----------------------------------------------------------------------------
  40. ///
  41. /// Sym::AsPropertySym
  42. ///
  43. /// Use this symbol as a PropertySym.
  44. ///
  45. ///----------------------------------------------------------------------------
  46. inline PropertySym *
  47. Sym::AsPropertySym()
  48. {
  49. AssertMsg(this->IsPropertySym(), "Bad call to AsPropertySym()");
  50. return reinterpret_cast<PropertySym *>(this);
  51. }
  52. ///----------------------------------------------------------------------------
  53. ///
  54. /// Sym::IsArgSlotSym
  55. ///
  56. ///----------------------------------------------------------------------------
  57. inline bool
  58. StackSym::IsArgSlotSym() const
  59. {
  60. if(m_isArgSlotSym)
  61. {
  62. Assert(this->m_argSlotNum != 0);
  63. }
  64. return m_isArgSlotSym;
  65. }
  66. ///----------------------------------------------------------------------------
  67. ///
  68. /// Sym::IsParamSlotSym
  69. ///
  70. ///----------------------------------------------------------------------------
  71. inline bool
  72. StackSym::IsParamSlotSym() const
  73. {
  74. return m_paramSlotNum != InvalidSlot;
  75. }
  76. ///----------------------------------------------------------------------------
  77. ///
  78. /// Sym::IsAllocated
  79. ///
  80. ///----------------------------------------------------------------------------
  81. inline bool
  82. StackSym::IsAllocated() const
  83. {
  84. return m_allocated;
  85. }