]> granicus.if.org Git - llvm/commitdiff
[llvm-readobj] Delete and inline relocAddressLess
authorFangrui Song <maskray@google.com>
Thu, 2 May 2019 10:49:27 +0000 (10:49 +0000)
committerFangrui Song <maskray@google.com>
Thu, 2 May 2019 10:49:27 +0000 (10:49 +0000)
It is used only once in COFFDumper.cpp. Deleting it from the public
interface seems better.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359775 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-readobj/COFFDumper.cpp
tools/llvm-readobj/llvm-readobj.cpp
tools/llvm-readobj/llvm-readobj.h

index e8db76f791c7b8233cd124c0c4dc8c2428f28be3..62f2fc56b56691a338fe45a2fa70dfe307d8458c 100644 (file)
@@ -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();
+    });
   }
 }
 
index d4feda4cc64ac91f25365cf34d81d7e96240bc69..89fddc7233cde855ad2b9d43b808b48343133d98 100644 (file)
@@ -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) {
index 500d7295e69468ae0e3fb3bc78d654da85560e5f..54318b2967694917cf251943770956d6f3d74002 100644 (file)
@@ -43,8 +43,6 @@ namespace llvm {
     OS.flush();
     reportError(Buf);
   }
-  bool relocAddressLess(object::RelocationRef A,
-                        object::RelocationRef B);
 } // namespace llvm
 
 namespace opts {