[PATCH] D59354: [clangd] Print arguments in template specializations
Kadir Cetinkaya via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 20 02:45:22 PDT 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rC356541: [clangd] Print arguments in template specializations (authored by kadircet, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D59354?vs=191460&id=191462#toc
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D59354/new/
https://reviews.llvm.org/D59354
Files:
lib/AST/TypePrinter.cpp
Index: lib/AST/TypePrinter.cpp
===================================================================
--- lib/AST/TypePrinter.cpp
+++ lib/AST/TypePrinter.cpp
@@ -1632,6 +1632,21 @@
return A.getArgument();
}
+static void printArgument(const TemplateArgument &A, const PrintingPolicy &PP,
+ llvm::raw_ostream &OS) {
+ A.print(PP, OS);
+}
+
+static void printArgument(const TemplateArgumentLoc &A,
+ const PrintingPolicy &PP, llvm::raw_ostream &OS) {
+ const auto &Kind = A.getArgument().getKind();
+ assert(Kind != TemplateArgument::Null &&
+ "TemplateArgumentKind can not be null!");
+ if (Kind == TemplateArgument::ArgKind::Type)
+ return A.getTypeSourceInfo()->getType().print(OS, PP);
+ return A.getArgument().print(PP, OS);
+}
+
template<typename TA>
static void printTo(raw_ostream &OS, ArrayRef<TA> Args,
const PrintingPolicy &Policy, bool SkipBrackets) {
@@ -1653,7 +1668,7 @@
} else {
if (!FirstArg)
OS << Comma;
- Argument.print(Policy, ArgOS);
+ printArgument(Arg, Policy, ArgOS);
}
StringRef ArgString = ArgOS.str();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59354.191462.patch
Type: text/x-patch
Size: 1162 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190320/f293765d/attachment-0001.bin>
More information about the cfe-commits
mailing list