-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Add support for a declaration attribute @warn for source-level warning group behavior control
#85036
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
Conversation
efeb7d8 to
f2090a1
Compare
b5ce4d2 to
f166258
Compare
|
@swift-ci test |
f346cd4 to
213b207
Compare
09ccd1f to
b22b692
Compare
DougGregor
left a comment
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.
Love this :)
b22b692 to
693aeae
Compare
693aeae to
72a0e52
Compare
@warn for source-level warning group behavior control
72a0e52 to
8019c96
Compare
|
@swift-ci test Linux platform |
9ac4a7f to
e2f23c1
Compare
|
@swift-ci test |
1 similar comment
|
@swift-ci test |
e2f23c1 to
340f38b
Compare
|
@swift-ci test |
40beea2 to
ef00dd8
Compare
|
@swift-ci test |
ef00dd8 to
aa1be67
Compare
|
@swift-ci test |
aa1be67 to
7b269d3
Compare
|
@swift-ci test |
7b269d3 to
fefa937
Compare
|
@swift-ci test |
fefa937 to
5e5cbeb
Compare
|
@swift-ci test |
xymus
left a comment
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 the change to RestrictNonProductionExperimentalFeatures needs to be dropped, besides that this LGTM!
5e5cbeb to
88c04bf
Compare
…ing group behavior control
…nostic Unified across module-wide configuration flags (`-Wwarning`, `-Werror`, etc.) and syntactic configuration attribute `@warn`.
…y attribute argument parsing Otherwise these source file objects linger in the source manager but they refer to a fully-temporary 'ASTContext' which does not exist after parsing is complete, which means they cannot be used in any way and attempting to do so would lead to a crash.
88c04bf to
0a4d352
Compare
|
@swift-ci test |
|
@swift-ci test Windows platform |
This PR contains two changes/commits:
Add parsing for an experimental declaration attribute '@warn' for source-level warning group behavior control. This attribute is gated behind an experimental feature
SourceWarningControl.Implement support for unified warning group behavior queries per-diagnostic-group:
-Wwarningand-Werrorflags, as well asDefaultIgnorediagnostic groups to be captured as aWarningGroupBehaviorRule(as opposed to a priorWarningAsErrorRule) and replace the corresponding diagnostic group ID-indexed bit vectors inDiagnosticEnginewith with a dictionary keyed by the diagnostic group ID with values representing behavior specification rules (such asAsError,AsWarning,Ignored).SwiftWarningControlSwiftSyntax library for a given warning diagnostic's diagnostic group's emission behavior at the diagnostic's source location, as determined by syntactic@warncontrols. (Implemented inASTGen/WarningGroupBehaviorConfiguration.swift).SwiftWarningControlquery as global control inputs. This means the same query will take into account both global warning control rules specified on the command-line, as well as source-location-specific containing@warnattribute controls.ExportedSourceFile, the first query ofwarningGroupBehaviorAtPositionwill result in construction of aWarningControlRegionTreedata-structure which will be cached in theExportedSourceFileit belongs to and re-used for future queries.