aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/FrontendActions.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard@metafoo.co.uk>2020-11-11 13:04:35 -0800
committerRichard Smith <richard@metafoo.co.uk>2020-11-11 15:05:51 -0800
commite7f3e2103cdb567dda4fd52f81bf4bc07179f5a8 (patch)
tree2725d3c6da28188839ba7f129ca12dc5a85f0627 /clang/lib/Frontend/FrontendActions.cpp
parent686d8a0911de7d9b13617c5aef66f6cebde05d5b (diff)
downloadllvm-e7f3e2103cdb567dda4fd52f81bf4bc07179f5a8.zip
llvm-e7f3e2103cdb567dda4fd52f81bf4bc07179f5a8.tar.gz
llvm-e7f3e2103cdb567dda4fd52f81bf4bc07179f5a8.tar.bz2
Suppress printing template arguments that match default template
arguments of types by default. This somewhat improves the worst-case printing of types like std::string, std::vector, etc., where many irrelevant default arguments can be included in the type as printed if we've lost the type sugar.
Diffstat (limited to 'clang/lib/Frontend/FrontendActions.cpp')
-rw-r--r--clang/lib/Frontend/FrontendActions.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Frontend/FrontendActions.cpp b/clang/lib/Frontend/FrontendActions.cpp
index 0993e5e..f38da54 100644
--- a/clang/lib/Frontend/FrontendActions.cpp
+++ b/clang/lib/Frontend/FrontendActions.cpp
@@ -467,7 +467,10 @@ private:
Entry.Event = BeginInstantiation ? "Begin" : "End";
if (auto *NamedTemplate = dyn_cast_or_null<NamedDecl>(Inst.Entity)) {
llvm::raw_string_ostream OS(Entry.Name);
- NamedTemplate->getNameForDiagnostic(OS, TheSema.getLangOpts(), true);
+ PrintingPolicy Policy = TheSema.Context.getPrintingPolicy();
+ // FIXME: Also ask for FullyQualifiedNames?
+ Policy.SuppressDefaultTemplateArgs = false;
+ NamedTemplate->getNameForDiagnostic(OS, Policy, true);
const PresumedLoc DefLoc =
TheSema.getSourceManager().getPresumedLoc(Inst.Entity->getLocation());
if(!DefLoc.isInvalid())