[cfe-commits] r165972 - in /cfe/trunk: include/clang/AST/Comment.h lib/AST/Comment.cpp test/Index/overriding-ftemplate-comments.cpp test/Index/overriding-method-comments.mm tools/libclang/CXComment.cpp

Fariborz Jahanian fjahanian at apple.com
Mon Oct 15 13:57:52 PDT 2012


Author: fjahanian
Date: Mon Oct 15 15:57:52 2012
New Revision: 165972

URL: http://llvm.org/viewvc/llvm-project?rev=165972&view=rev
Log:
Fixes location of overriding declaration with no comment
of their own.

Modified:
    cfe/trunk/include/clang/AST/Comment.h
    cfe/trunk/lib/AST/Comment.cpp
    cfe/trunk/test/Index/overriding-ftemplate-comments.cpp
    cfe/trunk/test/Index/overriding-method-comments.mm
    cfe/trunk/tools/libclang/CXComment.cpp

Modified: cfe/trunk/include/clang/AST/Comment.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Comment.h?rev=165972&r1=165971&r2=165972&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Comment.h (original)
+++ cfe/trunk/include/clang/AST/Comment.h Mon Oct 15 15:57:52 2012
@@ -905,6 +905,10 @@
   /// 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;
+  
   /// Parameters that can be referenced by \\param if \c CommentDecl is something
   /// that we consider a "function".
   ArrayRef<const ParmVarDecl *> ParamVars;

Modified: cfe/trunk/lib/AST/Comment.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Comment.cpp?rev=165972&r1=165971&r2=165972&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Comment.cpp (original)
+++ cfe/trunk/lib/AST/Comment.cpp Mon Oct 15 15:57:52 2012
@@ -156,7 +156,8 @@
     IsFilled = true;
     return;
   }
-
+  Loc = CommentDecl->getLocation();
+  
   Decl::Kind K = CommentDecl->getKind();
   switch (K) {
   default:

Modified: cfe/trunk/test/Index/overriding-ftemplate-comments.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/overriding-ftemplate-comments.cpp?rev=165972&r1=165971&r2=165972&view=diff
==============================================================================
--- cfe/trunk/test/Index/overriding-ftemplate-comments.cpp (original)
+++ cfe/trunk/test/Index/overriding-ftemplate-comments.cpp Mon Oct 15 15:57:52 2012
@@ -59,20 +59,20 @@
 
 // CHECK: FunctionTemplate=comment_to_html_conversion_17:14:6 RawComment=[/// \tparam\n/// \param AAA Blah blah] RawCommentRange=[11:1 - 12:25] FullCommentAsHTML=[<dl><dt class="param-name-index-0">AAA</dt><dd class="param-descr-index-0"> Blah blah</dd></dl>] FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-ftemplate-comments.cpp" line="14" column="6"><Name>comment_to_html_conversion_17</Name><USR>c:@FT@>1#Tcomment_to_html_conversion_17#t0.0#</USR><Parameters><Parameter><Name>AAA</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Blah blah</Para></Discussion></Parameter></Parameters></Function>
 
-// CHECK: FunctionTemplate=comment_to_html_conversion_17:17:6 RawComment=[/// \tparam\n/// \param AAA Blah blah] RawCommentRange=[11:1 - 12:25] FullCommentAsHTML=[<dl><dt class="param-name-index-0">PPP</dt><dd class="param-descr-index-0"> Blah blah</dd></dl>] FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-ftemplate-comments.cpp" line="14" column="6"><Name>comment_to_html_conversion_17</Name><USR>c:@FT@>1#Tcomment_to_html_conversion_17#t0.0#</USR><Parameters><Parameter><Name>PPP</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Blah blah</Para></Discussion></Parameter></Parameters></Function>
+// CHECK: FunctionTemplate=comment_to_html_conversion_17:17:6 RawComment=[/// \tparam\n/// \param AAA Blah blah] RawCommentRange=[11:1 - 12:25] FullCommentAsHTML=[<dl><dt class="param-name-index-0">PPP</dt><dd class="param-descr-index-0"> Blah blah</dd></dl>] FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-ftemplate-comments.cpp" line="17" column="6"><Name>comment_to_html_conversion_17</Name><USR>c:@FT@>1#Tcomment_to_html_conversion_17#t0.0#</USR><Parameters><Parameter><Name>PPP</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Blah blah</Para></Discussion></Parameter></Parameters></Function>
 
 // CHECK: FunctionTemplate=comment_to_html_conversion_19:22:6 RawComment=[/// \tparam BBB Bbb\n/// \tparam AAA Aaa] RawCommentRange=[19:1 - 20:20] FullCommentAsHTML=[<dl><dt class="tparam-name-index-0">AAA</dt><dd class="tparam-descr-index-0"> Aaa</dd><dt class="tparam-name-index-1">BBB</dt><dd class="tparam-descr-index-1"> Bbb </dd></dl>] FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-ftemplate-comments.cpp" line="22" column="6"><Name>comment_to_html_conversion_19</Name><USR>c:@FT@>2#T#Tcomment_to_html_conversion_19#t0.0#t0.1#</USR><TemplateParameters><Parameter><Name>AAA</Name><Index>0</Index><Discussion><Para> Aaa</Para></Discussion></Parameter><Parameter><Name>BBB</Name><Index>1</Index><Discussion><Para> Bbb </Para></Discussion></Parameter></TemplateParameters></Function>
 
-// CHECK: FunctionTemplate=comment_to_html_conversion_19:25:6 RawComment=[/// \tparam BBB Bbb\n/// \tparam AAA Aaa] RawCommentRange=[19:1 - 20:20] FullCommentAsHTML=[<dl><dt class="tparam-name-index-0">PPP</dt><dd class="tparam-descr-index-0"> Aaa</dd><dt class="tparam-name-index-1">QQQ</dt><dd class="tparam-descr-index-1"> Bbb </dd></dl>] FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-ftemplate-comments.cpp" line="22" column="6"><Name>comment_to_html_conversion_19</Name><USR>c:@FT@>2#T#Tcomment_to_html_conversion_19#t0.0#t0.1#</USR><TemplateParameters><Parameter><Name>PPP</Name><Index>0</Index><Discussion><Para> Aaa</Para></Discussion></Parameter><Parameter><Name>QQQ</Name><Index>1</Index><Discussion><Para> Bbb </Para></Discussion></Parameter></TemplateParameters></Function>
+// CHECK: FunctionTemplate=comment_to_html_conversion_19:25:6 RawComment=[/// \tparam BBB Bbb\n/// \tparam AAA Aaa] RawCommentRange=[19:1 - 20:20] FullCommentAsHTML=[<dl><dt class="tparam-name-index-0">PPP</dt><dd class="tparam-descr-index-0"> Aaa</dd><dt class="tparam-name-index-1">QQQ</dt><dd class="tparam-descr-index-1"> Bbb </dd></dl>] FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-ftemplate-comments.cpp" line="25" column="6"><Name>comment_to_html_conversion_19</Name><USR>c:@FT@>2#T#Tcomment_to_html_conversion_19#t0.0#t0.1#</USR><TemplateParameters><Parameter><Name>PPP</Name><Index>0</Index><Discussion><Para> Aaa</Para></Discussion></Parameter><Parameter><Name>QQQ</Name><Index>1</Index><Discussion><Para> Bbb </Para></Discussion></Parameter></TemplateParameters></Function>
 
 // CHECK: FunctionTemplate=comment_to_html_conversion_20:32:6 RawComment=[/// \tparam BBB Bbb\n/// \tparam UUU Zzz\n/// \tparam CCC Ccc\n/// \tparam AAA Aaa] RawCommentRange=[27:1 - 30:20] FullCommentAsHTML=[<dl><dt class="tparam-name-index-0">AAA</dt><dd class="tparam-descr-index-0"> Aaa</dd><dt class="tparam-name-index-1">BBB</dt><dd class="tparam-descr-index-1"> Bbb </dd><dt class="tparam-name-index-2">CCC</dt><dd class="tparam-descr-index-2"> Ccc </dd><dt class="tparam-name-index-invalid">UUU</dt><dd class="tparam-descr-index-invalid"> Zzz </dd></dl>] FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-ftemplate-comments.cpp" line="32" column="6"><Name>comment_to_html_conversion_20</Name><USR>c:@FT@>3#T#T#NIcomment_to_html_conversion_20#t0.0#t0.1#</USR><TemplateParameters><Parameter><Name>AAA</Name><Index>0</Index><Discussion><Para> Aaa</Para></Discussion></Parameter><Parameter><Name>BBB</Name><Index>1</Index><Discussion><Para> Bbb </Para></D
 iscussion></Parameter><Parameter><Name>CCC</Name><Index>2</Index><Discussion><Para> Ccc </Para></Discussion></Parameter><Parameter><Name>UUU</Name><Discussion><Para> Zzz </Para></Discussion></Parameter></TemplateParameters></Function>
 
-// CHECK: FunctionTemplate=comment_to_html_conversion_20:35:6 RawComment=[/// \tparam BBB Bbb\n/// \tparam UUU Zzz\n/// \tparam CCC Ccc\n/// \tparam AAA Aaa] RawCommentRange=[27:1 - 30:20] FullCommentAsHTML=[<dl><dt class="tparam-name-index-0">PPP</dt><dd class="tparam-descr-index-0"> Aaa</dd><dt class="tparam-name-index-1">QQQ</dt><dd class="tparam-descr-index-1"> Bbb </dd><dt class="tparam-name-index-2">RRR</dt><dd class="tparam-descr-index-2"> Ccc </dd><dt class="tparam-name-index-invalid">UUU</dt><dd class="tparam-descr-index-invalid"> Zzz </dd></dl>] FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-ftemplate-comments.cpp" line="32" column="6"><Name>comment_to_html_conversion_20</Name><USR>c:@FT@>3#T#T#NIcomment_to_html_conversion_20#t0.0#t0.1#</USR><TemplateParameters><Parameter><Name>PPP</Name><Index>0</Index><Discussion><Para> Aaa</Para></Discussion></Parameter><Parameter><Name>QQQ</Name><Index>1</Index><Discussion><Para> Bbb </Para></D
 iscussion></Parameter><Parameter><Name>RRR</Name><Index>2</Index><Discussion><Para> Ccc </Para></Discussion></Parameter><Parameter><Name>UUU</Name><Discussion><Para> Zzz </Para></Discussion></Parameter></TemplateParameters></Function>
+// CHECK: FunctionTemplate=comment_to_html_conversion_20:35:6 RawComment=[/// \tparam BBB Bbb\n/// \tparam UUU Zzz\n/// \tparam CCC Ccc\n/// \tparam AAA Aaa] RawCommentRange=[27:1 - 30:20] FullCommentAsHTML=[<dl><dt class="tparam-name-index-0">PPP</dt><dd class="tparam-descr-index-0"> Aaa</dd><dt class="tparam-name-index-1">QQQ</dt><dd class="tparam-descr-index-1"> Bbb </dd><dt class="tparam-name-index-2">RRR</dt><dd class="tparam-descr-index-2"> Ccc </dd><dt class="tparam-name-index-invalid">UUU</dt><dd class="tparam-descr-index-invalid"> Zzz </dd></dl>] FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-ftemplate-comments.cpp" line="35" column="6"><Name>comment_to_html_conversion_20</Name><USR>c:@FT@>3#T#T#NIcomment_to_html_conversion_20#t0.0#t0.1#</USR><TemplateParameters><Parameter><Name>PPP</Name><Index>0</Index><Discussion><Para> Aaa</Para></Discussion></Parameter><Parameter><Name>QQQ</Name><Index>1</Index><Discussion><Para> Bbb </Para></D
 iscussion></Parameter><Parameter><Name>RRR</Name><Index>2</Index><Discussion><Para> Ccc </Para></Discussion></Parameter><Parameter><Name>UUU</Name><Discussion><Para> Zzz </Para></Discussion></Parameter></TemplateParameters></Function>
 
 // CHECK: FunctionTemplate=comment_to_html_conversion_21:42:6 RawComment=[/// \tparam AAA Aaa\n/// \tparam BBB Bbb\n/// \tparam CCC Ccc\n/// \tparam DDD Ddd] RawCommentRange=[37:1 - 40:20] FullCommentAsHTML=[<dl><dt class="tparam-name-index-0">AAA</dt><dd class="tparam-descr-index-0"> Aaa </dd><dt class="tparam-name-index-other">BBB</dt><dd class="tparam-descr-index-other"> Bbb </dd><dt class="tparam-name-index-other">CCC</dt><dd class="tparam-descr-index-other"> Ccc </dd><dt class="tparam-name-index-other">DDD</dt><dd class="tparam-descr-index-other"> Ddd</dd></dl>] FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-ftemplate-comments.cpp" line="42" column="6"><Name>comment_to_html_conversion_21</Name><USR>c:@FT@>1#t>2#t>1#T#Tcomment_to_html_conversion_21#</USR><TemplateParameters><Parameter><Name>AAA</Name><Index>0</Index><Discussion><Para> Aaa </Para></Discussion></Parameter><Parameter><Name>BBB</Name><Discussion><Para> Bbb </Para></Dis
 cussion></Parameter><Parameter><Name>CCC</Name><Discussion><Para> Ccc </Para></Discussion></Parameter><Parameter><Name>DDD</Name><Discussion><Para> Ddd</Para></Discussion></Parameter></TemplateParameters></Function>
 
-// CHECK: FunctionTemplate=comment_to_html_conversion_21:45:6 RawComment=[/// \tparam AAA Aaa\n/// \tparam BBB Bbb\n/// \tparam CCC Ccc\n/// \tparam DDD Ddd] RawCommentRange=[37:1 - 40:20] FullCommentAsHTML=[<dl><dt class="tparam-name-index-0">PPP</dt><dd class="tparam-descr-index-0"> Aaa </dd><dt class="tparam-name-index-other">QQQ</dt><dd class="tparam-descr-index-other"> Bbb </dd><dt class="tparam-name-index-other">RRR</dt><dd class="tparam-descr-index-other"> Ccc </dd><dt class="tparam-name-index-other">SSS</dt><dd class="tparam-descr-index-other"> Ddd</dd></dl>] FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-ftemplate-comments.cpp" line="42" column="6"><Name>comment_to_html_conversion_21</Name><USR>c:@FT@>1#t>2#t>1#T#Tcomment_to_html_conversion_21#</USR><TemplateParameters><Parameter><Name>PPP</Name><Index>0</Index><Discussion><Para> Aaa </Para></Discussion></Parameter><Parameter><Name>QQQ</Name><Discussion><Para> Bbb </Para></Dis
 cussion></Parameter><Parameter><Name>RRR</Name><Discussion><Para> Ccc </Para></Discussion></Parameter><Parameter><Name>SSS</Name><Discussion><Para> Ddd</Para></Discussion></Parameter></TemplateParameters></Function>
+// CHECK: FunctionTemplate=comment_to_html_conversion_21:45:6 RawComment=[/// \tparam AAA Aaa\n/// \tparam BBB Bbb\n/// \tparam CCC Ccc\n/// \tparam DDD Ddd] RawCommentRange=[37:1 - 40:20] FullCommentAsHTML=[<dl><dt class="tparam-name-index-0">PPP</dt><dd class="tparam-descr-index-0"> Aaa </dd><dt class="tparam-name-index-other">QQQ</dt><dd class="tparam-descr-index-other"> Bbb </dd><dt class="tparam-name-index-other">RRR</dt><dd class="tparam-descr-index-other"> Ccc </dd><dt class="tparam-name-index-other">SSS</dt><dd class="tparam-descr-index-other"> Ddd</dd></dl>] FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-ftemplate-comments.cpp" line="45" column="6"><Name>comment_to_html_conversion_21</Name><USR>c:@FT@>1#t>2#t>1#T#Tcomment_to_html_conversion_21#</USR><TemplateParameters><Parameter><Name>PPP</Name><Index>0</Index><Discussion><Para> Aaa </Para></Discussion></Parameter><Parameter><Name>QQQ</Name><Discussion><Para> Bbb </Para></Dis
 cussion></Parameter><Parameter><Name>RRR</Name><Discussion><Para> Ccc </Para></Discussion></Parameter><Parameter><Name>SSS</Name><Discussion><Para> Ddd</Para></Discussion></Parameter></TemplateParameters></Function>
 
 // CHECK: FunctionTemplate=comment_to_html_conversion_22:54:6 RawComment=[/// \tparam C1 Ccc 1\n/// \tparam AAA Zzz\n/// \tparam C2 Ccc 2\n/// \tparam C3 Ccc 3\n/// \tparam C4 Ccc 4\n/// \tparam BBB Bbb] RawCommentRange=[47:1 - 52:20] FullCommentAsHTML=[<dl><dt class="tparam-name-index-0">C1</dt><dd class="tparam-descr-index-0"> Ccc 1 </dd><dt class="tparam-name-index-1">AAA</dt><dd class="tparam-descr-index-1"> Zzz </dd><dt class="tparam-name-index-other">C2</dt><dd class="tparam-descr-index-other"> Ccc 2 </dd><dt class="tparam-name-index-other">C3</dt><dd class="tparam-descr-index-other"> Ccc 3 </dd><dt class="tparam-name-index-other">C4</dt><dd class="tparam-descr-index-other"> Ccc 4 </dd><dt class="tparam-name-index-other">BBB</dt><dd class="tparam-descr-index-other"> Bbb</dd></dl>] FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-ftemplate-comments.cpp" line="54" column="6"><Name>comment_to_html_conversion_22</Name><USR>c:@FT@>2#T#t>2#
 T#t>2#T#Tcomment_to_html_conversion_22#</USR><TemplateParameters><Parameter><Name>C1</Name><Index>0</Index><Discussion><Para> Ccc 1 </Para></Discussion></Parameter><Parameter><Name>AAA</Name><Index>1</Index><Discussion><Para> Zzz </Para></Discussion></Parameter><Parameter><Name>C2</Name><Discussion><Para> Ccc 2 </Para></Discussion></Parameter><Parameter><Name>C3</Name><Discussion><Para> Ccc 3 </Para></Discussion></Parameter><Parameter><Name>C4</Name><Discussion><Para> Ccc 4 </Para></Discussion></Parameter><Parameter><Name>BBB</Name><Discussion><Para> Bbb</Para></Discussion></Parameter></TemplateParameters></Function>
 
-// CHECK: FunctionTemplate=comment_to_html_conversion_22:58:6 RawComment=[/// \tparam C1 Ccc 1\n/// \tparam AAA Zzz\n/// \tparam C2 Ccc 2\n/// \tparam C3 Ccc 3\n/// \tparam C4 Ccc 4\n/// \tparam BBB Bbb] RawCommentRange=[47:1 - 52:20] FullCommentAsHTML=[<dl><dt class="tparam-name-index-0">CCC1</dt><dd class="tparam-descr-index-0"> Ccc 1 </dd><dt class="tparam-name-index-1">PPP</dt><dd class="tparam-descr-index-1"> Zzz </dd><dt class="tparam-name-index-other">CCC2</dt><dd class="tparam-descr-index-other"> Ccc 2 </dd><dt class="tparam-name-index-other">CCC3</dt><dd class="tparam-descr-index-other"> Ccc 3 </dd><dt class="tparam-name-index-other">CCC4</dt><dd class="tparam-descr-index-other"> Ccc 4 </dd><dt class="tparam-name-index-other">QQQ</dt><dd class="tparam-descr-index-other"> Bbb</dd></dl>] FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-ftemplate-comments.cpp" line="54" column="6"><Name>comment_to_html_conversion_22</Name><USR>c:@FT@>2#T
 #t>2#T#t>2#T#Tcomment_to_html_conversion_22#</USR><TemplateParameters><Parameter><Name>CCC1</Name><Index>0</Index><Discussion><Para> Ccc 1 </Para></Discussion></Parameter><Parameter><Name>PPP</Name><Index>1</Index><Discussion><Para> Zzz </Para></Discussion></Parameter><Parameter><Name>CCC2</Name><Discussion><Para> Ccc 2 </Para></Discussion></Parameter><Parameter><Name>CCC3</Name><Discussion><Para> Ccc 3 </Para></Discussion></Parameter><Parameter><Name>CCC4</Name><Discussion><Para> Ccc 4 </Para></Discussion></Parameter><Parameter><Name>QQQ</Name><Discussion><Para> Bbb</Para></Discussion></Parameter></TemplateParameters></Function>
+// CHECK: FunctionTemplate=comment_to_html_conversion_22:58:6 RawComment=[/// \tparam C1 Ccc 1\n/// \tparam AAA Zzz\n/// \tparam C2 Ccc 2\n/// \tparam C3 Ccc 3\n/// \tparam C4 Ccc 4\n/// \tparam BBB Bbb] RawCommentRange=[47:1 - 52:20] FullCommentAsHTML=[<dl><dt class="tparam-name-index-0">CCC1</dt><dd class="tparam-descr-index-0"> Ccc 1 </dd><dt class="tparam-name-index-1">PPP</dt><dd class="tparam-descr-index-1"> Zzz </dd><dt class="tparam-name-index-other">CCC2</dt><dd class="tparam-descr-index-other"> Ccc 2 </dd><dt class="tparam-name-index-other">CCC3</dt><dd class="tparam-descr-index-other"> Ccc 3 </dd><dt class="tparam-name-index-other">CCC4</dt><dd class="tparam-descr-index-other"> Ccc 4 </dd><dt class="tparam-name-index-other">QQQ</dt><dd class="tparam-descr-index-other"> Bbb</dd></dl>] FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-ftemplate-comments.cpp" line="58" column="6"><Name>comment_to_html_conversion_22</Name><USR>c:@FT@>2#T
 #t>2#T#t>2#T#Tcomment_to_html_conversion_22#</USR><TemplateParameters><Parameter><Name>CCC1</Name><Index>0</Index><Discussion><Para> Ccc 1 </Para></Discussion></Parameter><Parameter><Name>PPP</Name><Index>1</Index><Discussion><Para> Zzz </Para></Discussion></Parameter><Parameter><Name>CCC2</Name><Discussion><Para> Ccc 2 </Para></Discussion></Parameter><Parameter><Name>CCC3</Name><Discussion><Para> Ccc 3 </Para></Discussion></Parameter><Parameter><Name>CCC4</Name><Discussion><Para> Ccc 4 </Para></Discussion></Parameter><Parameter><Name>QQQ</Name><Discussion><Para> Bbb</Para></Discussion></Parameter></TemplateParameters></Function>

Modified: cfe/trunk/test/Index/overriding-method-comments.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/overriding-method-comments.mm?rev=165972&r1=165971&r2=165972&view=diff
==============================================================================
--- cfe/trunk/test/Index/overriding-method-comments.mm (original)
+++ cfe/trunk/test/Index/overriding-method-comments.mm Mon Oct 15 15:57:52 2012
@@ -32,9 +32,9 @@
 
 // CHECK: FullCommentAsHTML=[<dl><dt class="param-name-index-0">AAA</dt><dd class="param-descr-index-0"> ZZZ </dd></dl>] FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="19" column="1"><Name>METH:</Name><USR>c:objc(cs)Root(im)METH:</USR><Parameters><Parameter><Name>AAA</Name><Index>0</Index><Direction isExplicit="1">in</Direction><Discussion><Para> ZZZ </Para></Discussion></Parameter></Parameters></Function>
 
-// CHECK: FullCommentAsHTML=[<dl><dt class="param-name-index-0">BBB</dt><dd class="param-descr-index-0"> ZZZ </dd></dl>] FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="19" column="1"><Name>METH:</Name><USR>c:objc(cs)Root(im)METH:</USR><Parameters><Parameter><Name>BBB</Name><Index>0</Index><Direction isExplicit="1">in</Direction><Discussion><Para> ZZZ </Para></Discussion></Parameter></Parameters></Function>
+// CHECK: FullCommentAsHTML=[<dl><dt class="param-name-index-0">BBB</dt><dd class="param-descr-index-0"> ZZZ </dd></dl>] FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="26" column="1"><Name>METH:</Name><USR>c:objc(cs)Root(im)METH:</USR><Parameters><Parameter><Name>BBB</Name><Index>0</Index><Direction isExplicit="1">in</Direction><Discussion><Para> ZZZ </Para></Discussion></Parameter></Parameters></Function>
 
-// CHECK: FullCommentAsHTML=[<dl><dt class="param-name-index-0">III</dt><dd class="param-descr-index-0"> ZZZ </dd></dl>] FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="19" column="1"><Name>METH:</Name><USR>c:objc(cs)Root(im)METH:</USR><Parameters><Parameter><Name>III</Name><Index>0</Index><Direction isExplicit="1">in</Direction><Discussion><Para> ZZZ </Para></Discussion></Parameter></Parameters></Function>
+// CHECK: FullCommentAsHTML=[<dl><dt class="param-name-index-0">III</dt><dd class="param-descr-index-0"> ZZZ </dd></dl>] FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="30" column="1"><Name>METH:</Name><USR>c:objc(cs)Root(im)METH:</USR><Parameters><Parameter><Name>III</Name><Index>0</Index><Direction isExplicit="1">in</Direction><Discussion><Para> ZZZ </Para></Discussion></Parameter></Parameters></Function>
 
 @interface Redec : Root
 @end
@@ -54,7 +54,7 @@
 
 // CHECK: FullCommentAsHTML=[<dl><dt class="param-name-index-0">AAA</dt><dd class="param-descr-index-0"> input value   </dd><dt class="param-name-index-1">BBB</dt><dd class="param-descr-index-1"> 2nd input value is double  </dd><dt class="param-name-index-2">CCC</dt><dd class="param-descr-index-2"> output value is int  </dd></dl>] FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="48" column="1"><Name>EXT_METH:::</Name><USR>c:objc(cs)Redec(im)EXT_METH:::</USR><Parameters><Parameter><Name>AAA</Name><Index>0</Index><Direction isExplicit="1">in</Direction><Discussion><Para> input value   </Para></Discussion></Parameter><Parameter><Name>BBB</Name><Index>1</Index><Direction isExplicit="1">in</Direction><Discussion><Para> 2nd input value is double  </Para></Discussion></Parameter><Parameter><Name>CCC</Name><Index>2</Index><Direction isExplicit="1">out</Direction><Discussion><Para> output value is int  </Para></Discussion></Paramete
 r></Parameters></Function>
 
-// CHECK: FullCommentAsHTML=[<dl><dt class="param-name-index-0">PPP</dt><dd class="param-descr-index-0"> input value   </dd><dt class="param-name-index-1">QQQ</dt><dd class="param-descr-index-1"> 2nd input value is double  </dd><dt class="param-name-index-2">RRR</dt><dd class="param-descr-index-2"> output value is int  </dd></dl>] FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="48" column="1"><Name>EXT_METH:::</Name><USR>c:objc(cs)Redec(im)EXT_METH:::</USR><Parameters><Parameter><Name>PPP</Name><Index>0</Index><Direction isExplicit="1">in</Direction><Discussion><Para> input value   </Para></Discussion></Parameter><Parameter><Name>QQQ</Name><Index>1</Index><Direction isExplicit="1">in</Direction><Discussion><Para> 2nd input value is double  </Para></Discussion></Parameter><Parameter><Name>RRR</Name><Index>2</Index><Direction isExplicit="1">out</Direction><Discussion><Para> output value is int  </Para></Discussion></Paramete
 r></Parameters></Function>
+// CHECK: FullCommentAsHTML=[<dl><dt class="param-name-index-0">PPP</dt><dd class="param-descr-index-0"> input value   </dd><dt class="param-name-index-1">QQQ</dt><dd class="param-descr-index-1"> 2nd input value is double  </dd><dt class="param-name-index-2">RRR</dt><dd class="param-descr-index-2"> output value is int  </dd></dl>] FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="52" column="1"><Name>EXT_METH:::</Name><USR>c:objc(cs)Redec(im)EXT_METH:::</USR><Parameters><Parameter><Name>PPP</Name><Index>0</Index><Direction isExplicit="1">in</Direction><Discussion><Para> input value   </Para></Discussion></Parameter><Parameter><Name>QQQ</Name><Index>1</Index><Direction isExplicit="1">in</Direction><Discussion><Para> 2nd input value is double  </Para></Discussion></Parameter><Parameter><Name>RRR</Name><Index>2</Index><Direction isExplicit="1">out</Direction><Discussion><Para> output value is int  </Para></Discussion></Paramete
 r></Parameters></Function>
 
 struct Base {
   /// \brief Does something.
@@ -96,19 +96,19 @@
 
 // CHECK: FullCommentAsHTML=[<p class="para-brief"> Does something. </p><dl><dt class="param-name-index-0">CCC</dt><dd class="param-descr-index-0"> argument to undefined virtual.</dd></dl>] FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="70" column="16"><Name>foo_outofline</Name><USR>c:@S at Base@F at foo_outofline#I#</USR><Abstract><Para> Does something. </Para></Abstract><Parameters><Parameter><Name>CCC</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> argument to undefined virtual.</Para></Discussion></Parameter></Parameters></Function>
 
-// CHECK: FullCommentAsHTML=[<p class="para-brief"> Does something. </p><dl><dt class="param-name-index-0">RRR</dt><dd class="param-descr-index-0"> argument to undefined virtual.</dd></dl>] FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="70" column="16"><Name>foo_outofline</Name><USR>c:@S at Base@F at foo_outofline#I#</USR><Abstract><Para> Does something. </Para></Abstract><Parameters><Parameter><Name>RRR</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> argument to undefined virtual.</Para></Discussion></Parameter></Parameters></Function>
+// CHECK: FullCommentAsHTML=[<p class="para-brief"> Does something. </p><dl><dt class="param-name-index-0">RRR</dt><dd class="param-descr-index-0"> argument to undefined virtual.</dd></dl>] FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="73" column="12"><Name>foo_outofline</Name><USR>c:@S at Base@F at foo_outofline#I#</USR><Abstract><Para> Does something. </Para></Abstract><Parameters><Parameter><Name>RRR</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> argument to undefined virtual.</Para></Discussion></Parameter></Parameters></Function>
 
-// CHECK: FullCommentAsHTML=[<p class="para-brief"> Does something. </p><dl><dt class="param-name-index-0">PPP</dt><dd class="param-descr-index-0"> argument to foo_pure.</dd></dl>] FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="62" column="16"><Name>foo_pure</Name><USR>c:@S at Base@F at foo_pure#I#</USR><Abstract><Para> Does something. </Para></Abstract><Parameters><Parameter><Name>PPP</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> argument to foo_pure.</Para></Discussion></Parameter></Parameters></Function>
+// CHECK: FullCommentAsHTML=[<p class="para-brief"> Does something. </p><dl><dt class="param-name-index-0">PPP</dt><dd class="param-descr-index-0"> argument to foo_pure.</dd></dl>] FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="76" column="16"><Name>foo_pure</Name><USR>c:@S at Base@F at foo_pure#I#</USR><Abstract><Para> Does something. </Para></Abstract><Parameters><Parameter><Name>PPP</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> argument to foo_pure.</Para></Discussion></Parameter></Parameters></Function>
 
-// CHECK: FullCommentAsHTML=[<p class="para-brief"> Does something. </p><dl><dt class="param-name-index-0">QQQ</dt><dd class="param-descr-index-0"> argument to defined virtual.</dd></dl>] FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="66" column="16"><Name>foo_inline</Name><USR>c:@S at Base@F at foo_inline#I#</USR><Abstract><Para> Does something. </Para></Abstract><Parameters><Parameter><Name>QQQ</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> argument to defined virtual.</Para></Discussion></Parameter></Parameters></Function>
+// CHECK: FullCommentAsHTML=[<p class="para-brief"> Does something. </p><dl><dt class="param-name-index-0">QQQ</dt><dd class="param-descr-index-0"> argument to defined virtual.</dd></dl>] FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="78" column="16"><Name>foo_inline</Name><USR>c:@S at Base@F at foo_inline#I#</USR><Abstract><Para> Does something. </Para></Abstract><Parameters><Parameter><Name>QQQ</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> argument to defined virtual.</Para></Discussion></Parameter></Parameters></Function>
 
 // CHECK: FullCommentAsHTML=[<p class="para-brief"> Does something. </p><dl><dt class="param-name-index-0">DDD</dt><dd class="param-descr-index-0"> a value.</dd></dl>] FullCommentAsXML=[<Function file="{{[^"]+}}overriding-method-comments.mm" line="83" column="6"><Name>foo</Name><USR>c:@F at foo#I#</USR><Abstract><Para> Does something. </Para></Abstract><Parameters><Parameter><Name>DDD</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> a value.</Para></Discussion></Parameter></Parameters></Function>
 
-// CHECK: FullCommentAsHTML=[<p class="para-brief"> Does something. </p><dl><dt class="param-name-index-0">SSS</dt><dd class="param-descr-index-0"> a value.</dd></dl>] FullCommentAsXML=[<Function file="{{[^"]+}}overriding-method-comments.mm" line="83" column="6"><Name>foo</Name><USR>c:@F at foo#I#</USR><Abstract><Para> Does something. </Para></Abstract><Parameters><Parameter><Name>SSS</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> a value.</Para></Discussion></Parameter></Parameters></Function>
+// CHECK: FullCommentAsHTML=[<p class="para-brief"> Does something. </p><dl><dt class="param-name-index-0">SSS</dt><dd class="param-descr-index-0"> a value.</dd></dl>] FullCommentAsXML=[<Function file="{{[^"]+}}overriding-method-comments.mm" line="85" column="6"><Name>foo</Name><USR>c:@F at foo#I#</USR><Abstract><Para> Does something. </Para></Abstract><Parameters><Parameter><Name>SSS</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> a value.</Para></Discussion></Parameter></Parameters></Function>
 
 // CHECK: FullCommentAsHTML=[<p class="para-brief"> Does something. </p><dl><dt class="param-name-index-0">EEE</dt><dd class="param-descr-index-0"> argument to function decl. </dd></dl>] FullCommentAsXML=[<Function file="{{[^"]+}}overriding-method-comments.mm" line="89" column="6"><Name>foo1</Name><USR>c:@F at foo1#I#</USR><Abstract><Para> Does something. </Para></Abstract><Parameters><Parameter><Name>EEE</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> argument to function decl. </Para></Discussion></Parameter></Parameters></Function>
 
-// CHECK: FullCommentAsHTML=[<p class="para-brief"> Does something. </p><dl><dt class="param-name-index-0">TTT</dt><dd class="param-descr-index-0"> argument to function decl. </dd></dl>] FullCommentAsXML=[<Function file="{{[^"]+}}overriding-method-comments.mm" line="89" column="6"><Name>foo1</Name><USR>c:@F at foo1#I#</USR><Abstract><Para> Does something. </Para></Abstract><Parameters><Parameter><Name>TTT</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> argument to function decl. </Para></Discussion></Parameter></Parameters></Function>
+// CHECK: FullCommentAsHTML=[<p class="para-brief"> Does something. </p><dl><dt class="param-name-index-0">TTT</dt><dd class="param-descr-index-0"> argument to function decl. </dd></dl>] FullCommentAsXML=[<Function file="{{[^"]+}}overriding-method-comments.mm" line="91" column="6"><Name>foo1</Name><USR>c:@F at foo1#I#</USR><Abstract><Para> Does something. </Para></Abstract><Parameters><Parameter><Name>TTT</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> argument to function decl. </Para></Discussion></Parameter></Parameters></Function>
 
 /// \brief Documentation
 /// \tparam BBB The type, silly.
@@ -121,4 +121,4 @@
 
 // CHECK: FullCommentAsHTML=[<p class="para-brief"> Documentation </p><dl><dt class="tparam-name-index-0">AAA</dt><dd class="tparam-descr-index-0"> The type, silly as well.</dd><dt class="tparam-name-index-1">BBB</dt><dd class="tparam-descr-index-1"> The type, silly. </dd></dl>] FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-method-comments.mm" line="117" column="6"><Name>foo</Name><USR>c:@FT@>2#T#Tfoo#t0.0#t0.1#</USR><Abstract><Para> Documentation </Para></Abstract><TemplateParameters><Parameter><Name>AAA</Name><Index>0</Index><Discussion><Para> The type, silly as well.</Para></Discussion></Parameter><Parameter><Name>BBB</Name><Index>1</Index><Discussion><Para> The type, silly. </Para></Discussion></Parameter></TemplateParameters></Function>
 
-// CHECK: FullCommentAsHTML=[<p class="para-brief"> Documentation </p><dl><dt class="tparam-name-index-0">PPP</dt><dd class="tparam-descr-index-0"> The type, silly as well.</dd><dt class="tparam-name-index-1">QQQ</dt><dd class="tparam-descr-index-1"> The type, silly. </dd></dl>] FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-method-comments.mm" line="117" column="6"><Name>foo</Name><USR>c:@FT@>2#T#Tfoo#t0.0#t0.1#</USR><Abstract><Para> Documentation </Para></Abstract><TemplateParameters><Parameter><Name>PPP</Name><Index>0</Index><Discussion><Para> The type, silly as well.</Para></Discussion></Parameter><Parameter><Name>QQQ</Name><Index>1</Index><Discussion><Para> The type, silly. </Para></Discussion></Parameter></TemplateParameters></Function>
+// CHECK: FullCommentAsHTML=[<p class="para-brief"> Documentation </p><dl><dt class="tparam-name-index-0">PPP</dt><dd class="tparam-descr-index-0"> The type, silly as well.</dd><dt class="tparam-name-index-1">QQQ</dt><dd class="tparam-descr-index-1"> The type, silly. </dd></dl>] FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}overriding-method-comments.mm" line="120" column="6"><Name>foo</Name><USR>c:@FT@>2#T#Tfoo#t0.0#t0.1#</USR><Abstract><Para> Documentation </Para></Abstract><TemplateParameters><Parameter><Name>PPP</Name><Index>0</Index><Discussion><Para> The type, silly as well.</Para></Discussion></Parameter><Parameter><Name>QQQ</Name><Index>1</Index><Discussion><Para> The type, silly. </Para></Discussion></Parameter></TemplateParameters></Function>

Modified: cfe/trunk/tools/libclang/CXComment.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CXComment.cpp?rev=165972&r1=165971&r2=165972&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CXComment.cpp (original)
+++ cfe/trunk/tools/libclang/CXComment.cpp Mon Oct 15 15:57:52 2012
@@ -1096,7 +1096,7 @@
 
     {
       // Print line and column number.
-      SourceLocation Loc = DI->CommentDecl->getLocation();
+      SourceLocation Loc = DI->Loc;
       std::pair<FileID, unsigned> LocInfo = SM.getDecomposedLoc(Loc);
       FileID FID = LocInfo.first;
       unsigned FileOffset = LocInfo.second;





More information about the cfe-commits mailing list