kumarak wrote:

@andykaylor @bcardosolopes @xlauko, it will be great to get your thoughts on 
the fix. It avoids adding an insert point for the noreturn expression and 
generates `cir.unreachable`.

This is the generated CIR for the throw I see:
```
int f(bool b, int x) { return b ? x : throw 2; }

...
  }, false {
      %6 = cir.alloc.exception 4 -> !cir.ptr<!s32i> loc(#loc1)
      %7 = cir.const #cir.int<2> : !s32i loc(#loc1)
      cir.store align(16) %7, %6 : !s32i, !cir.ptr<!s32i> loc(#loc11)
      cir.throw %6 : !cir.ptr<!s32i>, @_ZTIi loc(#loc18)
      cir.unreachable loc(#loc18)
    }) : (!cir.bool) -> !s32i loc(#loc17)
...
```



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

Reply via email to