diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2012-10-15 18:58:50 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2012-10-15 18:58:50 +0000 |
commit | 6553c686cb419b22b4c79d05a422fb1e96f6e122 (patch) | |
tree | 8911b7c2e9cdb19d6e9a91cfdd698f400d3ac824 /lib/AST/Comment.cpp | |
parent | 9a022bb007a3e77e1ac1330f955a239cfb1dd0fb (diff) |
structured document comment: patch to provide comment for overriding function
template when comment is comming from overridden declaration.
// rdar://12378793
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165953 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Comment.cpp')
-rw-r--r-- | lib/AST/Comment.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/AST/Comment.cpp b/lib/AST/Comment.cpp index a443b91d09..a235b60bea 100644 --- a/lib/AST/Comment.cpp +++ b/lib/AST/Comment.cpp @@ -310,6 +310,21 @@ StringRef ParamCommandComment::getParamName(comments::FullComment *FC) const { return Args[0].Text; } +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 = + dyn_cast<TemplateTemplateParmDecl>(Param)) + TPL = TTP->getTemplateParameters(); + } + } + return Args[0].Text; +} + } // end namespace comments } // end namespace clang |