[clang] [clang-repl] Extend the C support. (PR #89804)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue May 21 07:43:48 PDT 2024


================
@@ -407,6 +406,16 @@ void IncrementalParser::CleanUpPTU(PartialTranslationUnit &PTU) {
       }
     }
   }
+
+  // FIXME: We should de-allocate MostRecentTU
+  for (Decl *D : MostRecentTU->decls()) {
+    auto *ND = dyn_cast<NamedDecl>(D);
+    if (!ND)
+      continue;
+    // Check if we need to clean up the IdResolver chain.
+    if (ND->getDeclName().getFETokenInfo())
----------------
AaronBallman wrote:

As a one-liner rather than a four-liner.
```
if (auto *ND = dyn_cast<NamedDecl>(D);
    ND && ND->getDeclName().getFETokenInfo())
```

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


More information about the cfe-commits mailing list