aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Comment.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2012-10-18 21:42:42 +0000
committerFariborz Jahanian <fjahanian@apple.com>2012-10-18 21:42:42 +0000
commit262e60c1ccb5197e8e2ea49ada1196ed65183734 (patch)
treecec7b85be8e507525f07c9beeeaad66824c70b2d /lib/AST/Comment.cpp
parentd2deb91b02ae1d810719e4a5a63dc404f362575a (diff)
[doc parsing] use getParamName to access parameter
for current(rewritten) comment and getParamNameAsWritten to access param name coming with \param marker. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166231 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Comment.cpp')
-rw-r--r--lib/AST/Comment.cpp24
1 files changed, 11 insertions, 13 deletions
diff --git a/lib/AST/Comment.cpp b/lib/AST/Comment.cpp
index 03b58a7aa3..edb0f60fdf 100644
--- a/lib/AST/Comment.cpp
+++ b/lib/AST/Comment.cpp
@@ -306,24 +306,22 @@ void DeclInfo::fill() {
}
StringRef ParamCommandComment::getParamName(comments::FullComment *FC) const {
- if (FC && isParamIndexValid())
- return FC->getThisDeclInfo()->ParamVars[getParamIndex()]->getName();
- return Args[0].Text;
+ assert(isParamIndexValid());
+ return FC->getThisDeclInfo()->ParamVars[getParamIndex()]->getName();
}
StringRef TParamCommandComment::getParamName(comments::FullComment *FC) const {
- if (FC && isPositionValid()) {
- const TemplateParameterList *TPL = FC->getThisDeclInfo()->TemplateParameters;
- for (unsigned i = 0, e = getDepth(); i != e; ++i) {
- if (i == e-1)
- return TPL->getParam(getIndex(i))->getName();
- const NamedDecl *Param = TPL->getParam(getIndex(i));
- if (const TemplateTemplateParmDecl *TTP =
+ assert(isPositionValid());
+ const TemplateParameterList *TPL = FC->getThisDeclInfo()->TemplateParameters;
+ for (unsigned i = 0, e = getDepth(); i != e; ++i) {
+ if (i == e-1)
+ return TPL->getParam(getIndex(i))->getName();
+ const NamedDecl *Param = TPL->getParam(getIndex(i));
+ if (const TemplateTemplateParmDecl *TTP =
dyn_cast<TemplateTemplateParmDecl>(Param))
- TPL = TTP->getTemplateParameters();
- }
+ TPL = TTP->getTemplateParameters();
}
- return Args[0].Text;
+ return "";
}
} // end namespace comments