[llvm-commits] [hlvm] r38366 - in /hlvm/trunk/hlvm/AST: SymbolTable.cpp SymbolTable.h
Reid Spencer
reid at x10sys.com
Sat Jul 7 17:02:43 PDT 2007
Author: reid
Date: Sat Jul 7 19:02:43 2007
New Revision: 38366
URL: http://llvm.org/viewvc/llvm-project?rev=38366&view=rev
Log:
Move the erase(std::string) method out of line.
Modified:
hlvm/trunk/hlvm/AST/SymbolTable.cpp
hlvm/trunk/hlvm/AST/SymbolTable.h
Modified: hlvm/trunk/hlvm/AST/SymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/AST/SymbolTable.cpp?rev=38366&r1=38365&r2=38366&view=diff
==============================================================================
--- hlvm/trunk/hlvm/AST/SymbolTable.cpp (original)
+++ hlvm/trunk/hlvm/AST/SymbolTable.cpp Sat Jul 7 19:02:43 2007
@@ -45,6 +45,16 @@
return const_cast<ElemType*>(TI->second);
return 0;
}
+
+template<class ElemType> bool
+SymbolTable<ElemType>::erase(const std::string& name)
+{
+ iterator I = map_.find(&name);
+ if (I == map_.end())
+ return false;
+ map_.erase(I);
+ return true;
+}
// Erase a specific type from the symbol table
template<class ElemType>
Modified: hlvm/trunk/hlvm/AST/SymbolTable.h
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/AST/SymbolTable.h?rev=38366&r1=38365&r2=38366&view=diff
==============================================================================
--- hlvm/trunk/hlvm/AST/SymbolTable.h (original)
+++ hlvm/trunk/hlvm/AST/SymbolTable.h Sat Jul 7 19:02:43 2007
@@ -118,7 +118,7 @@
ElemType* erase(iterator TI);
/// Remove a node using a specific key
- bool erase(const std::string& name) { return map_.erase(&name) > 0; }
+ bool erase(const std::string& name);
/// Remove a specific ElemType from the symbol table. This isn't fast, linear
/// search, O(n), algorithm.
More information about the llvm-commits
mailing list