IPDBRawSymbol.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- IPDBRawSymbol.h - base interface for PDB symbol types ----*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #ifndef LLVM_DEBUGINFO_PDB_IPDBRAWSYMBOL_H
  14. #define LLVM_DEBUGINFO_PDB_IPDBRAWSYMBOL_H
  15. #include "PDBTypes.h"
  16. #include "llvm/ADT/BitmaskEnum.h"
  17. #include "llvm/ADT/SmallVector.h"
  18. #include "llvm/DebugInfo/CodeView/CodeView.h"
  19. #include <memory>
  20. namespace llvm {
  21. class raw_ostream;
  22. class StringRef;
  23. namespace pdb {
  24. enum class PdbSymbolIdField : uint32_t {
  25. None = 0,
  26. SymIndexId = 1 << 0,
  27. LexicalParent = 1 << 1,
  28. ClassParent = 1 << 2,
  29. Type = 1 << 3,
  30. UnmodifiedType = 1 << 4,
  31. All = 0xFFFFFFFF,
  32. LLVM_MARK_AS_BITMASK_ENUM(/* LargestValue = */ All)
  33. };
  34. void dumpSymbolIdField(raw_ostream &OS, StringRef Name, SymIndexId Value,
  35. int Indent, const IPDBSession &Session,
  36. PdbSymbolIdField FieldId, PdbSymbolIdField ShowFlags,
  37. PdbSymbolIdField RecurseFlags);
  38. /// IPDBRawSymbol defines an interface used to represent an arbitrary symbol.
  39. /// It exposes a monolithic interface consisting of accessors for the union of
  40. /// all properties that are valid for any symbol type. This interface is then
  41. /// wrapped by a concrete class which exposes only those set of methods valid
  42. /// for this particular symbol type. See PDBSymbol.h for more details.
  43. class IPDBRawSymbol {
  44. public:
  45. virtual ~IPDBRawSymbol();
  46. virtual void dump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowIdFields,
  47. PdbSymbolIdField RecurseIdFields) const = 0;
  48. virtual std::unique_ptr<IPDBEnumSymbols>
  49. findChildren(PDB_SymType Type) const = 0;
  50. virtual std::unique_ptr<IPDBEnumSymbols>
  51. findChildren(PDB_SymType Type, StringRef Name,
  52. PDB_NameSearchFlags Flags) const = 0;
  53. virtual std::unique_ptr<IPDBEnumSymbols>
  54. findChildrenByAddr(PDB_SymType Type, StringRef Name,
  55. PDB_NameSearchFlags Flags,
  56. uint32_t Section, uint32_t Offset) const = 0;
  57. virtual std::unique_ptr<IPDBEnumSymbols>
  58. findChildrenByVA(PDB_SymType Type, StringRef Name, PDB_NameSearchFlags Flags,
  59. uint64_t VA) const = 0;
  60. virtual std::unique_ptr<IPDBEnumSymbols>
  61. findChildrenByRVA(PDB_SymType Type, StringRef Name, PDB_NameSearchFlags Flags,
  62. uint32_t RVA) const = 0;
  63. virtual std::unique_ptr<IPDBEnumSymbols>
  64. findInlineFramesByAddr(uint32_t Section, uint32_t Offset) const = 0;
  65. virtual std::unique_ptr<IPDBEnumSymbols>
  66. findInlineFramesByRVA(uint32_t RVA) const = 0;
  67. virtual std::unique_ptr<IPDBEnumSymbols>
  68. findInlineFramesByVA(uint64_t VA) const = 0;
  69. virtual std::unique_ptr<IPDBEnumLineNumbers> findInlineeLines() const = 0;
  70. virtual std::unique_ptr<IPDBEnumLineNumbers>
  71. findInlineeLinesByAddr(uint32_t Section, uint32_t Offset,
  72. uint32_t Length) const = 0;
  73. virtual std::unique_ptr<IPDBEnumLineNumbers>
  74. findInlineeLinesByRVA(uint32_t RVA, uint32_t Length) const = 0;
  75. virtual std::unique_ptr<IPDBEnumLineNumbers>
  76. findInlineeLinesByVA(uint64_t VA, uint32_t Length) const = 0;
  77. virtual void getDataBytes(llvm::SmallVector<uint8_t, 32> &bytes) const = 0;
  78. virtual void getBackEndVersion(VersionInfo &Version) const = 0;
  79. virtual PDB_MemberAccess getAccess() const = 0;
  80. virtual uint32_t getAddressOffset() const = 0;
  81. virtual uint32_t getAddressSection() const = 0;
  82. virtual uint32_t getAge() const = 0;
  83. virtual SymIndexId getArrayIndexTypeId() const = 0;
  84. virtual uint32_t getBaseDataOffset() const = 0;
  85. virtual uint32_t getBaseDataSlot() const = 0;
  86. virtual SymIndexId getBaseSymbolId() const = 0;
  87. virtual PDB_BuiltinType getBuiltinType() const = 0;
  88. virtual uint32_t getBitPosition() const = 0;
  89. virtual PDB_CallingConv getCallingConvention() const = 0;
  90. virtual SymIndexId getClassParentId() const = 0;
  91. virtual std::string getCompilerName() const = 0;
  92. virtual uint32_t getCount() const = 0;
  93. virtual uint32_t getCountLiveRanges() const = 0;
  94. virtual void getFrontEndVersion(VersionInfo &Version) const = 0;
  95. virtual PDB_Lang getLanguage() const = 0;
  96. virtual SymIndexId getLexicalParentId() const = 0;
  97. virtual std::string getLibraryName() const = 0;
  98. virtual uint32_t getLiveRangeStartAddressOffset() const = 0;
  99. virtual uint32_t getLiveRangeStartAddressSection() const = 0;
  100. virtual uint32_t getLiveRangeStartRelativeVirtualAddress() const = 0;
  101. virtual codeview::RegisterId getLocalBasePointerRegisterId() const = 0;
  102. virtual SymIndexId getLowerBoundId() const = 0;
  103. virtual uint32_t getMemorySpaceKind() const = 0;
  104. virtual std::string getName() const = 0;
  105. virtual uint32_t getNumberOfAcceleratorPointerTags() const = 0;
  106. virtual uint32_t getNumberOfColumns() const = 0;
  107. virtual uint32_t getNumberOfModifiers() const = 0;
  108. virtual uint32_t getNumberOfRegisterIndices() const = 0;
  109. virtual uint32_t getNumberOfRows() const = 0;
  110. virtual std::string getObjectFileName() const = 0;
  111. virtual uint32_t getOemId() const = 0;
  112. virtual SymIndexId getOemSymbolId() const = 0;
  113. virtual uint32_t getOffsetInUdt() const = 0;
  114. virtual PDB_Cpu getPlatform() const = 0;
  115. virtual uint32_t getRank() const = 0;
  116. virtual codeview::RegisterId getRegisterId() const = 0;
  117. virtual uint32_t getRegisterType() const = 0;
  118. virtual uint32_t getRelativeVirtualAddress() const = 0;
  119. virtual uint32_t getSamplerSlot() const = 0;
  120. virtual uint32_t getSignature() const = 0;
  121. virtual uint32_t getSizeInUdt() const = 0;
  122. virtual uint32_t getSlot() const = 0;
  123. virtual std::string getSourceFileName() const = 0;
  124. virtual std::unique_ptr<IPDBLineNumber>
  125. getSrcLineOnTypeDefn() const = 0;
  126. virtual uint32_t getStride() const = 0;
  127. virtual SymIndexId getSubTypeId() const = 0;
  128. virtual std::string getSymbolsFileName() const = 0;
  129. virtual SymIndexId getSymIndexId() const = 0;
  130. virtual uint32_t getTargetOffset() const = 0;
  131. virtual uint32_t getTargetRelativeVirtualAddress() const = 0;
  132. virtual uint64_t getTargetVirtualAddress() const = 0;
  133. virtual uint32_t getTargetSection() const = 0;
  134. virtual uint32_t getTextureSlot() const = 0;
  135. virtual uint32_t getTimeStamp() const = 0;
  136. virtual uint32_t getToken() const = 0;
  137. virtual SymIndexId getTypeId() const = 0;
  138. virtual uint32_t getUavSlot() const = 0;
  139. virtual std::string getUndecoratedName() const = 0;
  140. virtual std::string getUndecoratedNameEx(PDB_UndnameFlags Flags) const = 0;
  141. virtual SymIndexId getUnmodifiedTypeId() const = 0;
  142. virtual SymIndexId getUpperBoundId() const = 0;
  143. virtual Variant getValue() const = 0;
  144. virtual uint32_t getVirtualBaseDispIndex() const = 0;
  145. virtual uint32_t getVirtualBaseOffset() const = 0;
  146. virtual std::unique_ptr<PDBSymbolTypeBuiltin>
  147. getVirtualBaseTableType() const = 0;
  148. virtual SymIndexId getVirtualTableShapeId() const = 0;
  149. virtual PDB_DataKind getDataKind() const = 0;
  150. virtual PDB_SymType getSymTag() const = 0;
  151. virtual codeview::GUID getGuid() const = 0;
  152. virtual int32_t getOffset() const = 0;
  153. virtual int32_t getThisAdjust() const = 0;
  154. virtual int32_t getVirtualBasePointerOffset() const = 0;
  155. virtual PDB_LocType getLocationType() const = 0;
  156. virtual PDB_Machine getMachineType() const = 0;
  157. virtual codeview::ThunkOrdinal getThunkOrdinal() const = 0;
  158. virtual uint64_t getLength() const = 0;
  159. virtual uint64_t getLiveRangeLength() const = 0;
  160. virtual uint64_t getVirtualAddress() const = 0;
  161. virtual PDB_UdtType getUdtKind() const = 0;
  162. virtual bool hasConstructor() const = 0;
  163. virtual bool hasCustomCallingConvention() const = 0;
  164. virtual bool hasFarReturn() const = 0;
  165. virtual bool isCode() const = 0;
  166. virtual bool isCompilerGenerated() const = 0;
  167. virtual bool isConstType() const = 0;
  168. virtual bool isEditAndContinueEnabled() const = 0;
  169. virtual bool isFunction() const = 0;
  170. virtual bool getAddressTaken() const = 0;
  171. virtual bool getNoStackOrdering() const = 0;
  172. virtual bool hasAlloca() const = 0;
  173. virtual bool hasAssignmentOperator() const = 0;
  174. virtual bool hasCTypes() const = 0;
  175. virtual bool hasCastOperator() const = 0;
  176. virtual bool hasDebugInfo() const = 0;
  177. virtual bool hasEH() const = 0;
  178. virtual bool hasEHa() const = 0;
  179. virtual bool hasFramePointer() const = 0;
  180. virtual bool hasInlAsm() const = 0;
  181. virtual bool hasInlineAttribute() const = 0;
  182. virtual bool hasInterruptReturn() const = 0;
  183. virtual bool hasLongJump() const = 0;
  184. virtual bool hasManagedCode() const = 0;
  185. virtual bool hasNestedTypes() const = 0;
  186. virtual bool hasNoInlineAttribute() const = 0;
  187. virtual bool hasNoReturnAttribute() const = 0;
  188. virtual bool hasOptimizedCodeDebugInfo() const = 0;
  189. virtual bool hasOverloadedOperator() const = 0;
  190. virtual bool hasSEH() const = 0;
  191. virtual bool hasSecurityChecks() const = 0;
  192. virtual bool hasSetJump() const = 0;
  193. virtual bool hasStrictGSCheck() const = 0;
  194. virtual bool isAcceleratorGroupSharedLocal() const = 0;
  195. virtual bool isAcceleratorPointerTagLiveRange() const = 0;
  196. virtual bool isAcceleratorStubFunction() const = 0;
  197. virtual bool isAggregated() const = 0;
  198. virtual bool isIntroVirtualFunction() const = 0;
  199. virtual bool isCVTCIL() const = 0;
  200. virtual bool isConstructorVirtualBase() const = 0;
  201. virtual bool isCxxReturnUdt() const = 0;
  202. virtual bool isDataAligned() const = 0;
  203. virtual bool isHLSLData() const = 0;
  204. virtual bool isHotpatchable() const = 0;
  205. virtual bool isIndirectVirtualBaseClass() const = 0;
  206. virtual bool isInterfaceUdt() const = 0;
  207. virtual bool isIntrinsic() const = 0;
  208. virtual bool isLTCG() const = 0;
  209. virtual bool isLocationControlFlowDependent() const = 0;
  210. virtual bool isMSILNetmodule() const = 0;
  211. virtual bool isMatrixRowMajor() const = 0;
  212. virtual bool isManagedCode() const = 0;
  213. virtual bool isMSILCode() const = 0;
  214. virtual bool isMultipleInheritance() const = 0;
  215. virtual bool isNaked() const = 0;
  216. virtual bool isNested() const = 0;
  217. virtual bool isOptimizedAway() const = 0;
  218. virtual bool isPacked() const = 0;
  219. virtual bool isPointerBasedOnSymbolValue() const = 0;
  220. virtual bool isPointerToDataMember() const = 0;
  221. virtual bool isPointerToMemberFunction() const = 0;
  222. virtual bool isPureVirtual() const = 0;
  223. virtual bool isRValueReference() const = 0;
  224. virtual bool isRefUdt() const = 0;
  225. virtual bool isReference() const = 0;
  226. virtual bool isRestrictedType() const = 0;
  227. virtual bool isReturnValue() const = 0;
  228. virtual bool isSafeBuffers() const = 0;
  229. virtual bool isScoped() const = 0;
  230. virtual bool isSdl() const = 0;
  231. virtual bool isSingleInheritance() const = 0;
  232. virtual bool isSplitted() const = 0;
  233. virtual bool isStatic() const = 0;
  234. virtual bool hasPrivateSymbols() const = 0;
  235. virtual bool isUnalignedType() const = 0;
  236. virtual bool isUnreached() const = 0;
  237. virtual bool isValueUdt() const = 0;
  238. virtual bool isVirtual() const = 0;
  239. virtual bool isVirtualBaseClass() const = 0;
  240. virtual bool isVirtualInheritance() const = 0;
  241. virtual bool isVolatileType() const = 0;
  242. virtual bool wasInlined() const = 0;
  243. virtual std::string getUnused() const = 0;
  244. };
  245. LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE();
  246. } // namespace pdb
  247. } // namespace llvm
  248. #endif
  249. #ifdef __GNUC__
  250. #pragma GCC diagnostic pop
  251. #endif