Skip to content

Commit a51a09c

Browse files
committed
♻️ Replace usage of exception with llvm::reportFatalInternalError
Signed-off-by: burgholzer <burgholzer@me.com>
1 parent 1d0550a commit a51a09c

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

mlir/lib/Dialect/MQTOpt/Transforms/MergeRotationGatesPattern.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <cstddef>
1616
#include <iterator>
1717
#include <llvm/ADT/STLExtras.h>
18+
#include <llvm/Support/ErrorHandling.h>
1819
#include <mlir/Dialect/Arith/IR/Arith.h>
1920
#include <mlir/IR/MLIRContext.h>
2021
#include <mlir/IR/Operation.h>
@@ -23,7 +24,6 @@
2324
#include <mlir/IR/ValueRange.h>
2425
#include <mlir/Support/LLVM.h>
2526
#include <mlir/Support/LogicalResult.h>
26-
#include <stdexcept>
2727
#include <string>
2828
#include <unordered_set>
2929

@@ -169,7 +169,8 @@ struct MergeRotationGatesPattern final
169169
} else if (type == "rzx") {
170170
newUser = createOpAdditiveAngle<RZXOp>(op, user, rewriter);
171171
} else {
172-
throw std::runtime_error("Unsupported operation type: " + type);
172+
const std::string msg = "Unsupported operation type: " + type;
173+
llvm::reportFatalInternalError(msg.c_str());
173174
}
174175

175176
// Prepare erasure of op

0 commit comments

Comments
 (0)