rsmith added inline comments.

================
Comment at: include/clang/AST/StmtCXX.h:128
+struct CXXTryStmt::OnStack : CXXTryStmt {
+  alignas(CXXTryStmt) Stmt *Stmts[2];
+  OnStack(SourceLocation tryLoc, Stmt *tryBlock, Stmt *handler)
----------------
This makes more assumptions about record layout and the ability to reach 
derived-class members through pointer arithmetic than I'd prefer. We're only 
going to have at most one of these per coroutine for which we emit an IR 
definition, so it seems fine for CodeGen to just go ahead and allocate one in 
the normal way.

Alternatively, it looks like it'd be straightforward to refactor `CodeGen`'s 
`EnterCXXTryStmt` / `ExitCXXTryStmt` to take an `ArrayRef<CXXTryStmt>` instead 
of a `CXXTryStmt`, which would let you avoid this machinery entirely.


https://reviews.llvm.org/D31692



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to