bcardosolopes wrote:

> It would be useful to pull the CIR dialect changes out of this and into a 
> separate PR that precedes this one. You could also Move the CFG flattening 
> into a follow-up PR and just not lower to LLVM IR in this one. Those changes 
> would make this easier to review.

+1

> I realised that in OGCG, it will call EmitStmt(S.getTryBlock()); and in case 
> that try block is empty, nothing will be generated  In our case, in the 
> incubator, we added scope and use cir::TryOp but I think we can early return 
> in the codegen if the try block is empty. I will do that in another PR and 
> will update this PR after that to handle either non-catch all or try with 
> body.

Nice catch. We probably do this in the incubator because we are creating the 
scopes before we get into the actual emission, it might be more readable/easier 
to delete the ops altogether right after emission if they end being no-ops.

https://github.com/llvm/llvm-project/pull/162528
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to