From 5f6d40c7c3da4a9952ed41e6a979abe19d16626a Mon Sep 17 00:00:00 2001 From: Jordan Rupprecht Date: Wed, 20 Mar 2019 22:51:56 +0000 Subject: [PATCH] Revert "[clangd] Print arguments in template specializations" This reverts commit 44a63f6a150dec72dea43730d2a89d292e58bd6f. It segfaults on an internal test case (will follow up off thread). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356623 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AST/TypePrinter.cpp | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/lib/AST/TypePrinter.cpp b/lib/AST/TypePrinter.cpp index 9dcffca526..ebcc01aa46 100644 --- a/lib/AST/TypePrinter.cpp +++ b/lib/AST/TypePrinter.cpp @@ -1632,21 +1632,6 @@ static const TemplateArgument &getArgument(const TemplateArgumentLoc &A) { 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 static void printTo(raw_ostream &OS, ArrayRef Args, const PrintingPolicy &Policy, bool SkipBrackets) { @@ -1668,7 +1653,7 @@ static void printTo(raw_ostream &OS, ArrayRef Args, } else { if (!FirstArg) OS << Comma; - printArgument(Arg, Policy, ArgOS); + Argument.print(Policy, ArgOS); } StringRef ArgString = ArgOS.str(); -- 2.40.0