[clang] [CIR] Upstream Exception Attr in CallOp (PR #164964)

Bruno Cardoso Lopes via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 27 12:29:54 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");
----------------
bcardosolopes wrote:

This is expected (given those are are the LLVM equivalents of call/invoke - I agree the existing names are a bit convoluted), but my point is that if the call is not tagged prior to flatten, you don't know which one to lower to during flattening, because relying on the surrounding cir.try won't be enough. 

https://github.com/llvm/llvm-project/pull/164964


More information about the cfe-commits mailing list