Closed
Bug 1324325
Opened 8 years ago
Closed 8 years ago
Port the muse-use check to the clang-tidy compatible framework
Categories
(Developer Infrastructure :: Source Code Analysis, defect)
Developer Infrastructure
Source Code Analysis
Tracking
(firefox53 fixed)
RESOLVED
FIXED
mozilla53
Tracking | Status | |
---|---|---|
firefox53 | --- | fixed |
People
(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)
References
Details
Attachments
(1 file)
(deleted),
patch
|
nika
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Comment 1•8 years ago
|
||
Attachment #8819707 -
Flags: review?(michael)
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → ehsan
Comment 2•8 years ago
|
||
Comment on attachment 8819707 [details] [diff] [review]
Port the muse-use check to the clang-tidy compatible framework
Review of attachment 8819707 [details] [diff] [review]:
-----------------------------------------------------------------
s/muse-use/must-use
::: build/clang-plugin/MustUseChecker.cpp
@@ +20,5 @@
> +}
> +
> +void MustUseChecker::check(
> + const MatchFinder::MatchResult &Result) {
> + if (auto SC = Result.Nodes.getNodeAs<SwitchCase>("switchcase")) {
I wonder whether or not this would be more efficient as:
auto S = Result.Nodes.getNodeAs<Stmt>("stmt");
if (auto SC = dyn_cast<SwitchCase>(S)) { ...}
where there is only one matcher in the earlier case, which always binds the stmt matched to "stmt".
I think that this setup is probably cleaner though, so I'd say just stick with this.
Attachment #8819707 -
Flags: review?(michael) → review+
Comment 3•8 years ago
|
||
Comment on attachment 8819707 [details] [diff] [review]
Port the muse-use check to the clang-tidy compatible framework
Review of attachment 8819707 [details] [diff] [review]:
-----------------------------------------------------------------
::: build/clang-plugin/CustomTypeAnnotation.cpp
@@ +18,4 @@
> CustomTypeAnnotation NonParam =
> CustomTypeAnnotation("moz_non_param", "non-param");
>
> void CustomTypeAnnotation::dumpAnnotationReason(DiagnosticsEngine &Diag,
I just remembered. After this patch, this method isn't used anymore, is it? Can you remove it?
Comment 4•8 years ago
|
||
(In reply to Michael Layzell [:mystor] from comment #3)
> Comment on attachment 8819707 [details] [diff] [review]
> Port the muse-use check to the clang-tidy compatible framework
>
> Review of attachment 8819707 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: build/clang-plugin/CustomTypeAnnotation.cpp
> @@ +18,4 @@
> > CustomTypeAnnotation NonParam =
> > CustomTypeAnnotation("moz_non_param", "non-param");
> >
> > void CustomTypeAnnotation::dumpAnnotationReason(DiagnosticsEngine &Diag,
>
> I just remembered. After this patch, this method isn't used anymore, is it?
> Can you remove it?
Nevermind, you remove it in bug 1324328.
Pushed by eakhgari@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/0da90da58ab7
Port the muse-use check to the clang-tidy compatible framework; r=mystor
Comment 6•8 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox53:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
Updated•7 years ago
|
Product: Core → Firefox Build System
Updated•2 years ago
|
Product: Firefox Build System → Developer Infrastructure
You need to log in
before you can comment on or make changes to this bug.
Description
•