mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-09 11:25:55 +00:00
Add StringMap::lookup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66750 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -303,6 +303,27 @@ public:
|
|||||||
return find(key_start, key_start + Key.size());
|
return find(key_start, key_start + Key.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// lookup - Return the entry for the specified key, or a default
|
||||||
|
/// constructed value if no such entry exists.
|
||||||
|
ValueTy lookup(const char *KeyStart, const char *KeyEnd) const {
|
||||||
|
const_iterator it = find(KeyStart, KeyEnd);
|
||||||
|
if (it != end())
|
||||||
|
return it->second;
|
||||||
|
return ValueTy();
|
||||||
|
}
|
||||||
|
ValueTy lookup(const char *Key) const {
|
||||||
|
const_iterator it = find(Key);
|
||||||
|
if (it != end())
|
||||||
|
return it->second;
|
||||||
|
return ValueTy();
|
||||||
|
}
|
||||||
|
ValueTy lookup(const std::string &Key) const {
|
||||||
|
const_iterator it = find(Key);
|
||||||
|
if (it != end())
|
||||||
|
return it->second;
|
||||||
|
return ValueTy();
|
||||||
|
}
|
||||||
|
|
||||||
ValueTy& operator[](const char *Key) {
|
ValueTy& operator[](const char *Key) {
|
||||||
return GetOrCreateValue(Key, Key + strlen(Key)).getValue();
|
return GetOrCreateValue(Key, Key + strlen(Key)).getValue();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user