Skip to content

[clang][modules] Remove _Private suffix from framework auto-link hints. #77120

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 2 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion clang/lib/Lex/ModuleMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,9 @@ static void inferFrameworkLink(Module *Mod) {
assert(!Mod->isSubFramework() &&
"Can only infer linking for top-level frameworks");

Mod->LinkLibraries.push_back(Module::LinkLibrary(Mod->Name,
StringRef FrameworkName(Mod->Name);
FrameworkName.consume_back("_Private");
Mod->LinkLibraries.push_back(Module::LinkLibrary(FrameworkName.str(),
/*IsFramework=*/true));
}

Expand Down

This file was deleted.

This file was deleted.

16 changes: 0 additions & 16 deletions clang/test/Modules/autolinkTBD.m

This file was deleted.

25 changes: 25 additions & 0 deletions clang/test/Modules/autolink_private_module.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Test that autolink hints for frameworks don't use the private module name.
// RUN: rm -rf %t && mkdir %t
// RUN: split-file %s %t

// RUN: %clang_cc1 -emit-llvm -o - -fmodules-cache-path=%t/ModuleCache -fmodules -fimplicit-module-maps -F %t/Frameworks %t/test.m | FileCheck %s

// CHECK: !{!"-framework", !"Autolink"}
// CHECK-NOT: !{!"-framework", !"Autolink_Private"}

//--- test.m
#include <Autolink/Autolink.h>
#include <Autolink/Autolink_Private.h>

//--- Frameworks/Autolink.framework/Headers/Autolink.h
void public();

//--- Frameworks/Autolink.framework/PrivateHeaders/Autolink_Private.h
void private();

//--- Frameworks/Autolink.framework/Modules/module.modulemap
framework module Autolink { header "Autolink.h"}

//--- Frameworks/Autolink.framework/Modules/module.private.modulemap
framework module Autolink_Private { header "Autolink_Private.h"}