forked from OSchip/llvm-project
[lldb][NFC] Use llvm::StringRef instead of C-strings as multimap key
This commit is contained in:
parent
373e2a4f69
commit
a54ef8af89
|
@ -13,7 +13,6 @@
|
||||||
|
|
||||||
#include "lldb/Core/Module.h"
|
#include "lldb/Core/Module.h"
|
||||||
#include "lldb/Core/RichManglingContext.h"
|
#include "lldb/Core/RichManglingContext.h"
|
||||||
#include "lldb/Core/STLUtils.h"
|
|
||||||
#include "lldb/Core/Section.h"
|
#include "lldb/Core/Section.h"
|
||||||
#include "lldb/Symbol/ObjectFile.h"
|
#include "lldb/Symbol/ObjectFile.h"
|
||||||
#include "lldb/Symbol/Symbol.h"
|
#include "lldb/Symbol/Symbol.h"
|
||||||
|
@ -107,10 +106,8 @@ void Symtab::Dump(Stream *s, Target *target, SortOrder sort_order,
|
||||||
// sorted by name. So we must make the ordered symbol list up ourselves.
|
// sorted by name. So we must make the ordered symbol list up ourselves.
|
||||||
s->PutCString(" (sorted by name):\n");
|
s->PutCString(" (sorted by name):\n");
|
||||||
DumpSymbolHeader(s);
|
DumpSymbolHeader(s);
|
||||||
typedef std::multimap<const char *, const Symbol *,
|
|
||||||
CStringCompareFunctionObject>
|
std::multimap<llvm::StringRef, const Symbol *> name_map;
|
||||||
CStringToSymbol;
|
|
||||||
CStringToSymbol name_map;
|
|
||||||
for (const_iterator pos = m_symbols.begin(), end = m_symbols.end();
|
for (const_iterator pos = m_symbols.begin(), end = m_symbols.end();
|
||||||
pos != end; ++pos) {
|
pos != end; ++pos) {
|
||||||
const char *name = pos->GetName().AsCString();
|
const char *name = pos->GetName().AsCString();
|
||||||
|
@ -118,12 +115,10 @@ void Symtab::Dump(Stream *s, Target *target, SortOrder sort_order,
|
||||||
name_map.insert(std::make_pair(name, &(*pos)));
|
name_map.insert(std::make_pair(name, &(*pos)));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (CStringToSymbol::const_iterator pos = name_map.begin(),
|
for (const auto &name_to_symbol : name_map) {
|
||||||
end = name_map.end();
|
const Symbol *symbol = name_to_symbol.second;
|
||||||
pos != end; ++pos) {
|
|
||||||
s->Indent();
|
s->Indent();
|
||||||
pos->second->Dump(s, target, pos->second - &m_symbols[0],
|
symbol->Dump(s, target, symbol - &m_symbols[0], name_preference);
|
||||||
name_preference);
|
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue