diff options
Diffstat (limited to 'lib/AST/Comment.cpp')
| -rw-r--r-- | lib/AST/Comment.cpp | 20 | 
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/AST/Comment.cpp b/lib/AST/Comment.cpp index 7a7d3dd8304e..dfa2a1665d40 100644 --- a/lib/AST/Comment.cpp +++ b/lib/AST/Comment.cpp @@ -116,6 +116,9 @@ bool ParagraphComment::isWhitespaceNoCache() const {  static TypeLoc lookThroughTypedefOrTypeAliasLocs(TypeLoc &SrcTL) {    TypeLoc TL = SrcTL.IgnoreParens(); +  // Look through attribute types. +  if (AttributedTypeLoc AttributeTL = TL.getAs<AttributedTypeLoc>()) +    return AttributeTL.getModifiedLoc();    // Look through qualified types.    if (QualifiedTypeLoc QualifiedTL = TL.getAs<QualifiedTypeLoc>())      return QualifiedTL.getUnqualifiedLoc(); @@ -280,8 +283,25 @@ void DeclInfo::fill() {    case Decl::EnumConstant:    case Decl::ObjCIvar:    case Decl::ObjCAtDefsField: +  case Decl::ObjCProperty: { +    const TypeSourceInfo *TSI; +    if (const auto *VD = dyn_cast<DeclaratorDecl>(CommentDecl)) +      TSI = VD->getTypeSourceInfo(); +    else if (const auto *PD = dyn_cast<ObjCPropertyDecl>(CommentDecl)) +      TSI = PD->getTypeSourceInfo(); +    else +      TSI = nullptr; +    if (TSI) { +      TypeLoc TL = TSI->getTypeLoc().getUnqualifiedLoc(); +      FunctionTypeLoc FTL; +      if (getFunctionTypeLoc(TL, FTL)) { +        ParamVars = FTL.getParams(); +        ReturnType = FTL.getReturnLoc().getType(); +      } +    }      Kind = VariableKind;      break; +  }    case Decl::Namespace:      Kind = NamespaceKind;      break;  | 
