This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Fix for llvm.org/PR23355
ClosedPublic

Authored by eszasip on May 24 2015, 6:33 AM.

Details

Reviewers
alexfh
Summary

misc-static-assert now recognizes __builtin_expect based assert macros.

I also added __builtin_expect to the white list of misc-assert-side-effect.

Diff Detail

Event Timeline

eszasip updated this revision to Diff 26379.May 24 2015, 6:33 AM
eszasip retitled this revision from to [clang-tidy] Fix for llvm.org/PR23355.
eszasip updated this object.
eszasip edited the test plan for this revision. (Show Details)
eszasip added a reviewer: alexfh.
eszasip added a subscriber: Unknown Object (MLST).
alexfh accepted this revision.May 26 2015, 7:35 AM
alexfh edited edge metadata.

Thanks!

Looks good with one nit.

clang-tidy/misc/AssertSideEffectCheck.cpp
59

There's no need to use getAsString(), as you're only checking whether it's a specific unqualified name. I'd try to use the more effective version: getName(). Something along the lines of:

if (FuncDecl->getDeclName().isIdentifier() && FuncDecl->getName() == "...") 
  ...
This revision is now accepted and ready to land.May 26 2015, 7:35 AM
eszasip closed this revision.May 29 2015, 3:04 AM

Committed in r238548.

clang-tidy/misc/AssertSideEffectCheck.cpp
59

Thanks. Changed it as you suggested.