[llvm] r224360 - [dsymutil] Avoid calling getStringTableData() for each symbol. NFC.
Frederic Riss
friss at apple.com
Tue Dec 16 12:21:34 PST 2014
Author: friss
Date: Tue Dec 16 14:21:34 2014
New Revision: 224360
URL: http://llvm.org/viewvc/llvm-project?rev=224360&view=rev
Log:
[dsymutil] Avoid calling getStringTableData() for each symbol. NFC.
Modified:
llvm/trunk/tools/dsymutil/MachODebugMapParser.cpp
Modified: llvm/trunk/tools/dsymutil/MachODebugMapParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/dsymutil/MachODebugMapParser.cpp?rev=224360&r1=224359&r2=224360&view=diff
==============================================================================
--- llvm/trunk/tools/dsymutil/MachODebugMapParser.cpp (original)
+++ llvm/trunk/tools/dsymutil/MachODebugMapParser.cpp Tue Dec 16 14:21:34 2014
@@ -36,6 +36,7 @@ private:
object::OwningBinary<object::MachOObjectFile> MainOwningBinary;
/// Map of the binary symbol addresses.
StringMap<uint64_t> MainBinarySymbolAddresses;
+ StringRef MainBinaryStrings;
/// The constructed DebugMap.
std::unique_ptr<DebugMap> Result;
@@ -121,6 +122,7 @@ ErrorOr<std::unique_ptr<DebugMap>> MachO
loadMainBinarySymbols();
Result = make_unique<DebugMap>();
const auto &MainBinary = *MainOwningBinary.getBinary();
+ MainBinaryStrings = MainBinary.getStringTableData();
for (const SymbolRef &Symbol : MainBinary.symbols()) {
const DataRefImpl &DRI = Symbol.getRawDataRefImpl();
if (MainBinary.is64Bit())
@@ -142,8 +144,7 @@ void MachODebugMapParser::handleStabSymb
if (!(Type & MachO::N_STAB))
return;
- const MachOObjectFile &MachOBinary = *MainOwningBinary.getBinary();
- const char *Name = &MachOBinary.getStringTableData().data()[StringIndex];
+ const char *Name = &MainBinaryStrings.data()[StringIndex];
// An N_OSO entry represents the start of a new object file description.
if (Type == MachO::N_OSO)
More information about the llvm-commits
mailing list