[PATCH] D118476: [demangler] Fix new/delete demangling

Chuanqi Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 6 19:24:23 PST 2022


ChuanqiXu added inline comments.


================
Comment at: libcxxabi/src/demangle/ItaniumDemangle.h:4813-4814
+      while (!consumeIf('E')) {
+        if (!HaveInits)
+          return nullptr;
+        Node *Init = getDerived().parseExpr();
----------------
`HaveInits` is loop invariant,  could we hoist the check?


================
Comment at: libcxxabi/src/demangle/ItaniumDemangle.h:4821
+      NodeArray Inits = popTrailingNodeArray(InitsBegin);
+      return make<NewExpr>(ExprList, Ty, Inits, Global, IsArray);
+    }
----------------
In case `HaveInits` is false and `consumeIf('E')` return true, the original behavior would be `return make<NewExpr>(ExprList, Ty, NodeArray(), Global, IsArray);`. Is the current behavior expected?


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

https://reviews.llvm.org/D118476



More information about the llvm-commits mailing list