From 9d2f1e753bf3d526327f34a42d9945aa15aafe7b Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Thu, 18 Oct 2012 21:42:42 +0000 Subject: [doc parsing] use getParamName to access parameter for current(rewritten) comment and getParamNameAsWritten to access param name coming with \param marker. llvm-svn: 166231 --- clang/lib/AST/CommentDumper.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'clang/lib/AST/CommentDumper.cpp') diff --git a/clang/lib/AST/CommentDumper.cpp b/clang/lib/AST/CommentDumper.cpp index 4f51cd5622c..18ba47ff6c7 100644 --- a/clang/lib/AST/CommentDumper.cpp +++ b/clang/lib/AST/CommentDumper.cpp @@ -186,8 +186,12 @@ void CommentDumper::visitParamCommandComment(const ParamCommandComment *C) { else OS << " implicitly"; - if (C->hasParamName()) - OS << " Param=\"" << C->getParamName(const_cast(FC)) << "\""; + if (C->hasParamName()) { + if (C->isParamIndexValid()) + OS << " Param=\"" << C->getParamName(const_cast(FC)) << "\""; + else + OS << " Param=\"" << C->getParamNameAsWritten() << "\""; + } if (C->isParamIndexValid()) OS << " ParamIndex=" << C->getParamIndex(); @@ -197,7 +201,10 @@ void CommentDumper::visitTParamCommandComment(const TParamCommandComment *C) { dumpComment(C); if (C->hasParamName()) { - OS << " Param=\"" << C->getParamName(const_cast(FC)) << "\""; + if (C->isPositionValid()) + OS << " Param=\"" << C->getParamName(const_cast(FC)) << "\""; + else + OS << " Param=\"" << C->getParamNameAsWritten() << "\""; } if (C->isPositionValid()) { -- cgit v1.2.3