diff options
author | Fangrui Song <maskray@google.com> | 2019-06-30 11:19:56 +0000 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2019-06-30 11:19:56 +0000 |
commit | 78ee2fbf984b84db814bf7b3a68e2317e32b1a24 (patch) | |
tree | 83fad2d809aa8d625b95a949b0d36ef9ceeaa2e4 /llvm/lib/ProfileData/InstrProf.cpp | |
parent | 2d2cb77e45d4c9ca34d05f80430e0f9404252980 (diff) | |
download | bcm5719-llvm-78ee2fbf984b84db814bf7b3a68e2317e32b1a24.tar.gz bcm5719-llvm-78ee2fbf984b84db814bf7b3a68e2317e32b1a24.zip |
Cleanup: llvm::bsearch -> llvm::partition_point after r364719
llvm-svn: 364720
Diffstat (limited to 'llvm/lib/ProfileData/InstrProf.cpp')
-rw-r--r-- | llvm/lib/ProfileData/InstrProf.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/ProfileData/InstrProf.cpp b/llvm/lib/ProfileData/InstrProf.cpp index c0b067a490e..510fd9887d9 100644 --- a/llvm/lib/ProfileData/InstrProf.cpp +++ b/llvm/lib/ProfileData/InstrProf.cpp @@ -363,16 +363,15 @@ Error InstrProfSymtab::create(Module &M, bool InLTO) { uint64_t InstrProfSymtab::getFunctionHashFromAddress(uint64_t Address) { finalizeSymtab(); - auto Result = - llvm::bsearch(AddrToMD5Map, [=](std::pair<uint64_t, uint64_t> A) { - return Address <= A.first; - }); + auto It = partition_point(AddrToMD5Map, [=](std::pair<uint64_t, uint64_t> A) { + return A.first < Address; + }); // Raw function pointer collected by value profiler may be from // external functions that are not instrumented. They won't have // mapping data to be used by the deserializer. Force the value to // be 0 in this case. - if (Result != AddrToMD5Map.end() && Result->first == Address) - return (uint64_t)Result->second; + if (It != AddrToMD5Map.end() && It->first == Address) + return (uint64_t)It->second; return 0; } |