aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-05-22 22:53:05 +0000
committerChris Lattner <sabre@nondot.org>2002-05-22 22:53:05 +0000
commit0c51266082b442ef96200c9faa3113f8d3cfdfb6 (patch)
treef6f4aaeda4c690131141d966f7c6f26cbef4e515 /lib
parent8ebccb7f0e41087416706d41d903f54b08c13387 (diff)
downloadexternal_llvm-0c51266082b442ef96200c9faa3113f8d3cfdfb6.zip
external_llvm-0c51266082b442ef96200c9faa3113f8d3cfdfb6.tar.gz
external_llvm-0c51266082b442ef96200c9faa3113f8d3cfdfb6.tar.bz2
Avoid creating the symbol table if we don't need it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2728 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/VMCore/ValueHolderImpl.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/VMCore/ValueHolderImpl.h b/lib/VMCore/ValueHolderImpl.h
index 3f20a17..6c44771 100644
--- a/lib/VMCore/ValueHolderImpl.h
+++ b/lib/VMCore/ValueHolderImpl.h
@@ -16,7 +16,7 @@
template<class ValueSubclass, class ItemParentType, class SymTabType>
void ValueHolder<ValueSubclass,ItemParentType,SymTabType>
::setParent(SymTabType *P) {
- if (Parent) { // Remove all of the items from the old symbol table..
+ if (Parent && !empty()) { // Remove all of the items from the old symtab..
SymbolTable *SymTab = Parent->getSymbolTable();
for (iterator I = begin(); I != end(); ++I)
if ((*I)->hasName()) SymTab->remove(*I);
@@ -24,7 +24,7 @@ void ValueHolder<ValueSubclass,ItemParentType,SymTabType>
Parent = P;
- if (Parent) { // Remove all of the items from the old symbol table..
+ if (Parent && !empty()) { // Add all of the items to the new symtab...
SymbolTable *SymTab = Parent->getSymbolTableSure();
for (iterator I = begin(); I != end(); ++I)
if ((*I)->hasName()) SymTab->insert(*I);