r238526 - Remove dead code.

Nico Weber thakis at chromium.org
Thu May 28 20:15:20 PDT 2015


On Thu, May 28, 2015 at 8:04 PM, Richard Smith <richard at metafoo.co.uk>
wrote:

> On Thu, May 28, 2015 at 7:53 PM, Nico Weber <thakis at chromium.org> wrote:
>
>> On Thu, May 28, 2015 at 4:38 PM, Richard Smith <
>> richard-llvm at metafoo.co.uk> wrote:
>>
>>> Author: rsmith
>>> Date: Thu May 28 18:38:53 2015
>>> New Revision: 238526
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=238526&view=rev
>>> Log:
>>> Remove dead code.
>>>
>>> Modified:
>>>     cfe/trunk/lib/Sema/SemaDeclAttr.cpp
>>>
>>> Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp
>>> URL:
>>> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?rev=238526&r1=238525&r2=238526&view=diff
>>>
>>> ==============================================================================
>>> --- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original)
>>> +++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Thu May 28 18:38:53 2015
>>> @@ -3302,11 +3302,10 @@ static void handleGNUInlineAttr(Sema &S,
>>>  static void handleCallConvAttr(Sema &S, Decl *D, const AttributeList
>>> &Attr) {
>>>    if (hasDeclarator(D)) return;
>>>
>>> -  const FunctionDecl *FD = dyn_cast<FunctionDecl>(D);
>>>    // Diagnostic is emitted elsewhere: here we store the (valid) Attr
>>>    // in the Decl node for syntactic reasoning, e.g., pretty-printing.
>>>    CallingConv CC;
>>> -  if (S.CheckCallingConvAttr(Attr, CC, FD))
>>> +  if (S.CheckCallingConvAttr(Attr, CC, /*FD*/nullptr))
>>>
>>
>> If you say /*FD=*/nullptr, clang-format won't add a space between the
>> comment and what comes after it.
>>
>
> But that wastes just as much horizontal space as adding the space would...
> =)
>

Fair enough :-)

I like the = for bool parameters. For `somefun(/*lowercase*/false)` I
always wonder if this means that false is passed for a parameter named
"lowercase" (which means f would do something with lowercase=false, i.e.
use upper case), or if passing false has the effect of making f use
lowercase (i.e. it's really passing uppercase=false, and the comment is
about the effect of that). With `f(/*lowercase=*/false)` there's no
ambiguity, and if this makes sense for bools, then one might as well do it
elsewhere for consistency.


>
>
>>
>>
>>>      return;
>>>
>>>    if (!isa<ObjCMethodDecl>(D)) {
>>>
>>>
>>> _______________________________________________
>>> cfe-commits mailing list
>>> cfe-commits at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150528/8cd48b1a/attachment.html>


More information about the cfe-commits mailing list