From 9f85b269f85717a529434a0ce2c8f4eb91d0044b Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Fri, 16 Oct 2015 23:53:12 +0000 Subject: [PATCH] Speculative fix for GCC build git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250585 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llvm-symbolizer/LLVMSymbolize.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/tools/llvm-symbolizer/LLVMSymbolize.cpp b/tools/llvm-symbolizer/LLVMSymbolize.cpp index ae164b07b96..51bb965b8df 100644 --- a/tools/llvm-symbolizer/LLVMSymbolize.cpp +++ b/tools/llvm-symbolizer/LLVMSymbolize.cpp @@ -92,12 +92,18 @@ ModuleInfo::ModuleInfo(ObjectFile *Obj, DIContext *DICtx) } } +namespace { +struct OffsetNamePair { + uint32_t Offset; + StringRef Name; + bool operator<(const OffsetNamePair &R) const { + return Offset < R.Offset; + } +}; +} + void ModuleInfo::addCoffExportSymbols(const COFFObjectFile *CoffObj) { // Get all export names and offsets. - struct OffsetNamePair { - uint32_t Offset; - StringRef Name; - }; std::vector ExportSyms; for (const ExportDirectoryEntryRef &Ref : CoffObj->export_directories()) { StringRef Name; @@ -110,10 +116,7 @@ void ModuleInfo::addCoffExportSymbols(const COFFObjectFile *CoffObj) { return; // Sort by ascending offset. - array_pod_sort(ExportSyms.begin(), ExportSyms.end(), - [](const OffsetNamePair *L, const OffsetNamePair *R) -> int { - return L->Offset - R->Offset; - }); + array_pod_sort(ExportSyms.begin(), ExportSyms.end()); // Approximate the symbol sizes by assuming they run to the next symbol. // FIXME: This assumes all exports are functions. -- 2.34.1