[llvm] r250585 - Speculative fix for GCC build
Reid Kleckner via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 16 16:53:12 PDT 2015
Author: rnk
Date: Fri Oct 16 18:53:12 2015
New Revision: 250585
URL: http://llvm.org/viewvc/llvm-project?rev=250585&view=rev
Log:
Speculative fix for GCC build
Modified:
llvm/trunk/tools/llvm-symbolizer/LLVMSymbolize.cpp
Modified: llvm/trunk/tools/llvm-symbolizer/LLVMSymbolize.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-symbolizer/LLVMSymbolize.cpp?rev=250585&r1=250584&r2=250585&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-symbolizer/LLVMSymbolize.cpp (original)
+++ llvm/trunk/tools/llvm-symbolizer/LLVMSymbolize.cpp Fri Oct 16 18:53:12 2015
@@ -92,12 +92,18 @@ ModuleInfo::ModuleInfo(ObjectFile *Obj,
}
}
+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<OffsetNamePair> ExportSyms;
for (const ExportDirectoryEntryRef &Ref : CoffObj->export_directories()) {
StringRef Name;
@@ -110,10 +116,7 @@ void ModuleInfo::addCoffExportSymbols(co
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.
More information about the llvm-commits
mailing list