Make the lookup method const.
authorChris Lattner <sabre@nondot.org>
Wed, 31 Dec 2003 07:08:19 +0000 (07:08 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 31 Dec 2003 07:08:19 +0000 (07:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10667 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/SymbolTable.h
lib/VMCore/SymbolTable.cpp

index 850237558101b7c2d293a0d33921deaa7456a487..22a9acd438ce9a2c177f29d7b14dda2907b5cdc3 100644 (file)
@@ -42,7 +42,7 @@ public:
   ~SymbolTable();
 
   // lookup - Returns null on failure...
-  Value *lookup(const Type *Ty, const std::string &name);
+  Value *lookup(const Type *Ty, const std::string &name) const;
 
   // insert - Add named definition to the symbol table...
   inline void insert(Value *N) {
index 8c9e86c003023714c76ac72421f6bf5d809a588b..be1459e70b713261f7f84284a079635a72a0ede2 100644 (file)
@@ -72,10 +72,10 @@ std::string SymbolTable::getUniqueName(const Type *Ty,
 
 
 // lookup - Returns null on failure...
-Value *SymbolTable::lookup(const Type *Ty, const std::string &Name) {
-  iterator I = find(Ty);
+Value *SymbolTable::lookup(const Type *Ty, const std::string &Name) const {
+  const_iterator I = find(Ty);
   if (I != end()) {                      // We have symbols in that plane...
-    type_iterator J = I->second.find(Name);
+    type_const_iterator J = I->second.find(Name);
     if (J != I->second.end())            // and the name is in our hash table...
       return J->second;
   }