1 //===- ELFTypes.h - Endian specific types for ELF ---------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_OBJECT_ELFTYPES_H
11 #define LLVM_OBJECT_ELFTYPES_H
13 #include "llvm/ADT/ArrayRef.h"
14 #include "llvm/Object/Error.h"
15 #include "llvm/Support/ELF.h"
16 #include "llvm/Support/Endian.h"
17 #include "llvm/Support/ErrorOr.h"
22 using support::endianness;
24 template <endianness target_endianness, bool is64Bits> struct ELFType {
25 static const endianness TargetEndianness = target_endianness;
26 static const bool Is64Bits = is64Bits;
29 typedef ELFType<support::little, false> ELF32LE;
30 typedef ELFType<support::big, false> ELF32BE;
31 typedef ELFType<support::little, true> ELF64LE;
32 typedef ELFType<support::big, true> ELF64BE;
34 // Use an alignment of 2 for the typedefs since that is the worst case for
35 // ELF files in archives.
37 // Templates to choose Elf_Addr and Elf_Off depending on is64Bits.
38 template <endianness target_endianness> struct ELFDataTypeTypedefHelperCommon {
39 typedef support::detail::packed_endian_specific_integral<
40 uint16_t, target_endianness, 2> Elf_Half;
41 typedef support::detail::packed_endian_specific_integral<
42 uint32_t, target_endianness, 2> Elf_Word;
43 typedef support::detail::packed_endian_specific_integral<
44 int32_t, target_endianness, 2> Elf_Sword;
45 typedef support::detail::packed_endian_specific_integral<
46 uint64_t, target_endianness, 2> Elf_Xword;
47 typedef support::detail::packed_endian_specific_integral<
48 int64_t, target_endianness, 2> Elf_Sxword;
51 template <class ELFT> struct ELFDataTypeTypedefHelper;
54 template <endianness TargetEndianness>
55 struct ELFDataTypeTypedefHelper<ELFType<TargetEndianness, false>>
56 : ELFDataTypeTypedefHelperCommon<TargetEndianness> {
57 typedef uint32_t value_type;
58 typedef support::detail::packed_endian_specific_integral<
59 value_type, TargetEndianness, 2> Elf_Addr;
60 typedef support::detail::packed_endian_specific_integral<
61 value_type, TargetEndianness, 2> Elf_Off;
65 template <endianness TargetEndianness>
66 struct ELFDataTypeTypedefHelper<ELFType<TargetEndianness, true>>
67 : ELFDataTypeTypedefHelperCommon<TargetEndianness> {
68 typedef uint64_t value_type;
69 typedef support::detail::packed_endian_specific_integral<
70 value_type, TargetEndianness, 2> Elf_Addr;
71 typedef support::detail::packed_endian_specific_integral<
72 value_type, TargetEndianness, 2> Elf_Off;
75 // I really don't like doing this, but the alternative is copypasta.
76 #define LLVM_ELF_IMPORT_TYPES(E, W) \
77 typedef typename ELFDataTypeTypedefHelper<ELFType<E, W>>::Elf_Addr Elf_Addr; \
78 typedef typename ELFDataTypeTypedefHelper<ELFType<E, W>>::Elf_Off Elf_Off; \
79 typedef typename ELFDataTypeTypedefHelper<ELFType<E, W>>::Elf_Half Elf_Half; \
80 typedef typename ELFDataTypeTypedefHelper<ELFType<E, W>>::Elf_Word Elf_Word; \
82 typename ELFDataTypeTypedefHelper<ELFType<E, W>>::Elf_Sword Elf_Sword; \
84 typename ELFDataTypeTypedefHelper<ELFType<E, W>>::Elf_Xword Elf_Xword; \
86 typename ELFDataTypeTypedefHelper<ELFType<E, W>>::Elf_Sxword Elf_Sxword;
88 #define LLVM_ELF_IMPORT_TYPES_ELFT(ELFT) \
89 LLVM_ELF_IMPORT_TYPES(ELFT::TargetEndianness, ELFT::Is64Bits)
92 template <class ELFT> struct Elf_Shdr_Base;
94 template <endianness TargetEndianness>
95 struct Elf_Shdr_Base<ELFType<TargetEndianness, false>> {
96 LLVM_ELF_IMPORT_TYPES(TargetEndianness, false)
97 Elf_Word sh_name; // Section name (index into string table)
98 Elf_Word sh_type; // Section type (SHT_*)
99 Elf_Word sh_flags; // Section flags (SHF_*)
100 Elf_Addr sh_addr; // Address where section is to be loaded
101 Elf_Off sh_offset; // File offset of section data, in bytes
102 Elf_Word sh_size; // Size of section, in bytes
103 Elf_Word sh_link; // Section type-specific header table index link
104 Elf_Word sh_info; // Section type-specific extra information
105 Elf_Word sh_addralign; // Section address alignment
106 Elf_Word sh_entsize; // Size of records contained within the section
109 template <endianness TargetEndianness>
110 struct Elf_Shdr_Base<ELFType<TargetEndianness, true>> {
111 LLVM_ELF_IMPORT_TYPES(TargetEndianness, true)
112 Elf_Word sh_name; // Section name (index into string table)
113 Elf_Word sh_type; // Section type (SHT_*)
114 Elf_Xword sh_flags; // Section flags (SHF_*)
115 Elf_Addr sh_addr; // Address where section is to be loaded
116 Elf_Off sh_offset; // File offset of section data, in bytes
117 Elf_Xword sh_size; // Size of section, in bytes
118 Elf_Word sh_link; // Section type-specific header table index link
119 Elf_Word sh_info; // Section type-specific extra information
120 Elf_Xword sh_addralign; // Section address alignment
121 Elf_Xword sh_entsize; // Size of records contained within the section
124 template <class ELFT>
125 struct Elf_Shdr_Impl : Elf_Shdr_Base<ELFT> {
126 using Elf_Shdr_Base<ELFT>::sh_entsize;
127 using Elf_Shdr_Base<ELFT>::sh_size;
129 /// @brief Get the number of entities this section contains if it has any.
130 unsigned getEntityCount() const {
133 return sh_size / sh_entsize;
137 template <class ELFT> struct Elf_Sym_Base;
139 template <endianness TargetEndianness>
140 struct Elf_Sym_Base<ELFType<TargetEndianness, false>> {
141 LLVM_ELF_IMPORT_TYPES(TargetEndianness, false)
142 Elf_Word st_name; // Symbol name (index into string table)
143 Elf_Addr st_value; // Value or address associated with the symbol
144 Elf_Word st_size; // Size of the symbol
145 unsigned char st_info; // Symbol's type and binding attributes
146 unsigned char st_other; // Must be zero; reserved
147 Elf_Half st_shndx; // Which section (header table index) it's defined in
150 template <endianness TargetEndianness>
151 struct Elf_Sym_Base<ELFType<TargetEndianness, true>> {
152 LLVM_ELF_IMPORT_TYPES(TargetEndianness, true)
153 Elf_Word st_name; // Symbol name (index into string table)
154 unsigned char st_info; // Symbol's type and binding attributes
155 unsigned char st_other; // Must be zero; reserved
156 Elf_Half st_shndx; // Which section (header table index) it's defined in
157 Elf_Addr st_value; // Value or address associated with the symbol
158 Elf_Xword st_size; // Size of the symbol
161 template <class ELFT>
162 struct Elf_Sym_Impl : Elf_Sym_Base<ELFT> {
163 using Elf_Sym_Base<ELFT>::st_info;
164 using Elf_Sym_Base<ELFT>::st_shndx;
165 using Elf_Sym_Base<ELFT>::st_other;
166 using Elf_Sym_Base<ELFT>::st_value;
168 // These accessors and mutators correspond to the ELF32_ST_BIND,
169 // ELF32_ST_TYPE, and ELF32_ST_INFO macros defined in the ELF specification:
170 unsigned char getBinding() const { return st_info >> 4; }
171 unsigned char getType() const { return st_info & 0x0f; }
172 uint64_t getValue() const { return st_value; }
173 void setBinding(unsigned char b) { setBindingAndType(b, getType()); }
174 void setType(unsigned char t) { setBindingAndType(getBinding(), t); }
175 void setBindingAndType(unsigned char b, unsigned char t) {
176 st_info = (b << 4) + (t & 0x0f);
179 /// Access to the STV_xxx flag stored in the first two bits of st_other.
184 unsigned char getVisibility() const { return st_other & 0x3; }
185 void setVisibility(unsigned char v) {
186 assert(v < 4 && "Invalid value for visibility");
187 st_other = (st_other & ~0x3) | v;
190 bool isAbsolute() const { return st_shndx == ELF::SHN_ABS; }
191 bool isCommon() const {
192 return getType() == ELF::STT_COMMON || st_shndx == ELF::SHN_COMMON;
194 bool isDefined() const { return !isUndefined(); }
195 bool isProcessorSpecific() const {
196 return st_shndx >= ELF::SHN_LOPROC && st_shndx <= ELF::SHN_HIPROC;
198 bool isOSSpecific() const {
199 return st_shndx >= ELF::SHN_LOOS && st_shndx <= ELF::SHN_HIOS;
201 bool isReserved() const {
202 // ELF::SHN_HIRESERVE is 0xffff so st_shndx <= ELF::SHN_HIRESERVE is always
203 // true and some compilers warn about it.
204 return st_shndx >= ELF::SHN_LORESERVE;
206 bool isUndefined() const { return st_shndx == ELF::SHN_UNDEF; }
207 bool isExternal() const {
208 return getBinding() != ELF::STB_LOCAL;
211 ErrorOr<StringRef> getName(StringRef StrTab) const;
214 template <class ELFT>
215 ErrorOr<StringRef> Elf_Sym_Impl<ELFT>::getName(StringRef StrTab) const {
216 uint32_t Offset = this->st_name;
217 if (Offset >= StrTab.size())
218 return object_error::parse_failed;
219 return StringRef(StrTab.data() + Offset);
222 /// Elf_Versym: This is the structure of entries in the SHT_GNU_versym section
223 /// (.gnu.version). This structure is identical for ELF32 and ELF64.
224 template <class ELFT>
225 struct Elf_Versym_Impl {
226 LLVM_ELF_IMPORT_TYPES_ELFT(ELFT)
227 Elf_Half vs_index; // Version index with flags (e.g. VERSYM_HIDDEN)
230 template <class ELFT> struct Elf_Verdaux_Impl;
232 /// Elf_Verdef: This is the structure of entries in the SHT_GNU_verdef section
233 /// (.gnu.version_d). This structure is identical for ELF32 and ELF64.
234 template <class ELFT>
235 struct Elf_Verdef_Impl {
236 LLVM_ELF_IMPORT_TYPES_ELFT(ELFT)
237 typedef Elf_Verdaux_Impl<ELFT> Elf_Verdaux;
238 Elf_Half vd_version; // Version of this structure (e.g. VER_DEF_CURRENT)
239 Elf_Half vd_flags; // Bitwise flags (VER_DEF_*)
240 Elf_Half vd_ndx; // Version index, used in .gnu.version entries
241 Elf_Half vd_cnt; // Number of Verdaux entries
242 Elf_Word vd_hash; // Hash of name
243 Elf_Word vd_aux; // Offset to the first Verdaux entry (in bytes)
244 Elf_Word vd_next; // Offset to the next Verdef entry (in bytes)
246 /// Get the first Verdaux entry for this Verdef.
247 const Elf_Verdaux *getAux() const {
248 return reinterpret_cast<const Elf_Verdaux *>((const char *)this + vd_aux);
252 /// Elf_Verdaux: This is the structure of auxiliary data in the SHT_GNU_verdef
253 /// section (.gnu.version_d). This structure is identical for ELF32 and ELF64.
254 template <class ELFT>
255 struct Elf_Verdaux_Impl {
256 LLVM_ELF_IMPORT_TYPES_ELFT(ELFT)
257 Elf_Word vda_name; // Version name (offset in string table)
258 Elf_Word vda_next; // Offset to next Verdaux entry (in bytes)
261 /// Elf_Verneed: This is the structure of entries in the SHT_GNU_verneed
262 /// section (.gnu.version_r). This structure is identical for ELF32 and ELF64.
263 template <class ELFT>
264 struct Elf_Verneed_Impl {
265 LLVM_ELF_IMPORT_TYPES_ELFT(ELFT)
266 Elf_Half vn_version; // Version of this structure (e.g. VER_NEED_CURRENT)
267 Elf_Half vn_cnt; // Number of associated Vernaux entries
268 Elf_Word vn_file; // Library name (string table offset)
269 Elf_Word vn_aux; // Offset to first Vernaux entry (in bytes)
270 Elf_Word vn_next; // Offset to next Verneed entry (in bytes)
273 /// Elf_Vernaux: This is the structure of auxiliary data in SHT_GNU_verneed
274 /// section (.gnu.version_r). This structure is identical for ELF32 and ELF64.
275 template <class ELFT>
276 struct Elf_Vernaux_Impl {
277 LLVM_ELF_IMPORT_TYPES_ELFT(ELFT)
278 Elf_Word vna_hash; // Hash of dependency name
279 Elf_Half vna_flags; // Bitwise Flags (VER_FLAG_*)
280 Elf_Half vna_other; // Version index, used in .gnu.version entries
281 Elf_Word vna_name; // Dependency name
282 Elf_Word vna_next; // Offset to next Vernaux entry (in bytes)
285 /// Elf_Dyn_Base: This structure matches the form of entries in the dynamic
286 /// table section (.dynamic) look like.
287 template <class ELFT> struct Elf_Dyn_Base;
289 template <endianness TargetEndianness>
290 struct Elf_Dyn_Base<ELFType<TargetEndianness, false>> {
291 LLVM_ELF_IMPORT_TYPES(TargetEndianness, false)
299 template <endianness TargetEndianness>
300 struct Elf_Dyn_Base<ELFType<TargetEndianness, true>> {
301 LLVM_ELF_IMPORT_TYPES(TargetEndianness, true)
309 /// Elf_Dyn_Impl: This inherits from Elf_Dyn_Base, adding getters and setters.
310 template <class ELFT>
311 struct Elf_Dyn_Impl : Elf_Dyn_Base<ELFT> {
312 using Elf_Dyn_Base<ELFT>::d_tag;
313 using Elf_Dyn_Base<ELFT>::d_un;
314 int64_t getTag() const { return d_tag; }
315 uint64_t getVal() const { return d_un.d_val; }
316 uint64_t getPtr() const { return d_un.d_ptr; }
319 // Elf_Rel: Elf Relocation
320 template <class ELFT, bool isRela> struct Elf_Rel_Impl;
322 template <endianness TargetEndianness>
323 struct Elf_Rel_Impl<ELFType<TargetEndianness, false>, false> {
324 LLVM_ELF_IMPORT_TYPES(TargetEndianness, false)
325 Elf_Addr r_offset; // Location (file byte offset, or program virtual addr)
326 Elf_Word r_info; // Symbol table index and type of relocation to apply
328 uint32_t getRInfo(bool isMips64EL) const {
332 void setRInfo(uint32_t R, bool IsMips64EL) {
337 // These accessors and mutators correspond to the ELF32_R_SYM, ELF32_R_TYPE,
338 // and ELF32_R_INFO macros defined in the ELF specification:
339 uint32_t getSymbol(bool isMips64EL) const {
340 return this->getRInfo(isMips64EL) >> 8;
342 unsigned char getType(bool isMips64EL) const {
343 return (unsigned char)(this->getRInfo(isMips64EL) & 0x0ff);
345 void setSymbol(uint32_t s, bool IsMips64EL) {
346 setSymbolAndType(s, getType(), IsMips64EL);
348 void setType(unsigned char t, bool IsMips64EL) {
349 setSymbolAndType(getSymbol(), t, IsMips64EL);
351 void setSymbolAndType(uint32_t s, unsigned char t, bool IsMips64EL) {
352 this->setRInfo((s << 8) + t, IsMips64EL);
356 template <endianness TargetEndianness>
357 struct Elf_Rel_Impl<ELFType<TargetEndianness, false>, true>
358 : public Elf_Rel_Impl<ELFType<TargetEndianness, false>, false> {
359 LLVM_ELF_IMPORT_TYPES(TargetEndianness, false)
360 Elf_Sword r_addend; // Compute value for relocatable field by adding this
363 template <endianness TargetEndianness>
364 struct Elf_Rel_Impl<ELFType<TargetEndianness, true>, false> {
365 LLVM_ELF_IMPORT_TYPES(TargetEndianness, true)
366 Elf_Addr r_offset; // Location (file byte offset, or program virtual addr)
367 Elf_Xword r_info; // Symbol table index and type of relocation to apply
369 uint64_t getRInfo(bool isMips64EL) const {
373 // Mips64 little endian has a "special" encoding of r_info. Instead of one
374 // 64 bit little endian number, it is a little endian 32 bit number followed
375 // by a 32 bit big endian number.
376 return (t << 32) | ((t >> 8) & 0xff000000) | ((t >> 24) & 0x00ff0000) |
377 ((t >> 40) & 0x0000ff00) | ((t >> 56) & 0x000000ff);
379 void setRInfo(uint64_t R, bool IsMips64EL) {
381 r_info = (R >> 32) | ((R & 0xff000000) << 8) | ((R & 0x00ff0000) << 24) |
382 ((R & 0x0000ff00) << 40) | ((R & 0x000000ff) << 56);
387 // These accessors and mutators correspond to the ELF64_R_SYM, ELF64_R_TYPE,
388 // and ELF64_R_INFO macros defined in the ELF specification:
389 uint32_t getSymbol(bool isMips64EL) const {
390 return (uint32_t)(this->getRInfo(isMips64EL) >> 32);
392 uint32_t getType(bool isMips64EL) const {
393 return (uint32_t)(this->getRInfo(isMips64EL) & 0xffffffffL);
395 void setSymbol(uint32_t s, bool IsMips64EL) {
396 setSymbolAndType(s, getType(), IsMips64EL);
398 void setType(uint32_t t, bool IsMips64EL) {
399 setSymbolAndType(getSymbol(), t, IsMips64EL);
401 void setSymbolAndType(uint32_t s, uint32_t t, bool IsMips64EL) {
402 this->setRInfo(((uint64_t)s << 32) + (t & 0xffffffffL), IsMips64EL);
406 template <endianness TargetEndianness>
407 struct Elf_Rel_Impl<ELFType<TargetEndianness, true>, true>
408 : public Elf_Rel_Impl<ELFType<TargetEndianness, true>, false> {
409 LLVM_ELF_IMPORT_TYPES(TargetEndianness, true)
410 Elf_Sxword r_addend; // Compute value for relocatable field by adding this.
413 template <class ELFT>
414 struct Elf_Ehdr_Impl {
415 LLVM_ELF_IMPORT_TYPES_ELFT(ELFT)
416 unsigned char e_ident[ELF::EI_NIDENT]; // ELF Identification bytes
417 Elf_Half e_type; // Type of file (see ET_*)
418 Elf_Half e_machine; // Required architecture for this file (see EM_*)
419 Elf_Word e_version; // Must be equal to 1
420 Elf_Addr e_entry; // Address to jump to in order to start program
421 Elf_Off e_phoff; // Program header table's file offset, in bytes
422 Elf_Off e_shoff; // Section header table's file offset, in bytes
423 Elf_Word e_flags; // Processor-specific flags
424 Elf_Half e_ehsize; // Size of ELF header, in bytes
425 Elf_Half e_phentsize; // Size of an entry in the program header table
426 Elf_Half e_phnum; // Number of entries in the program header table
427 Elf_Half e_shentsize; // Size of an entry in the section header table
428 Elf_Half e_shnum; // Number of entries in the section header table
429 Elf_Half e_shstrndx; // Section header table index of section name
431 bool checkMagic() const {
432 return (memcmp(e_ident, ELF::ElfMagic, strlen(ELF::ElfMagic))) == 0;
434 unsigned char getFileClass() const { return e_ident[ELF::EI_CLASS]; }
435 unsigned char getDataEncoding() const { return e_ident[ELF::EI_DATA]; }
438 template <class ELFT> struct Elf_Phdr_Impl;
440 template <endianness TargetEndianness>
441 struct Elf_Phdr_Impl<ELFType<TargetEndianness, false>> {
442 LLVM_ELF_IMPORT_TYPES(TargetEndianness, false)
443 Elf_Word p_type; // Type of segment
444 Elf_Off p_offset; // FileOffset where segment is located, in bytes
445 Elf_Addr p_vaddr; // Virtual Address of beginning of segment
446 Elf_Addr p_paddr; // Physical address of beginning of segment (OS-specific)
447 Elf_Word p_filesz; // Num. of bytes in file image of segment (may be zero)
448 Elf_Word p_memsz; // Num. of bytes in mem image of segment (may be zero)
449 Elf_Word p_flags; // Segment flags
450 Elf_Word p_align; // Segment alignment constraint
453 template <endianness TargetEndianness>
454 struct Elf_Phdr_Impl<ELFType<TargetEndianness, true>> {
455 LLVM_ELF_IMPORT_TYPES(TargetEndianness, true)
456 Elf_Word p_type; // Type of segment
457 Elf_Word p_flags; // Segment flags
458 Elf_Off p_offset; // FileOffset where segment is located, in bytes
459 Elf_Addr p_vaddr; // Virtual Address of beginning of segment
460 Elf_Addr p_paddr; // Physical address of beginning of segment (OS-specific)
461 Elf_Xword p_filesz; // Num. of bytes in file image of segment (may be zero)
462 Elf_Xword p_memsz; // Num. of bytes in mem image of segment (may be zero)
463 Elf_Xword p_align; // Segment alignment constraint
466 // ELFT needed for endianess.
467 template <class ELFT>
468 struct Elf_Hash_Impl {
469 LLVM_ELF_IMPORT_TYPES_ELFT(ELFT)
473 ArrayRef<Elf_Word> buckets() const {
474 return ArrayRef<Elf_Word>(&nbucket + 2, &nbucket + 2 + nbucket);
477 ArrayRef<Elf_Word> chains() const {
478 return ArrayRef<Elf_Word>(&nbucket + 2 + nbucket,
479 &nbucket + 2 + nbucket + nchain);
483 // MIPS .reginfo section
484 template <class ELFT>
485 struct Elf_Mips_RegInfo;
487 template <llvm::support::endianness TargetEndianness>
488 struct Elf_Mips_RegInfo<ELFType<TargetEndianness, false>> {
489 LLVM_ELF_IMPORT_TYPES(TargetEndianness, false)
490 Elf_Word ri_gprmask; // bit-mask of used general registers
491 Elf_Word ri_cprmask[4]; // bit-mask of used co-processor registers
492 Elf_Addr ri_gp_value; // gp register value
495 template <llvm::support::endianness TargetEndianness>
496 struct Elf_Mips_RegInfo<ELFType<TargetEndianness, true>> {
497 LLVM_ELF_IMPORT_TYPES(TargetEndianness, true)
498 Elf_Word ri_gprmask; // bit-mask of used general registers
499 Elf_Word ri_pad; // unused padding field
500 Elf_Word ri_cprmask[4]; // bit-mask of used co-processor registers
501 Elf_Addr ri_gp_value; // gp register value
504 // .MIPS.options section
505 template <class ELFT> struct Elf_Mips_Options {
506 LLVM_ELF_IMPORT_TYPES_ELFT(ELFT)
507 uint8_t kind; // Determines interpretation of variable part of descriptor
508 uint8_t size; // Byte size of descriptor, including this header
509 Elf_Half section; // Section header index of section affected,
510 // or 0 for global options
511 Elf_Word info; // Kind-specific information
513 const Elf_Mips_RegInfo<ELFT> &getRegInfo() const {
514 assert(kind == llvm::ELF::ODK_REGINFO);
515 return *reinterpret_cast<const Elf_Mips_RegInfo<ELFT> *>(
516 (const uint8_t *)this + sizeof(Elf_Mips_Options));
520 // .MIPS.abiflags section content
521 template <class ELFT> struct Elf_Mips_ABIFlags {
522 LLVM_ELF_IMPORT_TYPES_ELFT(ELFT)
523 Elf_Half version; // Version of the structure
524 uint8_t isa_level; // ISA level: 1-5, 32, and 64
525 uint8_t isa_rev; // ISA revision (0 for MIPS I - MIPS V)
526 uint8_t gpr_size; // General purpose registers size
527 uint8_t cpr1_size; // Co-processor 1 registers size
528 uint8_t cpr2_size; // Co-processor 2 registers size
529 uint8_t fp_abi; // Floating-point ABI flag
530 Elf_Word isa_ext; // Processor-specific extension
531 Elf_Word ases; // ASEs flags
532 Elf_Word flags1; // General flags
533 Elf_Word flags2; // General flags
536 } // end namespace object.
537 } // end namespace llvm.