XCOFF.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===-- llvm/BinaryFormat/XCOFF.h - The XCOFF file format -------*- 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. //
  14. // This file defines manifest constants for the XCOFF object file format.
  15. //
  16. //===----------------------------------------------------------------------===//
  17. #ifndef LLVM_BINARYFORMAT_XCOFF_H
  18. #define LLVM_BINARYFORMAT_XCOFF_H
  19. #include <stddef.h>
  20. #include <stdint.h>
  21. namespace llvm {
  22. class StringRef;
  23. template <unsigned> class SmallString;
  24. template <typename T> class Expected;
  25. namespace XCOFF {
  26. // Constants used in the XCOFF definition.
  27. constexpr size_t FileNamePadSize = 6;
  28. constexpr size_t NameSize = 8;
  29. constexpr size_t FileHeaderSize32 = 20;
  30. constexpr size_t FileHeaderSize64 = 24;
  31. constexpr size_t AuxFileHeaderSize32 = 72;
  32. constexpr size_t AuxFileHeaderSize64 = 110;
  33. constexpr size_t AuxFileHeaderSizeShort = 28;
  34. constexpr size_t SectionHeaderSize32 = 40;
  35. constexpr size_t SectionHeaderSize64 = 72;
  36. constexpr size_t SymbolTableEntrySize = 18;
  37. constexpr size_t RelocationSerializationSize32 = 10;
  38. constexpr size_t RelocationSerializationSize64 = 14;
  39. constexpr size_t ExceptionSectionEntrySize32 = 6;
  40. constexpr size_t ExceptionSectionEntrySize64 = 10;
  41. constexpr uint16_t RelocOverflow = 65535;
  42. constexpr uint8_t AllocRegNo = 31;
  43. enum ReservedSectionNum : int16_t { N_DEBUG = -2, N_ABS = -1, N_UNDEF = 0 };
  44. enum MagicNumber : uint16_t { XCOFF32 = 0x01DF, XCOFF64 = 0x01F7 };
  45. // Masks for packing/unpacking the r_rsize field of relocations.
  46. // The msb is used to indicate if the bits being relocated are signed or
  47. // unsigned.
  48. static constexpr uint8_t XR_SIGN_INDICATOR_MASK = 0x80;
  49. // The 2nd msb is used to indicate that the binder has replaced/modified the
  50. // original instruction.
  51. static constexpr uint8_t XR_FIXUP_INDICATOR_MASK = 0x40;
  52. // The remaining bits specify the bit length of the relocatable reference
  53. // minus one.
  54. static constexpr uint8_t XR_BIASED_LENGTH_MASK = 0x3f;
  55. // This field only exists in the XCOFF64 definition.
  56. enum AuxHeaderFlags64 : uint16_t {
  57. SHR_SYMTAB = 0x8000, ///< At exec time, create shared symbol table for program
  58. ///< (main program only).
  59. FORK_POLICY = 0x4000, ///< Forktree policy specified (main program only).
  60. FORK_COR = 0x2000 ///< If _AOUT_FORK_POLICY is set, specify copy-on-reference
  61. ///< if this bit is set. Specify copy-on- write otherwise.
  62. ///< If _AOUT_FORK_POLICY is 0, this bit is reserved for
  63. ///< future use and should be set to 0.
  64. };
  65. enum XCOFFInterpret : uint16_t {
  66. OLD_XCOFF_INTERPRET = 1,
  67. NEW_XCOFF_INTERPRET = 2
  68. };
  69. enum FileFlag : uint16_t {
  70. F_RELFLG = 0x0001, ///< relocation info stripped from file
  71. F_EXEC = 0x0002, ///< file is executable (i.e., it
  72. ///< has a loader section)
  73. F_LNNO = 0x0004, ///< line numbers stripped from file
  74. F_LSYMS = 0x0008, ///< local symbols stripped from file
  75. F_FDPR_PROF = 0x0010, ///< file was profiled with FDPR
  76. F_FDPR_OPTI = 0x0020, ///< file was reordered with FDPR
  77. F_DSA = 0x0040, ///< file uses Dynamic Segment Allocation (32-bit
  78. ///< only)
  79. F_DEP_1 = 0x0080, ///< Data Execution Protection bit 1
  80. F_VARPG = 0x0100, ///< executable requests using variable size pages
  81. F_LPTEXT = 0x0400, ///< executable requires large pages for text
  82. F_LPDATA = 0x0800, ///< executable requires large pages for data
  83. F_DYNLOAD = 0x1000, ///< file is dynamically loadable and
  84. ///< executable (equivalent to F_EXEC on AIX)
  85. F_SHROBJ = 0x2000, ///< file is a shared object
  86. F_LOADONLY =
  87. 0x4000, ///< file can be loaded by the system loader, but it is
  88. ///< ignored by the linker if it is a member of an archive.
  89. F_DEP_2 = 0x8000 ///< Data Execution Protection bit 2
  90. };
  91. // x_smclas field of x_csect from system header: /usr/include/syms.h
  92. /// Storage Mapping Class definitions.
  93. enum StorageMappingClass : uint8_t {
  94. // READ ONLY CLASSES
  95. XMC_PR = 0, ///< Program Code
  96. XMC_RO = 1, ///< Read Only Constant
  97. XMC_DB = 2, ///< Debug Dictionary Table
  98. XMC_GL = 6, ///< Global Linkage (Interfile Interface Code)
  99. XMC_XO = 7, ///< Extended Operation (Pseudo Machine Instruction)
  100. XMC_SV = 8, ///< Supervisor Call (32-bit process only)
  101. XMC_SV64 = 17, ///< Supervisor Call for 64-bit process
  102. XMC_SV3264 = 18, ///< Supervisor Call for both 32- and 64-bit processes
  103. XMC_TI = 12, ///< Traceback Index csect
  104. XMC_TB = 13, ///< Traceback Table csect
  105. // READ WRITE CLASSES
  106. XMC_RW = 5, ///< Read Write Data
  107. XMC_TC0 = 15, ///< TOC Anchor for TOC Addressability
  108. XMC_TC = 3, ///< General TOC item
  109. XMC_TD = 16, ///< Scalar data item in the TOC
  110. XMC_DS = 10, ///< Descriptor csect
  111. XMC_UA = 4, ///< Unclassified - Treated as Read Write
  112. XMC_BS = 9, ///< BSS class (uninitialized static internal)
  113. XMC_UC = 11, ///< Un-named Fortran Common
  114. XMC_TL = 20, ///< Initialized thread-local variable
  115. XMC_UL = 21, ///< Uninitialized thread-local variable
  116. XMC_TE = 22 ///< Symbol mapped at the end of TOC
  117. };
  118. // Flags for defining the section type. Masks for use with the (signed, 32-bit)
  119. // s_flags field of the section header structure, selecting for values in the
  120. // lower 16 bits. Defined in the system header `scnhdr.h`.
  121. enum SectionTypeFlags : int32_t {
  122. STYP_PAD = 0x0008,
  123. STYP_DWARF = 0x0010,
  124. STYP_TEXT = 0x0020,
  125. STYP_DATA = 0x0040,
  126. STYP_BSS = 0x0080,
  127. STYP_EXCEPT = 0x0100,
  128. STYP_INFO = 0x0200,
  129. STYP_TDATA = 0x0400,
  130. STYP_TBSS = 0x0800,
  131. STYP_LOADER = 0x1000,
  132. STYP_DEBUG = 0x2000,
  133. STYP_TYPCHK = 0x4000,
  134. STYP_OVRFLO = 0x8000
  135. };
  136. /// Values for defining the section subtype of sections of type STYP_DWARF as
  137. /// they would appear in the (signed, 32-bit) s_flags field of the section
  138. /// header structure, contributing to the 16 most significant bits. Defined in
  139. /// the system header `scnhdr.h`.
  140. enum DwarfSectionSubtypeFlags : int32_t {
  141. SSUBTYP_DWINFO = 0x1'0000, ///< DWARF info section
  142. SSUBTYP_DWLINE = 0x2'0000, ///< DWARF line section
  143. SSUBTYP_DWPBNMS = 0x3'0000, ///< DWARF pubnames section
  144. SSUBTYP_DWPBTYP = 0x4'0000, ///< DWARF pubtypes section
  145. SSUBTYP_DWARNGE = 0x5'0000, ///< DWARF aranges section
  146. SSUBTYP_DWABREV = 0x6'0000, ///< DWARF abbrev section
  147. SSUBTYP_DWSTR = 0x7'0000, ///< DWARF str section
  148. SSUBTYP_DWRNGES = 0x8'0000, ///< DWARF ranges section
  149. SSUBTYP_DWLOC = 0x9'0000, ///< DWARF loc section
  150. SSUBTYP_DWFRAME = 0xA'0000, ///< DWARF frame section
  151. SSUBTYP_DWMAC = 0xB'0000 ///< DWARF macinfo section
  152. };
  153. // STORAGE CLASSES, n_sclass field of syment.
  154. // The values come from `storclass.h` and `dbxstclass.h`.
  155. enum StorageClass : uint8_t {
  156. // Storage classes used for symbolic debugging symbols.
  157. C_FILE = 103, // File name
  158. C_BINCL = 108, // Beginning of include file
  159. C_EINCL = 109, // Ending of include file
  160. C_GSYM = 128, // Global variable
  161. C_STSYM = 133, // Statically allocated symbol
  162. C_BCOMM = 135, // Beginning of common block
  163. C_ECOMM = 137, // End of common block
  164. C_ENTRY = 141, // Alternate entry
  165. C_BSTAT = 143, // Beginning of static block
  166. C_ESTAT = 144, // End of static block
  167. C_GTLS = 145, // Global thread-local variable
  168. C_STTLS = 146, // Static thread-local variable
  169. // Storage classes used for DWARF symbols.
  170. C_DWARF = 112, // DWARF section symbol
  171. // Storage classes used for absolute symbols.
  172. C_LSYM = 129, // Automatic variable allocated on stack
  173. C_PSYM = 130, // Argument to subroutine allocated on stack
  174. C_RSYM = 131, // Register variable
  175. C_RPSYM = 132, // Argument to function or procedure stored in register
  176. C_ECOML = 136, // Local member of common block
  177. C_FUN = 142, // Function or procedure
  178. // Storage classes used for undefined external symbols or
  179. // symbols of general sections.
  180. C_EXT = 2, // External symbol
  181. C_WEAKEXT = 111, // Weak external symbol
  182. // Storage classes used for symbols of general sections.
  183. C_NULL = 0,
  184. C_STAT = 3, // Static
  185. C_BLOCK = 100, // ".bb" or ".eb"
  186. C_FCN = 101, // ".bf" or ".ef"
  187. C_HIDEXT = 107, // Un-named external symbol
  188. C_INFO = 110, // Comment string in .info section
  189. C_DECL = 140, // Declaration of object (type)
  190. // Storage classes - Obsolete/Undocumented.
  191. C_AUTO = 1, // Automatic variable
  192. C_REG = 4, // Register variable
  193. C_EXTDEF = 5, // External definition
  194. C_LABEL = 6, // Label
  195. C_ULABEL = 7, // Undefined label
  196. C_MOS = 8, // Member of structure
  197. C_ARG = 9, // Function argument
  198. C_STRTAG = 10, // Structure tag
  199. C_MOU = 11, // Member of union
  200. C_UNTAG = 12, // Union tag
  201. C_TPDEF = 13, // Type definition
  202. C_USTATIC = 14, // Undefined static
  203. C_ENTAG = 15, // Enumeration tag
  204. C_MOE = 16, // Member of enumeration
  205. C_REGPARM = 17, // Register parameter
  206. C_FIELD = 18, // Bit field
  207. C_EOS = 102, // End of structure
  208. C_LINE = 104,
  209. C_ALIAS = 105, // Duplicate tag
  210. C_HIDDEN = 106, // Special storage class for external
  211. C_EFCN = 255, // Physical end of function
  212. // Storage classes - reserved
  213. C_TCSYM = 134 // Reserved
  214. };
  215. // Flags for defining the symbol type. Values to be encoded into the lower 3
  216. // bits of the (unsigned, 8-bit) x_smtyp field of csect auxiliary symbol table
  217. // entries. Defined in the system header `syms.h`.
  218. enum SymbolType : uint8_t {
  219. XTY_ER = 0, ///< External reference.
  220. XTY_SD = 1, ///< Csect definition for initialized storage.
  221. XTY_LD = 2, ///< Label definition.
  222. ///< Defines an entry point to an initialized csect.
  223. XTY_CM = 3 ///< Common csect definition. For uninitialized storage.
  224. };
  225. /// Values for visibility as they would appear when encoded in the high 4 bits
  226. /// of the 16-bit unsigned n_type field of symbol table entries. Valid for
  227. /// 32-bit XCOFF only when the vstamp in the auxiliary header is greater than 1.
  228. enum VisibilityType : uint16_t {
  229. SYM_V_UNSPECIFIED = 0x0000,
  230. SYM_V_INTERNAL = 0x1000,
  231. SYM_V_HIDDEN = 0x2000,
  232. SYM_V_PROTECTED = 0x3000,
  233. SYM_V_EXPORTED = 0x4000
  234. };
  235. constexpr uint16_t VISIBILITY_MASK = 0x7000;
  236. // Relocation types, defined in `/usr/include/reloc.h`.
  237. enum RelocationType : uint8_t {
  238. R_POS = 0x00, ///< Positive relocation. Provides the address of the referenced
  239. ///< symbol.
  240. R_RL = 0x0c, ///< Positive indirect load relocation. Modifiable instruction.
  241. R_RLA = 0x0d, ///< Positive load address relocation. Modifiable instruction.
  242. R_NEG = 0x01, ///< Negative relocation. Provides the negative of the address
  243. ///< of the referenced symbol.
  244. R_REL = 0x02, ///< Relative to self relocation. Provides a displacement value
  245. ///< between the address of the referenced symbol and the
  246. ///< address being relocated.
  247. R_TOC = 0x03, ///< Relative to the TOC relocation. Provides a displacement
  248. ///< that is the difference between the address of the
  249. ///< referenced symbol and the TOC anchor csect.
  250. R_TRL = 0x12, ///< TOC relative indirect load relocation. Similar to R_TOC,
  251. ///< but not modifiable instruction.
  252. R_TRLA =
  253. 0x13, ///< Relative to the TOC or to the thread-local storage base
  254. ///< relocation. Compilers are not permitted to generate this
  255. ///< relocation type. It is the result of a reversible
  256. ///< transformation by the linker of an R_TOC relation that turned a
  257. ///< load instruction into an add-immediate instruction.
  258. R_GL = 0x05, ///< Global linkage-external TOC address relocation. Provides the
  259. ///< address of the external TOC associated with a defined
  260. ///< external symbol.
  261. R_TCL = 0x06, ///< Local object TOC address relocation. Provides the address
  262. ///< of the local TOC entry of a defined external symbol.
  263. R_REF = 0x0f, ///< A non-relocating relocation. Used to prevent the binder
  264. ///< from garbage collecting a csect (such as code used for
  265. ///< dynamic initialization of non-local statics) for which
  266. ///< another csect has an implicit dependency.
  267. R_BA = 0x08, ///< Branch absolute relocation. Provides the address of the
  268. ///< referenced symbol. References a non-modifiable instruction.
  269. R_BR = 0x0a, ///< Branch relative to self relocation. Provides the
  270. ///< displacement that is the difference between the address of
  271. ///< the referenced symbol and the address of the referenced
  272. ///< branch instruction. References a non-modifiable instruction.
  273. R_RBA = 0x18, ///< Branch absolute relocation. Similar to R_BA but
  274. ///< references a modifiable instruction.
  275. R_RBR = 0x1a, ///< Branch relative to self relocation. Similar to the R_BR
  276. ///< relocation type, but references a modifiable instruction.
  277. R_TLS = 0x20, ///< General-dynamic reference to TLS symbol.
  278. R_TLS_IE = 0x21, ///< Initial-exec reference to TLS symbol.
  279. R_TLS_LD = 0x22, ///< Local-dynamic reference to TLS symbol.
  280. R_TLS_LE = 0x23, ///< Local-exec reference to TLS symbol.
  281. R_TLSM = 0x24, ///< Module reference to TLS. Provides a handle for the module
  282. ///< containing the referenced symbol.
  283. R_TLSML = 0x25, ///< Module reference to the local TLS storage.
  284. R_TOCU = 0x30, ///< Relative to TOC upper. Specifies the high-order 16 bits of
  285. ///< a large code model TOC-relative relocation.
  286. R_TOCL = 0x31 ///< Relative to TOC lower. Specifies the low-order 16 bits of a
  287. ///< large code model TOC-relative relocation.
  288. };
  289. enum CFileStringType : uint8_t {
  290. XFT_FN = 0, ///< Specifies the source-file name.
  291. XFT_CT = 1, ///< Specifies the compiler time stamp.
  292. XFT_CV = 2, ///< Specifies the compiler version number.
  293. XFT_CD = 128 ///< Specifies compiler-defined information.
  294. };
  295. enum CFileLangId : uint8_t {
  296. TB_C = 0, ///< C language.
  297. TB_CPLUSPLUS = 9 ///< C++ language.
  298. };
  299. enum CFileCpuId : uint8_t {
  300. TCPU_PPC64 = 2, ///< PowerPC common architecture 64-bit mode.
  301. TCPU_COM = 3, ///< POWER and PowerPC architecture common.
  302. TCPU_970 = 19 ///< PPC970 - PowerPC 64-bit architecture.
  303. };
  304. enum SymbolAuxType : uint8_t {
  305. AUX_EXCEPT = 255, ///< Identifies an exception auxiliary entry.
  306. AUX_FCN = 254, ///< Identifies a function auxiliary entry.
  307. AUX_SYM = 253, ///< Identifies a symbol auxiliary entry.
  308. AUX_FILE = 252, ///< Identifies a file auxiliary entry.
  309. AUX_CSECT = 251, ///< Identifies a csect auxiliary entry.
  310. AUX_SECT = 250 ///< Identifies a SECT auxiliary entry.
  311. }; // 64-bit XCOFF file only.
  312. StringRef getMappingClassString(XCOFF::StorageMappingClass SMC);
  313. StringRef getRelocationTypeString(XCOFF::RelocationType Type);
  314. Expected<SmallString<32>> parseParmsType(uint32_t Value, unsigned FixedParmsNum,
  315. unsigned FloatingParmsNum);
  316. Expected<SmallString<32>> parseParmsTypeWithVecInfo(uint32_t Value,
  317. unsigned FixedParmsNum,
  318. unsigned FloatingParmsNum,
  319. unsigned VectorParmsNum);
  320. Expected<SmallString<32>> parseVectorParmsType(uint32_t Value,
  321. unsigned ParmsNum);
  322. struct TracebackTable {
  323. enum LanguageID : uint8_t {
  324. C,
  325. Fortran,
  326. Pascal,
  327. Ada,
  328. PL1,
  329. Basic,
  330. Lisp,
  331. Cobol,
  332. Modula2,
  333. CPlusPlus,
  334. Rpg,
  335. PL8,
  336. PLIX = PL8,
  337. Assembly,
  338. Java,
  339. ObjectiveC
  340. };
  341. // Byte 1
  342. static constexpr uint32_t VersionMask = 0xFF00'0000;
  343. static constexpr uint8_t VersionShift = 24;
  344. // Byte 2
  345. static constexpr uint32_t LanguageIdMask = 0x00FF'0000;
  346. static constexpr uint8_t LanguageIdShift = 16;
  347. // Byte 3
  348. static constexpr uint32_t IsGlobaLinkageMask = 0x0000'8000;
  349. static constexpr uint32_t IsOutOfLineEpilogOrPrologueMask = 0x0000'4000;
  350. static constexpr uint32_t HasTraceBackTableOffsetMask = 0x0000'2000;
  351. static constexpr uint32_t IsInternalProcedureMask = 0x0000'1000;
  352. static constexpr uint32_t HasControlledStorageMask = 0x0000'0800;
  353. static constexpr uint32_t IsTOClessMask = 0x0000'0400;
  354. static constexpr uint32_t IsFloatingPointPresentMask = 0x0000'0200;
  355. static constexpr uint32_t IsFloatingPointOperationLogOrAbortEnabledMask =
  356. 0x0000'0100;
  357. // Byte 4
  358. static constexpr uint32_t IsInterruptHandlerMask = 0x0000'0080;
  359. static constexpr uint32_t IsFunctionNamePresentMask = 0x0000'0040;
  360. static constexpr uint32_t IsAllocaUsedMask = 0x0000'0020;
  361. static constexpr uint32_t OnConditionDirectiveMask = 0x0000'001C;
  362. static constexpr uint32_t IsCRSavedMask = 0x0000'0002;
  363. static constexpr uint32_t IsLRSavedMask = 0x0000'0001;
  364. static constexpr uint8_t OnConditionDirectiveShift = 2;
  365. // Byte 5
  366. static constexpr uint32_t IsBackChainStoredMask = 0x8000'0000;
  367. static constexpr uint32_t IsFixupMask = 0x4000'0000;
  368. static constexpr uint32_t FPRSavedMask = 0x3F00'0000;
  369. static constexpr uint32_t FPRSavedShift = 24;
  370. // Byte 6
  371. static constexpr uint32_t HasExtensionTableMask = 0x0080'0000;
  372. static constexpr uint32_t HasVectorInfoMask = 0x0040'0000;
  373. static constexpr uint32_t GPRSavedMask = 0x003F'0000;
  374. static constexpr uint32_t GPRSavedShift = 16;
  375. // Byte 7
  376. static constexpr uint32_t NumberOfFixedParmsMask = 0x0000'FF00;
  377. static constexpr uint8_t NumberOfFixedParmsShift = 8;
  378. // Byte 8
  379. static constexpr uint32_t NumberOfFloatingPointParmsMask = 0x0000'00FE;
  380. static constexpr uint32_t HasParmsOnStackMask = 0x0000'0001;
  381. static constexpr uint8_t NumberOfFloatingPointParmsShift = 1;
  382. // Masks to select leftmost bits for decoding parameter type information.
  383. // Bit to use when vector info is not presented.
  384. static constexpr uint32_t ParmTypeIsFloatingBit = 0x8000'0000;
  385. static constexpr uint32_t ParmTypeFloatingIsDoubleBit = 0x4000'0000;
  386. // Bits to use when vector info is presented.
  387. static constexpr uint32_t ParmTypeIsFixedBits = 0x0000'0000;
  388. static constexpr uint32_t ParmTypeIsVectorBits = 0x4000'0000;
  389. static constexpr uint32_t ParmTypeIsFloatingBits = 0x8000'0000;
  390. static constexpr uint32_t ParmTypeIsDoubleBits = 0xC000'0000;
  391. static constexpr uint32_t ParmTypeMask = 0xC000'0000;
  392. // Vector extension
  393. static constexpr uint16_t NumberOfVRSavedMask = 0xFC00;
  394. static constexpr uint16_t IsVRSavedOnStackMask = 0x0200;
  395. static constexpr uint16_t HasVarArgsMask = 0x0100;
  396. static constexpr uint8_t NumberOfVRSavedShift = 10;
  397. static constexpr uint16_t NumberOfVectorParmsMask = 0x00FE;
  398. static constexpr uint16_t HasVMXInstructionMask = 0x0001;
  399. static constexpr uint8_t NumberOfVectorParmsShift = 1;
  400. static constexpr uint32_t ParmTypeIsVectorCharBit = 0x0000'0000;
  401. static constexpr uint32_t ParmTypeIsVectorShortBit = 0x4000'0000;
  402. static constexpr uint32_t ParmTypeIsVectorIntBit = 0x8000'0000;
  403. static constexpr uint32_t ParmTypeIsVectorFloatBit = 0xC000'0000;
  404. static constexpr uint8_t WidthOfParamType = 2;
  405. };
  406. // Extended Traceback table flags.
  407. enum ExtendedTBTableFlag : uint8_t {
  408. TB_OS1 = 0x80, ///< Reserved for OS use.
  409. TB_RESERVED = 0x40, ///< Reserved for compiler.
  410. TB_SSP_CANARY = 0x20, ///< stack smasher canary present on stack.
  411. TB_OS2 = 0x10, ///< Reserved for OS use.
  412. TB_EH_INFO = 0x08, ///< Exception handling info present.
  413. TB_LONGTBTABLE2 = 0x01 ///< Additional tbtable extension exists.
  414. };
  415. StringRef getNameForTracebackTableLanguageId(TracebackTable::LanguageID LangId);
  416. SmallString<32> getExtendedTBTableFlagString(uint8_t Flag);
  417. struct CsectProperties {
  418. CsectProperties(StorageMappingClass SMC, SymbolType ST)
  419. : MappingClass(SMC), Type(ST) {}
  420. StorageMappingClass MappingClass;
  421. SymbolType Type;
  422. };
  423. } // end namespace XCOFF
  424. } // end namespace llvm
  425. #endif
  426. #ifdef __GNUC__
  427. #pragma GCC diagnostic pop
  428. #endif