forked from llvm-mirror/clang
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Modules] Improve diagnostics for incomplete umbrella
One of the -Wincomplete-umbrella warnings diagnoses when a header is present in the directory but it's not present in the umbrella header. Currently, this warning only happens on top level modules; any submodule using an umbrella header does not get this warning. Fix that by also considering the submodules. Differential Revision: https://reviews.llvm.org/D32576 rdar://problem/22623686 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@301597 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
1 parent
c5a1b98
commit 4ef94de
Showing
8 changed files
with
46 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
test/Modules/Inputs/incomplete-umbrella/Foo.framework/Headers/Bar.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#define BAR_PUBLIC 1 |
1 change: 1 addition & 0 deletions
1
test/Modules/Inputs/incomplete-umbrella/Foo.framework/Headers/FooPublic.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// FooPublic.h |
5 changes: 5 additions & 0 deletions
5
test/Modules/Inputs/incomplete-umbrella/Foo.framework/Modules/module.modulemap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
framework module Foo { | ||
umbrella header "FooPublic.h" | ||
requires objc | ||
export * | ||
} |
5 changes: 5 additions & 0 deletions
5
test/Modules/Inputs/incomplete-umbrella/Foo.framework/Modules/module.private.modulemap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
explicit module Foo.Private { | ||
umbrella header "Foo.h" | ||
requires objc | ||
export * | ||
} |
1 change: 1 addition & 0 deletions
1
test/Modules/Inputs/incomplete-umbrella/Foo.framework/PrivateHeaders/Baz.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#define BAZ_PRIVATE 1 |
1 change: 1 addition & 0 deletions
1
test/Modules/Inputs/incomplete-umbrella/Foo.framework/PrivateHeaders/Foo.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// Foo.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// RUN: rm -rf %t | ||
// RUN: not %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -F%S/Inputs/incomplete-umbrella -fsyntax-only %s 2>&1 | FileCheck %s | ||
|
||
#import <Foo/Foo.h> | ||
#import <Foo/Bar.h> | ||
#import <Foo/Baz.h> | ||
@import Foo.Private; | ||
|
||
// CHECK: warning: umbrella header for module 'Foo' does not include header 'Bar.h' | ||
// CHECK: warning: umbrella header for module 'Foo.Private' does not include header 'Baz.h' | ||
int foo() { | ||
int a = BAR_PUBLIC; | ||
int b = BAZ_PRIVATE; | ||
return 0; | ||
} |