From e220c67b7a42e587e9dbca209457ace1a0212f08 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Wed, 14 Aug 2019 12:56:30 +0000 Subject: [PATCH] [ELF] --gdb-index: fix odd variable name cUs after r365730 and replace lower_bound with partition_point. NFC llvm-svn: 368845 --- lld/ELF/SyntheticSections.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp index 817f1e1..e8500de 100644 --- a/lld/ELF/SyntheticSections.cpp +++ b/lld/ELF/SyntheticSections.cpp @@ -2508,7 +2508,7 @@ readAddressAreas(DWARFContext &dwarf, InputSection *sec) { template static std::vector readPubNamesAndTypes(const LLDDwarfObj &obj, - const std::vector &cUs) { + const std::vector &cus) { const DWARFSection &pubNames = obj.getGnuPubnamesSection(); const DWARFSection &pubTypes = obj.getGnuPubtypesSection(); @@ -2520,12 +2520,11 @@ readPubNamesAndTypes(const LLDDwarfObj &obj, // don't know how many compilation units precede this object to compute // cuIndex, we compute (kind << 24 | cuIndexInThisObject) instead, and add // the number of preceding compilation units later. - uint32_t i = - lower_bound(cUs, set.Offset, - [](GdbIndexSection::CuEntry cu, uint32_t offset) { - return cu.cuOffset < offset; - }) - - cUs.begin(); + uint32_t i = llvm::partition_point(cus, + [&](GdbIndexSection::CuEntry cu) { + return cu.cuOffset < set.Offset; + }) - + cus.begin(); for (const DWARFDebugPubTable::Entry &ent : set.Entries) ret.push_back({{ent.Name, computeGdbHash(ent.Name)}, (ent.Descriptor.toBits() << 24) | i}); -- 2.7.4