16 #include "llvm/Config/llvm-config.h" 30 #define DEBUG_TYPE "valuesymtab" 34 #ifndef NDEBUG // Only do this in -g mode... 35 for (
const auto &
VI : vmap)
36 dbgs() <<
"Value still in symbol table! Type = '" 37 << *
VI.getValue()->getType() <<
"' Name = '" <<
VI.getKeyData()
39 assert(vmap.empty() &&
"Values remain in symbol table!");
45 unsigned BaseSize = UniqueName.
size();
48 UniqueName.
resize(BaseSize);
50 if (
auto *GV = dyn_cast<GlobalValue>(V)) {
57 const Module *M = GV->getParent();
64 auto IterBool = vmap.
insert(std::make_pair(UniqueName, V));
66 return &*IterBool.first;
72 void ValueSymbolTable::reinsertValue(
Value* V) {
73 assert(V->
hasName() &&
"Can't insert nameless Value into symbol table");
88 ValueName *VN = makeUniqueName(V, UniqueName);
92 void ValueSymbolTable::removeValueName(
ValueName *V) {
103 auto IterBool = vmap.
insert(std::make_pair(Name, V));
104 if (IterBool.second) {
107 return &*IterBool.first;
112 return makeUniqueName(V, UniqueName);
115 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) 120 for (
const auto &
I : *
this) {
122 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.
#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 Module instance is used to store all the information related to an LLVM module. ...
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
A raw_ostream that writes to an SmallVector or SmallString.
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.