LLVM: include/llvm/DWP/DWPStringPool.h Source File (original) (raw)

Go to the documentation of this file.

1#ifndef LLVM_DWP_DWPSTRINGPOOL_H

2#define LLVM_DWP_DWPSTRINGPOOL_H

3

7#include

8

9namespace llvm {

11

12 struct CStrDenseMapInfo {

13 static inline const char *getEmptyKey() {

14 return reinterpret_cast<const char *>(~static_cast<uintptr_t>(0));

15 }

16 static inline const char *getTombstoneKey() {

17 return reinterpret_cast<const char *>(~static_cast<uintptr_t>(1));

18 }

19 static unsigned getHashValue(const char *Val) {

20 assert(Val != getEmptyKey() && "Cannot hash the empty key!");

21 assert(Val != getTombstoneKey() && "Cannot hash the tombstone key!");

23 }

24 static bool isEqual(const char *LHS, const char *RHS) {

25 if (RHS == getEmptyKey())

26 return LHS == getEmptyKey();

27 if (RHS == getTombstoneKey())

28 return LHS == getTombstoneKey();

29 return strcmp(LHS, RHS) == 0;

30 }

31 };

32

37

38public:

40

42 assert(strlen(Str) + 1 == Length && "Ensure length hint is correct");

43

44 auto Pair = Pool.insert(std::make_pair(Str, Offset));

45 if (Pair.second) {

46 Out.switchSection(Sec);

49 }

50

51 return Pair.first->second;

52 }

53};

54}

55

56#endif

assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")

This file defines the DenseMap class.

uint64_t getOffset(const char *Str, unsigned Length)

Definition DWPStringPool.h:41

DWPStringPool(MCStreamer &Out, MCSection *Sec)

Definition DWPStringPool.h:39

Instances of this class represent a uniqued identifier for a section in the current translation unit.

Streaming machine code generation interface.

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

This is an optimization pass for GlobalISel generic memory operations.

hash_code hash_value(const FixedPointSemantics &Val)

bool isEqual(const GCNRPTracker::LiveRegSet &S1, const GCNRPTracker::LiveRegSet &S2)