Lines Matching +full:auto +full:- +full:retry
1 //===- ValueSymbolTable.cpp - Implement the ValueSymbolTable class --------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
11 //===----------------------------------------------------------------------===//
15 #include "llvm/Config/llvm-config.h"
34 #ifndef NDEBUG // Only do this in -g mode... in ~ValueSymbolTable()
35 for (const auto &VI : vmap) in ~ValueSymbolTable()
37 << *VI.getValue()->getType() << "' Name = '" << VI.getKeyData() in ~ValueSymbolTable()
47 if (auto *GV = dyn_cast<GlobalValue>(V)) { in makeUniqueName()
51 // On NVPTX we cannot use a dot because PTX only allows [A-Za-z0-9_$] for in makeUniqueName()
54 const Module *M = GV->getParent(); in makeUniqueName()
55 if (!(M && Triple(M->getTargetTriple()).isNVPTX())) in makeUniqueName()
67 // Retry if MaxNameSize has been exceeded. in makeUniqueName()
68 if (MaxNameSize > -1 && UniqueName.size() > (size_t)MaxNameSize) { in makeUniqueName()
69 assert(BaseSize >= UniqueName.size() - (size_t)MaxNameSize && in makeUniqueName()
71 BaseSize -= UniqueName.size() - (size_t)MaxNameSize; in makeUniqueName()
75 auto IterBool = vmap.insert(std::make_pair(UniqueName.str(), V)); in makeUniqueName()
84 assert(V->hasName() && "Can't insert nameless Value into symbol table"); in reinsertValue()
87 if (vmap.insert(V->getValueName())) { in reinsertValue()
88 // LLVM_DEBUG(dbgs() << " Inserted value: " << V->getValueName() << ": " << in reinsertValue()
94 SmallString<256> UniqueName(V->getName().begin(), V->getName().end()); in reinsertValue()
98 V->getValueName()->Destroy(Allocator); in reinsertValue()
101 V->setValueName(VN); in reinsertValue()
105 // LLVM_DEBUG(dbgs() << " Removing Value: " << V->getKeyData() << "\n"); in removeValueName()
110 /// createValueName - This method attempts to create a value name and insert
112 /// auto-renames the name and returns that instead.
114 if (MaxNameSize > -1 && Name.size() > (unsigned)MaxNameSize) in createValueName()
118 auto IterBool = vmap.insert(std::make_pair(Name, V)); in createValueName()
131 // dump - print out the symbol table
135 for (const auto &I : *this) { in dump()
136 // dbgs() << " '" << I->getKeyData() << "' = "; in dump()
137 I.getValue()->dump(); in dump()