LLVM  14.0.0git
ELFAttributes.h
Go to the documentation of this file.
1 //===-- ELFAttributes.h - ELF Attributes ------------------------*- 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 #ifndef LLVM_SUPPORT_ELFATTRIBUTES_H
10 #define LLVM_SUPPORT_ELFATTRIBUTES_H
11 
12 #include "llvm/ADT/ArrayRef.h"
13 #include "llvm/ADT/StringRef.h"
14 
15 namespace llvm {
16 
17 struct TagNameItem {
18  unsigned attr;
20 };
21 
23 
24 namespace ELFAttrs {
25 
26 enum AttrType : unsigned { File = 1, Section = 2, Symbol = 3 };
27 
28 StringRef attrTypeAsString(unsigned attr, TagNameMap tagNameMap,
29  bool hasTagPrefix = true);
31 
32 // Magic numbers for ELF attributes.
33 enum AttrMagic { Format_Version = 0x41 };
34 
35 } // namespace ELFAttrs
36 } // namespace llvm
37 #endif
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
StringRef.h
llvm::ELFAttrs::attrTypeFromString
Optional< unsigned > attrTypeFromString(StringRef tag, TagNameMap tagNameMap)
Definition: ELFAttributes.cpp:24
llvm::Optional< unsigned >
llvm::TagNameItem
Definition: ELFAttributes.h:17
llvm::TagNameItem::tagName
StringRef tagName
Definition: ELFAttributes.h:19
llvm::ELFAttrs::AttrMagic
AttrMagic
Definition: ELFAttributes.h:33
llvm::ELFAttrs::Format_Version
@ Format_Version
Definition: ELFAttributes.h:33
llvm::ELFAttrs::Symbol
@ Symbol
Definition: ELFAttributes.h:26
ArrayRef.h
llvm::ELFAttrs::AttrType
AttrType
Definition: ELFAttributes.h:26
llvm::ArrayRef< TagNameItem >
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::ELFAttrs::Section
@ Section
Definition: ELFAttributes.h:26
llvm::ELFAttrs::File
@ File
Definition: ELFAttributes.h:26
llvm::TagNameItem::attr
unsigned attr
Definition: ELFAttributes.h:18
llvm::ELFAttrs::attrTypeAsString
StringRef attrTypeAsString(unsigned attr, TagNameMap tagNameMap, bool hasTagPrefix=true)
Definition: ELFAttributes.cpp:14