[clang] modified AST for SEI redemption project (PR #111705)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 17 05:39:12 PDT 2024


================
@@ -87,13 +100,44 @@ void JSONNodeDumper::Visit(const Type *T) {
                       T->containsUnexpandedParameterPack());
   attributeOnlyIfTrue("isImported", T->isFromAST());
   InnerTypeVisitor::Visit(T);
+  // SEI
+  VisitQualTypeDetails(T->getCanonicalTypeInternal());
 }
 
 void JSONNodeDumper::Visit(QualType T) {
-  JOS.attribute("id", createPointerRepresentation(T.getAsOpaquePtr()));
-  JOS.attribute("kind", "QualType");
-  JOS.attribute("type", createQualType(T));
-  JOS.attribute("qualifiers", T.split().Quals.getAsString());
+
+  // SEI: used AddChild to prevent qualType from being part added to a list
+  // JOS.attributeArray("qualTypes", [=] {
+
+  // SEI: force qualType into its own block, otherwise multiple Visits
+  // create a bunch of siblings, which is invalid JSON
----------------
AaronBallman wrote:

```suggestion
  // Force qualType into its own block, otherwise multiple Visits
  // create a bunch of siblings, which is invalid JSON.
```

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


More information about the cfe-commits mailing list