X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=blobdiff_plain;f=include%2Fllvm%2FDebugInfo%2FDWARF%2FDWARFUnit.h;h=2d05a520b50fd4273d3381fbaea85cf5cf89a23a;hp=5604b93f220587cb1b40bbfcbc4de6debd889332;hb=10f0544c8b7f0871632ad4aa2b274e5a09b7b193;hpb=05f725eb674636cf98ea640cb03bed6615b3f23c diff --git a/include/llvm/DebugInfo/DWARF/DWARFUnit.h b/include/llvm/DebugInfo/DWARF/DWARFUnit.h index 5604b93f220..2d05a520b50 100644 --- a/include/llvm/DebugInfo/DWARF/DWARFUnit.h +++ b/include/llvm/DebugInfo/DWARF/DWARFUnit.h @@ -53,14 +53,6 @@ protected: template class DWARFUnitSection final : public SmallVector, 1>, public DWARFUnitSectionBase { - - struct UnitOffsetComparator { - bool operator()(uint32_t LHS, - const std::unique_ptr &RHS) const { - return LHS < RHS->getNextUnitOffset(); - } - }; - bool Parsed; public: @@ -73,8 +65,11 @@ public: typedef llvm::iterator_range iterator_range; UnitType *getUnitForOffset(uint32_t Offset) const override { - auto *CU = std::upper_bound(this->begin(), this->end(), Offset, - UnitOffsetComparator()); + auto *CU = std::upper_bound( + this->begin(), this->end(), Offset, + [](uint32_t LHS, const std::unique_ptr &RHS) { + return LHS < RHS->getNextUnitOffset(); + }); if (CU != this->end()) return CU->get(); return nullptr;