17 #include "llvm/Config/llvm-config.h" 31 #define DEBUG_TYPE "valuesymtab" 35 #ifndef NDEBUG // Only do this in -g mode... 36 for (
const auto &
VI : vmap)
37 dbgs() <<
"Value still in symbol table! Type = '" 38 << *
VI.getValue()->getType() <<
"' Name = '" <<
VI.getKeyData()
40 assert(vmap.empty() &&
"Values remain in symbol table!");
46 unsigned BaseSize = UniqueName.
size();
49 UniqueName.
resize(BaseSize);
51 if (
auto *GV = dyn_cast<GlobalValue>(V)) {
58 const Module *M = GV->getParent();
65 auto IterBool = vmap.
insert(std::make_pair(UniqueName, V));
67 return &*IterBool.first;
73 void ValueSymbolTable::reinsertValue(
Value* V) {
74 assert(V->
hasName() &&
"Can't insert nameless Value into symbol table");
89 ValueName *VN = makeUniqueName(V, UniqueName);
93 void ValueSymbolTable::removeValueName(
ValueName *V) {
104 auto IterBool = vmap.
insert(std::make_pair(Name, V));
105 if (IterBool.second) {
108 return &*IterBool.first;
113 return makeUniqueName(V, UniqueName);
116 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) 121 for (
const auto &
I : *
this) {
123 I.getValue()->dump();
const std::string & getTargetTriple() const
Get the target triple which is a string describing the target host.
This class represents lattice values for constants.
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 Module instance is used to store all the information related to an LLVM module. ...
A raw_ostream that writes to an SmallVector or SmallString.
amdgpu Simplify well known AMD library false Value Value const Twine & Name
void Destroy(AllocatorTy &Allocator)
Destroy - Destroy this StringMapEntry, releasing memory back to the specified allocator.
Triple - Helper class for working with autoconf configuration names.
Module.h This file contains the declarations for the Module class.
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.
StringRef getName() const
Return a constant reference to the value's name.
void dump() const
This function can be used from the debugger to display the content of the symbol table while debuggin...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.
void setValueName(ValueName *VN)
StringRef - Represent a constant reference to a string, i.e.