From 1a0d6992aeeaff7a70adfa5079fc9c64ef156b48 Mon Sep 17 00:00:00 2001 From: Cyndy Ishida Date: Tue, 29 Aug 2023 14:13:07 -0700 Subject: [llvm][ReadTAPI] Add & fix rpath comparison checks * Check and emit out differences in rpath inputs * Prevent rpaths from being overwritten * Capture file path for tbd-v5 --- llvm/lib/TextAPI/InterfaceFile.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'llvm/lib/TextAPI/InterfaceFile.cpp') diff --git a/llvm/lib/TextAPI/InterfaceFile.cpp b/llvm/lib/TextAPI/InterfaceFile.cpp index d324e30..f1c6add 100644 --- a/llvm/lib/TextAPI/InterfaceFile.cpp +++ b/llvm/lib/TextAPI/InterfaceFile.cpp @@ -48,16 +48,16 @@ void InterfaceFile::addParentUmbrella(const Target &Target_, StringRef Parent) { } void InterfaceFile::addRPath(const Target &InputTarget, StringRef RPath) { - auto Iter = lower_bound(RPaths, InputTarget, - [](const std::pair &LHS, - Target RHS) { return LHS.first < RHS; }); + using RPathEntryT = const std::pair; + RPathEntryT Entry(InputTarget, RPath); + auto Iter = + lower_bound(RPaths, Entry, + [](RPathEntryT &LHS, RPathEntryT &RHS) { return LHS < RHS; }); - if ((Iter != RPaths.end()) && !(InputTarget < Iter->first)) { - Iter->second = std::string(RPath); + if ((Iter != RPaths.end()) && (*Iter == Entry)) return; - } - RPaths.emplace(Iter, InputTarget, std::string(RPath)); + RPaths.emplace(Iter, Entry); } void InterfaceFile::addTarget(const Target &Target) { -- cgit v1.1