[llvm] r359775 - [llvm-readobj] Delete and inline relocAddressLess
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Thu May 2 03:49:27 PDT 2019
Author: maskray
Date: Thu May 2 03:49:27 2019
New Revision: 359775
URL: http://llvm.org/viewvc/llvm-project?rev=359775&view=rev
Log:
[llvm-readobj] Delete and inline relocAddressLess
It is used only once in COFFDumper.cpp. Deleting it from the public
interface seems better.
Modified:
llvm/trunk/tools/llvm-readobj/COFFDumper.cpp
llvm/trunk/tools/llvm-readobj/llvm-readobj.cpp
llvm/trunk/tools/llvm-readobj/llvm-readobj.h
Modified: llvm/trunk/tools/llvm-readobj/COFFDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/COFFDumper.cpp?rev=359775&r1=359774&r2=359775&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-readobj/COFFDumper.cpp (original)
+++ llvm/trunk/tools/llvm-readobj/COFFDumper.cpp Thu May 2 03:49:27 2019
@@ -592,7 +592,9 @@ void COFFDumper::cacheRelocations() {
RelocMap[Section].push_back(Reloc);
// Sort relocations by address.
- llvm::sort(RelocMap[Section], relocAddressLess);
+ llvm::sort(RelocMap[Section], [](RelocationRef L, RelocationRef R) {
+ return L.getOffset() < R.getOffset();
+ });
}
}
Modified: llvm/trunk/tools/llvm-readobj/llvm-readobj.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/llvm-readobj.cpp?rev=359775&r1=359774&r2=359775&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-readobj/llvm-readobj.cpp (original)
+++ llvm/trunk/tools/llvm-readobj/llvm-readobj.cpp Thu May 2 03:49:27 2019
@@ -386,10 +386,6 @@ void error(std::error_code EC) {
reportError(EC.message());
}
-bool relocAddressLess(RelocationRef a, RelocationRef b) {
- return a.getOffset() < b.getOffset();
-}
-
} // namespace llvm
static void reportError(StringRef Input, Error Err) {
Modified: llvm/trunk/tools/llvm-readobj/llvm-readobj.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/llvm-readobj.h?rev=359775&r1=359774&r2=359775&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-readobj/llvm-readobj.h (original)
+++ llvm/trunk/tools/llvm-readobj/llvm-readobj.h Thu May 2 03:49:27 2019
@@ -43,8 +43,6 @@ namespace llvm {
OS.flush();
reportError(Buf);
}
- bool relocAddressLess(object::RelocationRef A,
- object::RelocationRef B);
} // namespace llvm
namespace opts {
More information about the llvm-commits
mailing list