22 #define DEBUG_TYPE "valuesymtab"
26 #ifndef NDEBUG // Only do this in -g mode...
28 dbgs() <<
"Value still in symbol table! Type = '"
29 << *
VI->getValue()->getType() <<
"' Name = '"
30 <<
VI->getKeyData() <<
"'\n";
31 assert(vmap.
empty() &&
"Values remain in symbol table!");
37 void ValueSymbolTable::reinsertValue(
Value* V) {
38 assert(V->
hasName() &&
"Can't insert nameless Value into symbol table");
52 unsigned BaseSize = UniqueName.size();
55 UniqueName.resize(BaseSize);
59 auto IterBool = vmap.
insert(std::make_pair(UniqueName, V));
60 if (IterBool.second) {
69 void ValueSymbolTable::removeValueName(
ValueName *V) {
80 auto IterBool = vmap.
insert(std::make_pair(Name, V));
81 if (IterBool.second) {
84 return &*IterBool.first;
96 auto IterBool = vmap.
insert(std::make_pair(UniqueName, V));
97 if (IterBool.second) {
100 return &*IterBool.first;
112 I->getValue()->dump();
iterator begin()
Get an iterator that from the beginning of the symbol table.
size_t size() const
size - Get the string size.
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.
void dump() const
This function can be used from the debugger to display the content of the symbol table while debuggin...
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.
iterator end()
Get an iterator to the end of the symbol table.
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.
LLVM Value Representation.
void setValueName(ValueName *VN)
StringRef - Represent a constant reference to a string, i.e.