Skip to content

[Diagnostics] Hooking up remarks emitted from Clang. #25585

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 1 commit into from
Jun 18, 2019

Conversation

vguerra
Copy link
Contributor

@vguerra vguerra commented Jun 18, 2019

Now that Swift support remarks ClangImporter we pass them
to the Clang diagnostic producer instead of ignoring them.

Fixes SR-10915

Now that Swift support remarks ClangImporter we pass them
to the Clang diagnostic producer instead of ignoring them.

Fixes SR-10915
Copy link
Contributor

@jrose-apple jrose-apple left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thanks, @vguerra.

@jrose-apple
Copy link
Contributor

@swift-ci Please smoke test

@jrose-apple jrose-apple self-assigned this Jun 18, 2019
@jrose-apple jrose-apple merged commit 96ddf44 into swiftlang:master Jun 18, 2019
vguerra added a commit to vguerra/swift that referenced this pull request Jun 19, 2019
Follow up on fix for SR-10915 where I forgot to undefine the REMARK
macro.

ref: swiftlang#25585
@vguerra
Copy link
Contributor Author

vguerra commented Jun 19, 2019

Thank you for the quick review @jrose-apple.

Just a small follow up on this: #25603

@compnerd
Copy link
Member

@vguerra
Copy link
Contributor Author

vguerra commented Jun 19, 2019

hello @compnerd .. will have a look at it, sorry for that :/

should I revert in the mean-time?

@jrose-apple
Copy link
Contributor

Looking at the failure:

D:\a\1\s\swift\test\ClangImporter\remarks.swift:6:16: error: CHECK-NEXT: is not on the line after the previous match
// CHECK-NEXT: remark: importing module 'Requires'
               ^
<stdin>:9:14: note: 'next' match was here
<unknown>:0: remark: importing module 'Requires' from 'BUILD_DIR/swift-test-results/x86_64-unknown-windows-msvc/clang-module-cache/3HA27GCPD6Q8U/Requires-1XF48MFV80W6X.pcm'
             ^
<stdin>:1:51: note: previous match ended here
<unknown>:0: remark: importing module 'SwiftShims' from 'BUILD_DIR/swift-test-results/x86_64-unknown-windows-msvc/clang-module-cache/3HA27GCPD6Q8U/SwiftShims-2VP0I72R3U78H.pcm'

<stdin>:2:1: note: non-matching line after previous match is here
<unknown>:0: remark: importing module 'visualc' into 'SwiftShims' from 'BUILD_DIR/swift-test-results/x86_64-unknown-windows-msvc/clang-module-cache/3HA27GCPD6Q8U/visualc-12GK0U120S9VQ.pcm'
^

I think it'd be okay to make the test a little looser by dropping the "NEXT". We just want to make sure remarks are printed; the precise remarks aren't so important.

(@compnerd, is it really okay to import visualc into SwiftShims, though? The point of SwiftShims is usually to avoid a cycle with the platform overlay.)

@compnerd
Copy link
Member

@vguerra - I think I would rather fix forward, dropping the -NEXT suffix.
@jrose-apple - that gets pulled in since visualc provides io.h. If there is a way to avoid that, I would be happy to see that cycle broken.

@jrose-apple
Copy link
Contributor

SwiftShims deliberately "redeclares" a bunch of things normally in the C standard library to avoid these.

@vguerra
Copy link
Contributor Author

vguerra commented Jun 19, 2019

thanks for pushing the fix @compnerd ... indeed dropping the -NEXT was the easiest.

@compnerd
Copy link
Member

Right, but, it does still include headers and that seems to be pulling in the visualc module. I think that it may be due to the io.h inclusion?

@jrose-apple
Copy link
Contributor

I mean, we didn't write the Windows includes. Feel free to change them to do the same sort of redeclaring rather than including headers.

@compnerd
Copy link
Member

compnerd commented Jun 19, 2019

Will do; at the very least, I will create a SR to track this item.
Edit: https://bugs.swift.org/browse/SR-10971

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants