diff options
author | Paul Kirth <paulkirth@google.com> | 2024-12-12 19:14:25 -0800 |
---|---|---|
committer | Paul Kirth <paulkirth@google.com> | 2024-12-12 19:14:25 -0800 |
commit | bb23377a49bee459c9824827f8664f08feaa14f2 (patch) | |
tree | a3eb369877a46cf1c04c62be9271fed169265f76 | |
parent | ae3fef1380055331ead7b3a76c1d13119a017011 (diff) | |
download | llvm-users/ilovepi/clang-doc-md-names.zip llvm-users/ilovepi/clang-doc-md-names.tar.gz llvm-users/ilovepi/clang-doc-md-names.tar.bz2 |
[clang-doc] Use QualName in Markdown outputusers/ilovepi/clang-doc-md-names
QualName will provide the more useful typename when the type is
templated.
Fixes #67549
-rw-r--r-- | clang-tools-extra/clang-doc/MDGenerator.cpp | 6 | ||||
-rw-r--r-- | clang-tools-extra/test/clang-doc/templates.cpp | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/clang-tools-extra/clang-doc/MDGenerator.cpp b/clang-tools-extra/clang-doc/MDGenerator.cpp index 795eb4b..00c6605 100644 --- a/clang-tools-extra/clang-doc/MDGenerator.cpp +++ b/clang-tools-extra/clang-doc/MDGenerator.cpp @@ -157,17 +157,17 @@ static void genMarkdown(const ClangDocContext &CDCtx, const FunctionInfo &I, for (const auto &N : I.Params) { if (!First) Stream << ", "; - Stream << N.Type.Name + " " + N.Name; + Stream << N.Type.QualName + " " + N.Name; First = false; } writeHeader(I.Name, 3, OS); std::string Access = getAccessSpelling(I.Access).str(); if (Access != "") - writeLine(genItalic(Access + " " + I.ReturnType.Type.Name + " " + I.Name + + writeLine(genItalic(Access + " " + I.ReturnType.Type.QualName + " " + I.Name + "(" + Stream.str() + ")"), OS); else - writeLine(genItalic(I.ReturnType.Type.Name + " " + I.Name + "(" + + writeLine(genItalic(I.ReturnType.Type.QualName + " " + I.Name + "(" + Stream.str() + ")"), OS); if (I.DefLoc) diff --git a/clang-tools-extra/test/clang-doc/templates.cpp b/clang-tools-extra/test/clang-doc/templates.cpp index bf65284..b5590a9 100644 --- a/clang-tools-extra/test/clang-doc/templates.cpp +++ b/clang-tools-extra/test/clang-doc/templates.cpp @@ -150,7 +150,7 @@ tuple<int,int,bool> func_with_tuple_param(tuple<int,int,bool> t){ return t;} // YAML-NEXT: ... // MD: ### func_with_tuple_param -// MD: *tuple func_with_tuple_param(tuple t)* +// MD: *tuple<int, int, _Bool> func_with_tuple_param(tuple<int, int, _Bool> t)* // MD: *Defined at {{.*}}templates.cpp#[[# @LINE - 44]]* // MD: A function with a tuple parameter // MD: **t** The input to func_with_tuple_param |