aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/TextAPI/InterfaceFile.cpp
diff options
context:
space:
mode:
authorCyndy Ishida <cyndy_ishida@apple.com>2023-08-29 14:13:07 -0700
committerCyndy Ishida <cyndy_ishida@apple.com>2023-08-30 07:42:52 -0700
commit1a0d6992aeeaff7a70adfa5079fc9c64ef156b48 (patch)
tree5b9d974c2f172374c4831a600c133cbc994a0437 /llvm/lib/TextAPI/InterfaceFile.cpp
parentbfe6bc05cde3ba2ff0202a40de0c6a2f66a2d6f8 (diff)
downloadllvm-1a0d6992aeeaff7a70adfa5079fc9c64ef156b48.zip
llvm-1a0d6992aeeaff7a70adfa5079fc9c64ef156b48.tar.gz
llvm-1a0d6992aeeaff7a70adfa5079fc9c64ef156b48.tar.bz2
[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
Diffstat (limited to 'llvm/lib/TextAPI/InterfaceFile.cpp')
-rw-r--r--llvm/lib/TextAPI/InterfaceFile.cpp14
1 files changed, 7 insertions, 7 deletions
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<Target, std::string> &LHS,
- Target RHS) { return LHS.first < RHS; });
+ using RPathEntryT = const std::pair<Target, std::string>;
+ 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) {