[clang] [CIR] Upstream Exception Attr in CallOp (PR #164964)
Amr Hesham via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 24 12:22:48 PDT 2025
================
@@ -729,9 +735,15 @@ static mlir::ParseResult parseCallCommon(mlir::OpAsmParser &parser,
if (parser.parseRParen())
return mlir::failure();
- if (parser.parseOptionalKeyword("nothrow").succeeded())
+ llvm::SMLoc optionalNothrowLoc = parser.getCurrentLocation();
+ if (parser.parseOptionalKeyword("nothrow").succeeded()) {
+ if (hasExceptions)
+ return parser.emitError(
+ optionalNothrowLoc,
+ "should have either `exception` or `nothrow`, but not both");
----------------
AmrDeveloper wrote:
I think yes, this attribute was used as a marker to mark CallOp as invoked, and in TryOp, we convert it to TryCallOp, but I think we can use the absence of `nothrow` as a condition, the only difference will be the IR
In the incubator
```
cir.try {
%0 = cir.call exception @foo() : () -> !s32i
cir.yield
}
```
to
```
cir.try {
%0 = cir.call @foo() : () -> !s32i
cir.yield
}
```
https://github.com/llvm/llvm-project/pull/164964
More information about the cfe-commits
mailing list