diff options
author | Alex Langford <alangford@apple.com> | 2023-04-28 13:23:55 -0700 |
---|---|---|
committer | Alex Langford <alangford@apple.com> | 2023-05-01 16:17:24 -0700 |
commit | e53e1de57eccda49a93c4368eabbd95d01c5b854 (patch) | |
tree | e5e22891fbc76a1ed10d0024575228a31f24c1c5 /lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp | |
parent | 2a333e9104c855596f64ceb9d7d72a31856ad769 (diff) | |
download | llvm-e53e1de57eccda49a93c4368eabbd95d01c5b854.zip llvm-e53e1de57eccda49a93c4368eabbd95d01c5b854.tar.gz llvm-e53e1de57eccda49a93c4368eabbd95d01c5b854.tar.bz2 |
[lldb] Change ObjectValueDictionary to use a StringMap
llvm has a structure for maps where the key's type is a string. Using
that also means that the keys for OptionValueDictionary don't stick
around forever in ConstString's StringPool (even after they are gone).
The only thing we lose here is ordering: iterating over the map where the keys
are ConstStrings guarantees that we iterate in alphabetical order.
StringMap makes no guarantees about the ordering when you iterate over
the entire map.
Differential Revision: https://reviews.llvm.org/D149482
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp')
-rw-r--r-- | lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp index 515c43e..5a14234 100644 --- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp +++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp @@ -300,20 +300,18 @@ size_t ObjectFilePECOFF::GetModuleSpecifications( if (!module_env_option) { // Step 2: Try with the file name in lowercase. auto name_lower = name.GetStringRef().lower(); - module_env_option = - map->GetValueForKey(ConstString(llvm::StringRef(name_lower))); + module_env_option = map->GetValueForKey(llvm::StringRef(name_lower)); } if (!module_env_option) { // Step 3: Try with the file name with ".debug" suffix stripped. auto name_stripped = name.GetStringRef(); if (name_stripped.consume_back_insensitive(".debug")) { - module_env_option = map->GetValueForKey(ConstString(name_stripped)); + module_env_option = map->GetValueForKey(name_stripped); if (!module_env_option) { // Step 4: Try with the file name in lowercase with ".debug" suffix // stripped. auto name_lower = name_stripped.lower(); - module_env_option = - map->GetValueForKey(ConstString(llvm::StringRef(name_lower))); + module_env_option = map->GetValueForKey(llvm::StringRef(name_lower)); } } } |