Author: chapuni
Date: Sun Jan 27 05:09:41 2013
New Revision: 173614

URL: http://llvm.org/viewvc/llvm-project?rev=173614&view=rev
Log:
Revert r173586 (and r173587) , "Attach any tag type's documentation to its 
typedef if"

It caused unexpected warnings with @tparam.

Modified:
    cfe/trunk/lib/AST/ASTContext.cpp
    cfe/trunk/test/Index/annotate-comments-typedef.m

Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=173614&r1=173613&r2=173614&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Sun Jan 27 05:09:41 2013
@@ -428,12 +428,12 @@ comments::FullComment *ASTContext::getCo
           return cloneFullComment(FC, D);
     }
     else if (const TypedefDecl *TD = dyn_cast<TypedefDecl>(D)) {
-      // Attach any tag type's documentation to its typedef if latter
+      // Attach enum's documentation to its typedef if latter
       // does not have one of its own.
       QualType QT = TD->getUnderlyingType();
-      if (const TagType *TT = QT->getAs<TagType>())
-        if (const Decl *TD = TT->getDecl())
-          if (comments::FullComment *FC = getCommentForDecl(TD, PP))
+      if (const EnumType *ET = QT->getAs<EnumType>())
+        if (const EnumDecl *ED = ET->getDecl())
+          if (comments::FullComment *FC = getCommentForDecl(ED, PP))
             return cloneFullComment(FC, D);
     }
     return NULL;

Modified: cfe/trunk/test/Index/annotate-comments-typedef.m
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/annotate-comments-typedef.m?rev=173614&r1=173613&r2=173614&view=diff
==============================================================================
--- cfe/trunk/test/Index/annotate-comments-typedef.m (original)
+++ cfe/trunk/test/Index/annotate-comments-typedef.m Sun Jan 27 05:09:41 2013
@@ -28,9 +28,3 @@ enum E {
 };
 typedef enum E E_T;
 // CHECK: TypedefDecl=E_T:[[@LINE-1]]:16 (Definition) FullCommentAsHTML=[<p 
class="para-brief"> Documentation for E </p>] FullCommentAsXML=[<Typedef 
file="{{[^"]+}}annotate-comments-typedef.m" line="[[@LINE-1]]" 
column="16"><Name>E</Name><USR>c:@E@E</USR><Declaration>typedef enum E 
E_T</Declaration><Abstract><Para> Documentation for E 
</Para></Abstract></Typedef>]
-
-/** Comment about Foo */
-typedef struct {
-         int iii;
-        } Foo;
-// CHECK: TypedefDecl=Foo:[[@LINE-1]]:11 (Definition) FullCommentAsHTML=[<p 
class="para-brief"> Comment about Foo </p>] FullCommentAsXML=[<Typedef 
file="{{[^"]+}}annotate-comments-typedef.m" line="[[@LINE-1]]" 
column="11"><Name>&lt;anonymous&gt;</Name><USR>c:@SA@Foo</USR><Declaration>typedef
 struct Foo Foo</Declaration><Abstract><Para> Comment about Foo 
</Para></Abstract></Typedef>]


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to