[PATCH] D132521: [AST] Reuse PrintingPolicy from ASTContext

Youngsuk Kim via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 24 04:13:51 PDT 2022


JOE1994 updated this revision to Diff 455157.
JOE1994 added a comment.

Add missed out 'const'


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132521/new/

https://reviews.llvm.org/D132521

Files:
  clang/lib/Frontend/ASTConsumers.cpp


Index: clang/lib/Frontend/ASTConsumers.cpp
===================================================================
--- clang/lib/Frontend/ASTConsumers.cpp
+++ clang/lib/Frontend/ASTConsumers.cpp
@@ -92,7 +92,7 @@
         } else
           Out << "Not a DeclContext\n";
       } else if (OutputKind == Print) {
-        PrintingPolicy Policy(D->getASTContext().getLangOpts());
+        const PrintingPolicy &Policy = D->getASTContext().getPrintingPolicy();
         D->print(Out, Policy, /*Indentation=*/0, /*PrintInstantiation=*/true);
       } else if (OutputKind != None) {
         D->dump(Out, OutputKind == DumpFull, OutputFormat);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132521.455157.patch
Type: text/x-patch
Size: 634 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220824/8b490f23/attachment.bin>


More information about the cfe-commits mailing list