diff options
| author | Mehdi Amini <mehdi.amini@apple.com> | 2016-09-17 06:00:02 +0000 |
|---|---|---|
| committer | Mehdi Amini <mehdi.amini@apple.com> | 2016-09-17 06:00:02 +0000 |
| commit | a53d49e1b547a9658be46865d687aeb481b3b32c (patch) | |
| tree | 6af44087ae1c06b8690e2a40259801c80049020b /llvm/tools | |
| parent | 05188a646d9e5c097a9d18fcae397c6312fe786d (diff) | |
| download | bcm5719-llvm-a53d49e1b547a9658be46865d687aeb481b3b32c.tar.gz bcm5719-llvm-a53d49e1b547a9658be46865d687aeb481b3b32c.zip | |
Don't create a SymbolTable in Function when the LLVMContext discards value names (NFC)
The ValueSymbolTable is used to detect name conflict and rename
instructions automatically. This is not needed when the value
names are automatically discarded by the LLVMContext.
No functional change intended, just saving a little bit of memory.
This is a recommit of r281806 after fixing the accessor to return
a pointer instead of a reference and updating all the call-sites.
llvm-svn: 281813
Diffstat (limited to 'llvm/tools')
| -rw-r--r-- | llvm/tools/bugpoint/CrashDebugger.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/tools/bugpoint/CrashDebugger.cpp b/llvm/tools/bugpoint/CrashDebugger.cpp index e7367392337..cdbf57f90e8 100644 --- a/llvm/tools/bugpoint/CrashDebugger.cpp +++ b/llvm/tools/bugpoint/CrashDebugger.cpp @@ -461,8 +461,7 @@ bool ReduceCrashingBlocks::TestBlocks(std::vector<const BasicBlock *> &BBs) { const ValueSymbolTable &GST = M->getValueSymbolTable(); for (unsigned i = 0, e = BlockInfo.size(); i != e; ++i) { Function *F = cast<Function>(GST.lookup(BlockInfo[i].first)); - ValueSymbolTable &ST = F->getValueSymbolTable(); - Value *V = ST.lookup(BlockInfo[i].second); + Value *V = F->getValueSymbolTable()->lookup(BlockInfo[i].second); if (V && V->getType() == Type::getLabelTy(V->getContext())) BBs.push_back(cast<BasicBlock>(V)); } @@ -572,8 +571,7 @@ bool ReduceCrashingConditionals::TestBlocks( const ValueSymbolTable &GST = M->getValueSymbolTable(); for (auto &BI : BlockInfo) { auto *F = cast<Function>(GST.lookup(BI.first)); - ValueSymbolTable &ST = F->getValueSymbolTable(); - Value *V = ST.lookup(BI.second); + Value *V = F->getValueSymbolTable()->lookup(BI.second); if (V && V->getType() == Type::getLabelTy(V->getContext())) BBs.push_back(cast<BasicBlock>(V)); } @@ -666,8 +664,7 @@ bool ReduceSimplifyCFG::TestBlocks(std::vector<const BasicBlock *> &BBs) { const ValueSymbolTable &GST = M->getValueSymbolTable(); for (auto &BI : BlockInfo) { auto *F = cast<Function>(GST.lookup(BI.first)); - ValueSymbolTable &ST = F->getValueSymbolTable(); - Value *V = ST.lookup(BI.second); + Value *V = F->getValueSymbolTable()->lookup(BI.second); if (V && V->getType() == Type::getLabelTy(V->getContext())) BBs.push_back(cast<BasicBlock>(V)); } |

