[PATCH] D50152: [CodeGen] Merge equivalent block copy/helper functions

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 8 12:59:33 PDT 2018


rjmccall added inline comments.


================
Comment at: include/clang/AST/ASTContext.h:248
+  /// Mapping from __block VarDecls to their copy initialization expr. The
+  /// boolean flag indicates whether the expression can throw.
+  typedef llvm::DenseMap<const VarDecl *,
----------------
Maybe you should just make a type for this pairing.  You can put this documentation there, and the access functions can take and return it.


================
Comment at: lib/Sema/SemaDecl.cpp:11851
+        if (canThrow(init))
+          Context.setBlockVarCopyExprCanThrow(var);
       }
----------------
Can we just make this a parameter to `setBlockVarCopyInits`?  The caller always needs to set this correctly, so making it a required parameter makes sense — and it avoids doing the hash-lookup twice.


Repository:
  rC Clang

https://reviews.llvm.org/D50152





More information about the cfe-commits mailing list