9#ifndef LLVM_MC_STRINGTABLEBUILDER_H
10#define LLVM_MC_STRINGTABLEBUILDER_H
50 bool Finalized =
false;
52 void finalizeStringTable(
bool Optimize);
72 StringPriorityMap[S] = std::max(Priority, StringPriorityMap[S]);
74 auto P = StringIndexMap.try_emplace(S);
76 size_t Start =
alignTo(Size, Alignment);
77 P.first->second = Start;
78 Size = Start + S.
size() + (K !=
RAW);
80 return P.first->second;
107 bool empty()
const {
return StringIndexMap.empty(); }
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file defines CachedHashString and CachedHashStringRef.
This file defines the DenseMap class.
A container which contains a StringRef plus a precomputed hash.
Represent a constant reference to a string, i.e.
LLVM_ABI void finalizeInOrder()
Finalize the string table without reording it.
LLVM_ABI size_t getOffset(CachedHashStringRef S) const
Get the offest of a string in the string table.
LLVM_ABI ~StringTableBuilder()
bool contains(StringRef S) const
Check if a string is contained in the string table.
size_t add(StringRef S, uint8_t Priority=0)
bool contains(CachedHashStringRef S) const
size_t getOffset(StringRef S) const
size_t add(CachedHashStringRef S, uint8_t Priority=0)
Add a string to the builder.
LLVM_ABI void write(raw_ostream &OS) const
LLVM_ABI void finalize()
Analyze the strings and build the final table.
LLVM_ABI StringTableBuilder(Kind K, Align Alignment=Align(1))
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.
constexpr uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
This struct is a compact representation of a valid (non-zero power of two) alignment.