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

Go to the documentation of this file.

1

2

3

4

5

6

7

8

10

12

13using namespace llvm;

14

16 char *P = Alloc.Allocate<char>(S.size() + 1);

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

21}

22

27

29 auto R = Unique.insert(S);

30 if (R.second)

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

32 return *R.first;

33}

34

This file defines the SmallString class.

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)

This is an optimization pass for GlobalISel generic memory operations.