27 #define DEBUG_TYPE "valuesymtab"
31 #ifndef NDEBUG // Only do this in -g mode...
32 for (
const auto &
VI : vmap)
33 dbgs() <<
"Value still in symbol table! Type = '"
34 << *
VI.getValue()->getType() <<
"' Name = '" <<
VI.getKeyData()
36 assert(vmap.empty() &&
"Values remain in symbol table!");
42 unsigned BaseSize = UniqueName.
size();
45 UniqueName.
resize(BaseSize);
47 if (isa<GlobalValue>(V))
52 auto IterBool = vmap.
insert(std::make_pair(UniqueName, V));
54 return &*IterBool.first;
60 void ValueSymbolTable::reinsertValue(
Value* V) {
61 assert(V->
hasName() &&
"Can't insert nameless Value into symbol table");
75 ValueName *VN = makeUniqueName(V, UniqueName);
79 void ValueSymbolTable::removeValueName(
ValueName *V) {
90 auto IterBool = vmap.
insert(std::make_pair(Name, V));
91 if (IterBool.second) {
94 return &*IterBool.first;
99 return makeUniqueName(V, UniqueName);
106 for (
const auto &
I : *
this) {
108 I.getValue()->dump();
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds...
StringMapEntry - This is used to represent one value that is inserted into a StringMap.
void remove(MapEntryTy *KeyValue)
remove - Remove the specified key/value pair from the map, but do not erase it.
A raw_ostream that writes to an SmallVector or SmallString.
StringRef getName() const
Return a constant reference to the value's name.
void Destroy(AllocatorTy &Allocator)
Destroy - Destroy this StringMapEntry, releasing memory back to the specified allocator.
ValueName * getValueName() const
bool insert(MapEntryTy *KeyValue)
insert - Insert the specified key/value pair into the map.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
void dump() const
This function can be used from the debugger to display the content of the symbol table while debuggin...
LLVM_ATTRIBUTE_ALWAYS_INLINE size_type size() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.
void setValueName(ValueName *VN)
StringRef - Represent a constant reference to a string, i.e.