Metadata.def 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. //===- llvm/IR/Metadata.def - Metadata definitions --------------*- C++ -*-===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. //
  9. // Macros for running through all types of metadata.
  10. //
  11. //===----------------------------------------------------------------------===//
  12. #if !(defined HANDLE_METADATA || defined HANDLE_METADATA_LEAF || \
  13. defined HANDLE_METADATA_BRANCH || defined HANDLE_MDNODE_LEAF || \
  14. defined HANDLE_MDNODE_LEAF_UNIQUABLE || defined HANDLE_MDNODE_BRANCH || \
  15. defined HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE || \
  16. defined HANDLE_SPECIALIZED_MDNODE_LEAF || \
  17. defined HANDLE_SPECIALIZED_MDNODE_BRANCH)
  18. #error "Missing macro definition of HANDLE_METADATA*"
  19. #endif
  20. // Handler for all types of metadata.
  21. #ifndef HANDLE_METADATA
  22. #define HANDLE_METADATA(CLASS)
  23. #endif
  24. // Handler for leaf nodes in the class hierarchy.
  25. #ifndef HANDLE_METADATA_LEAF
  26. #define HANDLE_METADATA_LEAF(CLASS) HANDLE_METADATA(CLASS)
  27. #endif
  28. // Handler for non-leaf nodes in the class hierarchy.
  29. #ifndef HANDLE_METADATA_BRANCH
  30. #define HANDLE_METADATA_BRANCH(CLASS) HANDLE_METADATA(CLASS)
  31. #endif
  32. // Handler for specialized and uniquable leaf nodes under MDNode. Defers to
  33. // HANDLE_MDNODE_LEAF_UNIQUABLE if it's defined, otherwise to
  34. // HANDLE_SPECIALIZED_MDNODE_LEAF.
  35. #ifndef HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE
  36. #ifdef HANDLE_MDNODE_LEAF_UNIQUABLE
  37. #define HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(CLASS) \
  38. HANDLE_MDNODE_LEAF_UNIQUABLE(CLASS)
  39. #else
  40. #define HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(CLASS) \
  41. HANDLE_SPECIALIZED_MDNODE_LEAF(CLASS)
  42. #endif
  43. #endif
  44. // Handler for leaf nodes under MDNode.
  45. #ifndef HANDLE_MDNODE_LEAF_UNIQUABLE
  46. #define HANDLE_MDNODE_LEAF_UNIQUABLE(CLASS) HANDLE_MDNODE_LEAF(CLASS)
  47. #endif
  48. // Handler for leaf nodes under MDNode.
  49. #ifndef HANDLE_MDNODE_LEAF
  50. #define HANDLE_MDNODE_LEAF(CLASS) HANDLE_METADATA_LEAF(CLASS)
  51. #endif
  52. // Handler for non-leaf nodes under MDNode.
  53. #ifndef HANDLE_MDNODE_BRANCH
  54. #define HANDLE_MDNODE_BRANCH(CLASS) HANDLE_METADATA_BRANCH(CLASS)
  55. #endif
  56. // Handler for specialized leaf nodes under MDNode.
  57. #ifndef HANDLE_SPECIALIZED_MDNODE_LEAF
  58. #define HANDLE_SPECIALIZED_MDNODE_LEAF(CLASS) HANDLE_MDNODE_LEAF(CLASS)
  59. #endif
  60. // Handler for specialized non-leaf nodes under MDNode.
  61. #ifndef HANDLE_SPECIALIZED_MDNODE_BRANCH
  62. #define HANDLE_SPECIALIZED_MDNODE_BRANCH(CLASS) HANDLE_MDNODE_BRANCH(CLASS)
  63. #endif
  64. HANDLE_METADATA_LEAF(MDString)
  65. HANDLE_METADATA_BRANCH(ValueAsMetadata)
  66. HANDLE_METADATA_LEAF(ConstantAsMetadata)
  67. HANDLE_METADATA_LEAF(LocalAsMetadata)
  68. HANDLE_METADATA_LEAF(DistinctMDOperandPlaceholder)
  69. HANDLE_MDNODE_BRANCH(MDNode)
  70. HANDLE_MDNODE_LEAF_UNIQUABLE(MDTuple)
  71. HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DILocation)
  72. HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DIExpression)
  73. HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DIGlobalVariableExpression)
  74. HANDLE_SPECIALIZED_MDNODE_BRANCH(DINode)
  75. HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(GenericDINode)
  76. HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DISubrange)
  77. HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DIEnumerator)
  78. HANDLE_SPECIALIZED_MDNODE_BRANCH(DIScope)
  79. HANDLE_SPECIALIZED_MDNODE_BRANCH(DIType)
  80. HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DIBasicType)
  81. HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DIDerivedType)
  82. HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DICompositeType)
  83. HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DISubroutineType)
  84. HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DIFile)
  85. HANDLE_SPECIALIZED_MDNODE_LEAF(DICompileUnit)
  86. HANDLE_SPECIALIZED_MDNODE_BRANCH(DILocalScope)
  87. HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DISubprogram)
  88. HANDLE_SPECIALIZED_MDNODE_BRANCH(DILexicalBlockBase)
  89. HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DILexicalBlock)
  90. HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DILexicalBlockFile)
  91. HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DINamespace)
  92. HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DIModule)
  93. HANDLE_SPECIALIZED_MDNODE_BRANCH(DITemplateParameter)
  94. HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DITemplateTypeParameter)
  95. HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DITemplateValueParameter)
  96. HANDLE_SPECIALIZED_MDNODE_BRANCH(DIVariable)
  97. HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DIGlobalVariable)
  98. HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DILocalVariable)
  99. HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DILabel)
  100. HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DIObjCProperty)
  101. HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DIImportedEntity)
  102. HANDLE_SPECIALIZED_MDNODE_LEAF(DIAssignID)
  103. HANDLE_SPECIALIZED_MDNODE_BRANCH(DIMacroNode)
  104. HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DIMacro)
  105. HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DIMacroFile)
  106. HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DICommonBlock)
  107. HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DIArgList)
  108. HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DIStringType)
  109. HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DIGenericSubrange)
  110. #undef HANDLE_METADATA
  111. #undef HANDLE_METADATA_LEAF
  112. #undef HANDLE_METADATA_BRANCH
  113. #undef HANDLE_MDNODE_LEAF
  114. #undef HANDLE_MDNODE_LEAF_UNIQUABLE
  115. #undef HANDLE_MDNODE_BRANCH
  116. #undef HANDLE_SPECIALIZED_MDNODE_LEAF
  117. #undef HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE
  118. #undef HANDLE_SPECIALIZED_MDNODE_BRANCH