[PATCH] D65591: [AST] Add a flag indicating if any subexpression had errors

Bruno Ricci via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 12 06:26:04 PDT 2019


riccibruno added a comment.

It seems that these two options are not exactly the same right ? The `ContainsError` bit is useful to quickly answer "Does this expression contains an invalid sub-expression" without doing the search, while adding an `ErrorExpr` node is useful to note that //this// sub-expression is invalid (and as Aaron says the hypothetical `ErrorExpr` node can carry more info about the error).



================
Comment at: clang/include/clang/AST/Expr.h:1521
+      : Expr(CharacterLiteralClass, type, VK_RValue, OK_Ordinary, false, false,
+             false, false, false),
+        Value(value), Loc(l) {
----------------
`/*ContainsError=*/false` here and elsewhere ?


================
Comment at: clang/include/clang/AST/Expr.h:3602
+                 ExprValueKind VK, ExprObjectKind OK, SourceLocation opLoc,
+                 FPOptions FPFeatures, bool dead2)
+      : Expr(CompoundAssignOperatorClass, ResTy, VK, OK,
----------------
What is this `dead2` ?


================
Comment at: clang/lib/AST/ExprObjC.cpp:29
     : Expr(ObjCArrayLiteralClass, T, VK_RValue, OK_Ordinary, false, false,
-           false, false),
+           false, false, /*ContainsErros*/ false),
       NumElements(Elements.size()), Range(SR), ArrayWithObjectsMethod(Method) {
----------------
s/ContainsErros/ContainsErrors


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65591





More information about the cfe-commits mailing list