On Thu, Oct 18, 2012 at 7:22 PM, Douglas Gregor <dgre...@apple.com> wrote:
>
> On Oct 18, 2012, at 4:42 AM, Dmitri Gribenko <griboz...@gmail.com> wrote:
>
>> On Thu, Oct 18, 2012 at 12:58 AM, Fariborz Jahanian <fjahan...@apple.com> 
>> wrote:
>>> Modified: cfe/trunk/include/clang/AST/Comment.h
>>> URL: 
>>> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Comment.h?rev=166130&r1=166129&r2=166130&view=diff
>>> ==============================================================================
>>> --- cfe/trunk/include/clang/AST/Comment.h (original)
>>> +++ cfe/trunk/include/clang/AST/Comment.h Wed Oct 17 16:58:03 2012
>>> @@ -905,9 +905,9 @@
>>>   /// Declaration the comment is attached to.  Should not be NULL.
>>>   const Decl *CommentDecl;
>>>
>>> -  /// Location of this declaration. Not necessarily same as location of
>>> -  /// CommentDecl.
>>> -  SourceLocation Loc;
>>> +  /// CurrentDecl is the declaration for which comment is being put into 
>>> an XML comment.
>>> +  /// Not necessarily same as CommentDecl.
>>> +  const Decl *CurrentDecl;
>>
>> I think that this "CurrentDecl" variable represents (or should
>> represent) some bigger concept than what is stated in the comment.  It
>> should not be related with XML output at all.  And, I don't see (in
>> current code) how it can be different from CommentDecl.
>
> I hope my other message explained it. However, the comment needs to be 
> improved to describe this. Fariborz?

Oh, now I get it -- first CurrentDecl is set to CommentDecl, but after
that CommentDecl gets changed.  That was subtle.

So CommentDecl is the original Decl that the programmer attached the
comment to and CurrentDecl is the same one or some other related Decl?

Maybe some renaming would help?

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <griboz...@gmail.com>*/
_______________________________________________
cfe-commits mailing list
cfe-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to