diff --git a/include/llvm/SymbolTable.h b/include/llvm/SymbolTable.h index 85023755810..22a9acd438c 100644 --- a/include/llvm/SymbolTable.h +++ b/include/llvm/SymbolTable.h @@ -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) { diff --git a/lib/VMCore/SymbolTable.cpp b/lib/VMCore/SymbolTable.cpp index 8c9e86c0030..be1459e70b7 100644 --- a/lib/VMCore/SymbolTable.cpp +++ b/lib/VMCore/SymbolTable.cpp @@ -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; }