forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 341
Strip out -fno-implicit-modules and friends from ClangImporter options #8527
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
adrian-prantl
merged 1 commit into
swiftlang:swift/release/6.0
from
adrian-prantl:124699949
Apr 4, 2024
Merged
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions
4
lldb/test/API/lang/swift/clangimporter/fmodule_flags/Makefile
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,4 @@ | ||
SWIFT_SOURCES := main.swift | ||
SWIFTFLAGS_EXTRAS = -parse-stdlib -Xcc -DMARKER1 -Xcc -fno-implicit-modules -Xcc -fno-implicit-module-maps -Xcc -DMARKER2 | ||
|
||
include Makefile.rules |
25 changes: 25 additions & 0 deletions
25
lldb/test/API/lang/swift/clangimporter/fmodule_flags/TestSwiftFModuleFlags.py
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,25 @@ | ||
import lldb | ||
from lldbsuite.test.lldbtest import * | ||
from lldbsuite.test.decorators import * | ||
import lldbsuite.test.lldbutil as lldbutil | ||
import os | ||
import unittest2 | ||
|
||
class TestSwiftFModuleFlags(TestBase): | ||
@skipIfDarwinEmbedded | ||
@swiftTest | ||
def test(self): | ||
"""Test that -fmodule flags get stripped out""" | ||
self.build() | ||
log = self.getBuildArtifact("types.log") | ||
self.runCmd('log enable lldb types -f "%s"' % log) | ||
target, process, thread, bkpt = lldbutil.run_to_name_breakpoint( | ||
self, 'main') | ||
self.expect("expression 1", substrs=["1"]) | ||
|
||
# Scan through the types log. | ||
self.filecheck('platform shell cat "%s"' % log, __file__) | ||
# CHECK: -DMARKER1 | ||
# CHECK-NOT: -fno-implicit-modules | ||
# CHECK-NOT: -fno-implicit-module-maps | ||
# CHECK: -DMARKER2 |
1 change: 1 addition & 0 deletions
1
lldb/test/API/lang/swift/clangimporter/fmodule_flags/main.swift
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 @@ | ||
// This space left intentionally blank. |
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.
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.
should we put this behind a setting? could it cause issues?
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.
If we really need to we can replace with the extra clang flags setting already.
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 there should be no need to add another setting to control this.
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'm worried that by doing this to fix the one bug report, we may create new unforeseen bugs. However, that's entirely speculative on my part. I guess we'll find out whether allowing implicit modules in the presence of explicit modules has any gotchas.
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 don't think this will do much to fix that specific bug, but I do think that the target's build settings should not control how LLDB imports modules.