From 4e4e4a190fb7c74453994935c843b09cc682f4bb Mon Sep 17 00:00:00 2001 From: Cyndy Ishida Date: Tue, 18 Mar 2025 22:12:45 -0700 Subject: [TextAPI] Track RPaths in the order its provided via command line. (#131665) RPaths are basically search paths for how to load dependent libraries. The order they appear is the order the linker will search, we should preserve that order in tbd files. * Additionally add this level of detection to llvm-readtapi. resolves: rdar://145603347 --- llvm/lib/TextAPI/InterfaceFile.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'llvm/lib/TextAPI/InterfaceFile.cpp') diff --git a/llvm/lib/TextAPI/InterfaceFile.cpp b/llvm/lib/TextAPI/InterfaceFile.cpp index ce2feb65c9ec..e2253723659e 100644 --- a/llvm/lib/TextAPI/InterfaceFile.cpp +++ b/llvm/lib/TextAPI/InterfaceFile.cpp @@ -59,14 +59,11 @@ void InterfaceFile::addRPath(StringRef RPath, const Target &InputTarget) { return; 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()) && (*Iter == Entry)) + if (is_contained(RPaths, Entry)) return; - RPaths.emplace(Iter, Entry); + RPaths.emplace_back(Entry); } void InterfaceFile::addTarget(const Target &Target) { -- cgit v1.2.3