
We used to advertise private modules to be declared as submodules (Foo.Private). This has proven to not scale well since private headers might carry several dependencies, introducing unwanted content into the main module and often causing dep cycles. Change the canonical way to name it to Foo_Private, forcing private modules as top level ones, and provide warnings under -Wprivate-module to suggest fixes for other private naming. Update documentation to reflect that. rdar://problem/31173501 llvm-svn: 321337
37 lines
1.6 KiB
Objective-C
37 lines
1.6 KiB
Objective-C
// RUN: rm -rf %t
|
|
// Build PCH using A, with private submodule A.Private
|
|
// RUN: %clang_cc1 -verify -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -F %S/Inputs/implicit-private-with-submodule -emit-pch -o %t-A.pch %s -DNO_AT_IMPORT
|
|
|
|
// RUN: rm -rf %t
|
|
// Build PCH using A, with private submodule A.Private, check the fixit
|
|
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -F %S/Inputs/implicit-private-with-submodule -emit-pch -o %t-A.pch %s -fdiagnostics-parseable-fixits -DNO_AT_IMPORT 2>&1 | FileCheck %s
|
|
|
|
// RUN: rm -rf %t
|
|
// RUN: %clang_cc1 -verify -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -F %S/Inputs/implicit-private-with-submodule -emit-pch -o %t-A.pch %s -DUSE_AT_IMPORT_PRIV
|
|
// RUN: rm -rf %t
|
|
// RUN: %clang_cc1 -verify -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -F %S/Inputs/implicit-private-with-submodule -emit-pch -o %t-A.pch %s -DUSE_AT_IMPORT_BOTH
|
|
|
|
// expected-warning@Inputs/implicit-private-with-submodule/A.framework/Modules/module.private.modulemap:1{{private submodule 'A.Private' in private module map, expected top-level module}}
|
|
// expected-note@Inputs/implicit-private-with-submodule/A.framework/Modules/module.private.modulemap:1{{rename 'A.Private' to ensure it can be found by name}}
|
|
// CHECK: fix-it:"{{.*}}module.private.modulemap":{1:20-1:27}:"A_Private"
|
|
|
|
#ifndef HEADER
|
|
#define HEADER
|
|
|
|
#ifdef NO_AT_IMPORT
|
|
#import "A/aprivate.h"
|
|
#endif
|
|
|
|
#ifdef USE_AT_IMPORT_PRIV
|
|
@import A.Private;
|
|
#endif
|
|
|
|
#ifdef USE_AT_IMPORT_BOTH
|
|
@import A;
|
|
@import A.Private;
|
|
#endif
|
|
|
|
const int *y = &APRIVATE;
|
|
|
|
#endif
|