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)

defect
Not set
normal

Tracking

(firefox53 fixed)

RESOLVED FIXED
mozilla53
Tracking Status
firefox53 --- fixed

People

(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)

References

Details

Attachments

(1 file)

No description provided.
Attachment #8819707 - Flags: review?(michael)
Blocks: 1324315
Assignee: nobody → ehsan
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 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?
(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
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
Product: Core → Firefox Build System
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: