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

Alexander Kornienko alexfh at google.com
Fri May 29 03:16:26 PDT 2015


Thank you! Could you close the bug as well?
And maybe you can look at https://llvm.org/bugs/show_bug.cgi?id=22880?

On Fri, May 29, 2015 at 12:04 PM, Szabolcs Sipos <
szabolcs.sipos at ericsson.com> wrote:

> Committed in r238548.
>
>
> ================
> Comment at: clang-tidy/misc/AssertSideEffectCheck.cpp:59
> @@ +58,3 @@
> +    if (const auto *FuncDecl = CExpr->getDirectCallee()) {
> +      const std::string FunctionName =
> FuncDecl->getNameInfo().getAsString();
> +      if (FunctionName == "__builtin_expect") // exceptions come here
> ----------------
> alexfh wrote:
> > 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() ==
> "...")
> >     ...
> Thanks. Changed it as you suggested.
>
> http://reviews.llvm.org/D9959
>
> EMAIL PREFERENCES
>   http://reviews.llvm.org/settings/panel/emailpreferences/
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150529/429e1ff3/attachment.html>


More information about the cfe-commits mailing list