LLVM: lib/Support/StringSaver.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

10

12

13using namespace llvm;

14

19 P[S.size()] = '\0';

21}

22

26}

27

29 auto R = Unique.insert(S);

30 if (R.second)

31 *R.first = Strings.save(S);

32 return *R.first;

33}

34

38}

This file defines the SmallString class.

LLVM_ATTRIBUTE_RETURNS_NONNULL void * Allocate(size_t Size, Align Alignment)

Allocate space at the specified alignment.

SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...

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

constexpr bool empty() const

empty - Check if the string is empty.

constexpr size_t size() const

size - Get the string size.

constexpr const char * data() const

data - Get a pointer to the start of the string (which may not be null terminated).

StringRef save(const char *S)

Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...

StringRef toStringRef(SmallVectorImpl< char > &Out) const

This returns the twine as a single StringRef if it can be represented as such.

StringRef save(const char *S)

std::pair< iterator, bool > insert(const ValueT &V)

This is an optimization pass for GlobalISel generic memory operations.