LLVM: include/llvm/TextAPI/SymbolSet.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9#ifndef LLVM_TEXTAPI_SYMBOLSET_H

10#define LLVM_TEXTAPI_SYMBOLSET_H

11

22#include <stddef.h>

23

24namespace llvm {

25

37

42

46

48 return std::tie(LHS.Kind, LHS.Name) == std::tie(RHS.Kind, RHS.Name);

49 }

50};

51

52template <typename DerivedT, typename KeyInfoT, typename BucketT>

54 KeyInfoT, BucketT> &LHS,

56 KeyInfoT, BucketT> &RHS) {

57 if (LHS.size() != RHS.size())

58 return false;

59 for (const auto &KV : LHS) {

60 auto I = RHS.find(KV.first);

61 if (I == RHS.end() || *I->second != *KV.second)

62 return false;

63 }

64 return true;

65}

66

67template <typename DerivedT, typename KeyInfoT, typename BucketT>

69 KeyInfoT, BucketT> &LHS,

71 KeyInfoT, BucketT> &RHS) {

73}

74

75namespace MachO {

76

78private:

82 return {};

83 void *Ptr = Allocator.Allocate(String.size(), 1);

85 return StringRef(reinterpret_cast<const char *>(Ptr), String.size());

86 }

87

89 SymbolsMapType Symbols;

90

92

93public:

100 size_t size() const { return Symbols.size(); }

101

102 template <typename RangeT, typename ElT = std::remove_reference_t<

103 decltype(*std::begin(std::declval()))>>

105 RangeT &&Targets) {

106 auto *Global = addGlobalImpl(Kind, Name, Flags);

107 for (const auto &Targ : Targets)

108 Global->addTarget(Targ);

112 }

113

117

124

125 template

128

131 };

132

134

137 std::function<bool(const Symbol *)>>;

140

141

143

144

151

152

159

160

167

169

171

173 return Allocator.Allocate(Size, Align);

174 }

175};

176

177}

178}

179#endif

This file defines the BumpPtrAllocator interface.

This file defines the DenseMap class.

DenseMapIterator< KeyT, ValueT, KeyInfoT, BucketT, true > const_iterator

SymbolSet & operator=(const SymbolSet &other)=delete

iterator_range< const_filtered_symbol_iterator > const_filtered_symbol_range

Definition SymbolSet.h:138

filter_iterator< const_symbol_iterator, std::function< bool(const Symbol *)> > const_filtered_symbol_iterator

Definition SymbolSet.h:135

Symbol * addGlobal(EncodeKind Kind, StringRef Name, SymbolFlags Flags, RangeT &&Targets)

Definition SymbolSet.h:104

bool operator!=(const SymbolSet &O) const

Definition SymbolSet.h:170

void * allocate(size_t Size, unsigned Align=8)

Definition SymbolSet.h:172

LLVM_ABI bool operator==(const SymbolSet &O) const

iterator_range< const_symbol_iterator > const_symbol_range

Definition SymbolSet.h:133

SymbolSet(const SymbolSet &other)=delete

LLVM_ABI Symbol * addGlobal(EncodeKind Kind, StringRef Name, SymbolFlags Flags, const Target &Targ)

LLVM_ABI const Symbol * findSymbol(EncodeKind Kind, StringRef Name, ObjCIFSymbolKind ObjCIF=ObjCIFSymbolKind::None) const

size_t size() const

Definition SymbolSet.h:100

const_filtered_symbol_range undefineds() const

Definition SymbolSet.h:161

const_symbol_range symbols() const

Definition SymbolSet.h:142

const_filtered_symbol_range reexports() const

Definition SymbolSet.h:153

const_filtered_symbol_range exports() const

Definition SymbolSet.h:145

bool isReexported() const

StringRef - Represent a constant reference to a string, i.e.

SymbolsMapType::const_iterator I

iterator_adaptor_base()=default

A range adaptor for a pair of iterators.

This provides a very simple, boring adaptor for a begin and end iterator into a range type.

ObjCIFSymbolKind

ObjC Interface symbol mappings.

EncodeKind

Mapping of entry types in TextStubs.

@ ObjectiveCInstanceVariable

This is an optimization pass for GlobalISel generic memory operations.

hash_code hash_value(const FixedPointSemantics &Val)

bool operator!=(uint64_t V1, const APInt &V2)

bool operator==(const AddressRangeValuePair &LHS, const AddressRangeValuePair &RHS)

iterator_range< filter_iterator< detail::IterOfRange< RangeT >, PredicateT > > make_filter_range(RangeT &&Range, PredicateT Pred)

Convenience function that takes a range of elements and a predicate, and return a new filter_iterator...

LLVM_ATTRIBUTE_VISIBILITY_DEFAULT AnalysisKey InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key

@ Global

Append to llvm.global_dtors.

hash_code hash_combine(const Ts &...args)

Combine values into a single hash_code.

filter_iterator_impl< WrappedIteratorT, PredicateT, detail::fwd_or_bidi_tag< WrappedIteratorT > > filter_iterator

Defines filter_iterator to a suitable specialization of filter_iterator_impl, based on the underlying...

BumpPtrAllocatorImpl<> BumpPtrAllocator

The standard BumpPtrAllocator which just uses the default template parameters.

Implement std::hash so that hash_code can be used in STL containers.

This struct is a compact representation of a valid (non-zero power of two) alignment.

static SymbolsMapKey getEmptyKey()

Definition SymbolSet.h:34

static SymbolsMapKey getTombstoneKey()

Definition SymbolSet.h:38

static bool isEqual(const SymbolsMapKey &LHS, const SymbolsMapKey &RHS)

Definition SymbolSet.h:47

static unsigned getHashValue(const SymbolsMapKey &Key)

Definition SymbolSet.h:43

An information struct used to provide DenseMap with the various necessary components for a given valu...

Definition SymbolSet.h:122

pointer operator->() const

Definition SymbolSet.h:130

const_symbol_iterator(U &&u)

Definition SymbolSet.h:126

const_symbol_iterator()=default

reference operator*() const

Definition SymbolSet.h:129

Definition SymbolSet.h:26

StringRef Name

Definition SymbolSet.h:28

SymbolsMapKey(MachO::EncodeKind Kind, StringRef Name)

Definition SymbolSet.h:30

MachO::EncodeKind Kind

Definition SymbolSet.h:27