[clang] [AST] Only dump desugared type when visibly different (PR #65214)

via cfe-commits cfe-commits at lists.llvm.org
Sun Sep 3 02:27:16 PDT 2023


================
@@ -677,13 +677,18 @@ void TextNodeDumper::dumpBareType(QualType T, bool Desugar) {
   ColorScope Color(OS, ShowColors, TypeColor);
 
   SplitQualType T_split = T.split();
-  OS << "'" << QualType::getAsString(T_split, PrintPolicy) << "'";
+  std::string T_str = QualType::getAsString(T_split, PrintPolicy);
+  OS << "'" << T_str << "'";
 
   if (Desugar && !T.isNull()) {
-    // If the type is sugared, also dump a (shallow) desugared type.
+    // If the type is sugared, also dump a (shallow) desugared type when
+    // visibly different.
----------------
cor3ntin wrote:

```suggestion
    // If the type is sugared, also dump a (shallow) desugared type when
    // it is visibly different.
```

https://github.com/llvm/llvm-project/pull/65214


More information about the cfe-commits mailing list