Skip to content

[TextAPI] Skip adding empty attributes #77400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions llvm/lib/TextAPI/InterfaceFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,23 @@ void InterfaceFileRef::addTarget(const Target &Target) {

void InterfaceFile::addAllowableClient(StringRef InstallName,
const Target &Target) {
if (InstallName.empty())
return;
auto Client = addEntry(AllowableClients, InstallName);
Client->addTarget(Target);
}

void InterfaceFile::addReexportedLibrary(StringRef InstallName,
const Target &Target) {
if (InstallName.empty())
return;
auto Lib = addEntry(ReexportedLibraries, InstallName);
Lib->addTarget(Target);
}

void InterfaceFile::addParentUmbrella(const Target &Target_, StringRef Parent) {
if (Parent.empty())
return;
auto Iter = lower_bound(ParentUmbrellas, Target_,
[](const std::pair<Target, std::string> &LHS,
Target RHS) { return LHS.first < RHS; });
Expand All @@ -48,6 +54,8 @@ void InterfaceFile::addParentUmbrella(const Target &Target_, StringRef Parent) {
}

void InterfaceFile::addRPath(const Target &InputTarget, StringRef RPath) {
if (RPath.empty())
return;
using RPathEntryT = const std::pair<Target, std::string>;
RPathEntryT Entry(InputTarget, RPath);
auto Iter =
Expand Down