-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[clang][Darwin] Remove legacy framework search path logic in the frontend #120149
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
Closed
ldionne
wants to merge
8
commits into
llvm:main
from
ldionne:review/clang-move-search-paths-to-driver
Closed
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ac16507
[clang][Darwin] Remove legacy framework search path logic in the fron…
ldionne 561eb31
Remove CUDA on Mac test since that isn't supported anymore
ldionne 330d2e0
Use macosx15.1 target instead of darwin13.0
ldionne 7cd2067
Add SubFrameworks to Driverkit path test
ldionne 4187453
Make AddFrameworkInclude take same args as AddSearchPath
ldionne 2f01df2
Use -### style tests
ldionne 926996e
Add missing argument generation
ldionne e624fd8
TEST: Try removing -internal-iframework to see the consequences. I wo…
ldionne File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Empty file.
This file contains hidden or 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,26 @@ | ||
| // UNSUPPORTED: system-windows | ||
| // Windows is unsupported because we use the Unix path separator `/` in the test. | ||
|
|
||
| // Add default directories before running clang to check default | ||
| // search paths. | ||
| // RUN: rm -rf %t && mkdir -p %t | ||
| // RUN: cp -R %S/Inputs/MacOSX15.1.sdk %t/ | ||
| // RUN: mkdir -p %t/MacOSX15.1.sdk/System/Library/Frameworks | ||
| // RUN: mkdir -p %t/MacOSX15.1.sdk/System/Library/SubFrameworks | ||
| // RUN: mkdir -p %t/MacOSX15.1.sdk/usr/include | ||
|
|
||
| // RUN: %clang -xc %s -target arm64-apple-macosx15.1 -isysroot %t/MacOSX15.1.sdk -c -### 2>&1 \ | ||
| // RUN: | FileCheck -DSDKROOT=%t/MacOSX15.1.sdk --check-prefix=CHECK-C %s | ||
| // | ||
| // CHECK-C: "-isysroot" "[[SDKROOT]]" | ||
| // CHECK-C: "-internal-externc-isystem" "[[SDKROOT]]/usr/include" | ||
| // CHECK-C: "-internal-iframework" "[[SDKROOT]]/System/Library/Frameworks" | ||
| // CHECK-C: "-internal-iframework" "[[SDKROOT]]/System/Library/SubFrameworks" | ||
|
|
||
| // RUN: %clang -xc++ %s -target arm64-apple-macosx15.1 -isysroot %t/MacOSX15.1.sdk -c -### 2>&1 \ | ||
| // RUN: | FileCheck -DSDKROOT=%t/MacOSX15.1.sdk --check-prefix=CHECK-CXX %s | ||
| // | ||
| // CHECK-CXX: "-isysroot" "[[SDKROOT]]" | ||
| // CHECK-CXX: "-internal-externc-isystem" "[[SDKROOT]]/usr/include" | ||
| // CHECK-CXX: "-internal-iframework" "[[SDKROOT]]/System/Library/Frameworks" | ||
| // CHECK-CXX: "-internal-iframework" "[[SDKROOT]]/System/Library/SubFrameworks" |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we call this
internal-externc-iframeworksince it more closely corresponds tointernal-externc-isystemthaninternal-isystem? Especially its position in the search ordering system -> internal-system -> internal-externc-systemThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it really closer to internal-externc-isystem than internal-isystem though? My understanding is that all of these flags are simply taken (by CC1) in the order in which they appear in the command-line. Is that not what's happening?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, they get bucketed. e.g.
internal-externc-isystemalways comes after-isystemno matter which order the flags are on the command line.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. But there is no notion of "extern C" for framework includes, so IMO it makes more sense to make
-internal-iframework"equivalent" to-internal-isystemthan to-internal-externc-isystem, would you agree?More generally, I guess I am confused about the desired grouping for framework includes. Do we want them to be
IncludeDirGroup::System,IncludeDirGroup::ExternCSystemor something else? IIUC,-iframeworkis already part ofIncludeDirGroup::System. If that's correct, then why is it not sufficient to pass these system framework paths using-iframeworkdirectly in the first place (i.e. why do we even need to introduce-internal-iframeworkin the first place)?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(As a test to make sure I'm not crazy, I just committed e624fd8 which removes
-internal-iframework- I expect that won't work as intended)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the naive question, but where/how is that order determined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That one I don't know, I've only empirically observed by taking a look at
-voutput.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's handled here? https://github.com/llvm/llvm-project/blob/main/clang/lib/Frontend/CompilerInvocation.cpp#L3327
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it's not as straightforward as the paths being added in the particular order, the group matters too. But only sometimes - After goes last, but ExternCSystem and System get mixed in together.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I guess maybe it doesn't matter and
internal-iframeworkis fine, we just needParseHeaderSearchArgsto put it where we want?