Skip to content

Commit d145c3e

Browse files
authored
♻️ Fix argument names of build methods (#1472)
## Description This PR fixes the argument names of the build method of most operations, after I had eroneously simplified them. This will silence warnings in IDEs (see #1464 (review)). ## Checklist: - [x] The pull request only contains commits that are focused and relevant to this change. - [x] ~I have added appropriate tests that cover the new/changed functionality.~ - [x] ~I have updated the documentation to reflect these changes.~ - [x] ~I have added entries to the changelog for any noteworthy additions, changes, fixes, or removals.~ - [x] ~I have added migration instructions to the upgrade guide (if needed).~ - [x] The changes follow the project's style guidelines and introduce no new warnings. - [x] The changes are fully tested and pass the CI checks. - [x] I have reviewed my own code changes.
1 parent 1ad9bb4 commit d145c3e

File tree

29 files changed

+114
-106
lines changed

29 files changed

+114
-106
lines changed

mlir/lib/Dialect/QC/IR/Operations/StandardGates/GPhaseOp.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ using namespace mlir;
1919
using namespace mlir::qc;
2020
using namespace mlir::utils;
2121

22-
void GPhaseOp::build(OpBuilder& builder, OperationState& state,
22+
void GPhaseOp::build(OpBuilder& odsBuilder, OperationState& odsState,
2323
const std::variant<double, Value>& theta) {
24-
auto thetaOperand = variantToValue(builder, state.location, theta);
25-
build(builder, state, thetaOperand);
24+
auto thetaOperand = variantToValue(odsBuilder, odsState.location, theta);
25+
build(odsBuilder, odsState, thetaOperand);
2626
}

mlir/lib/Dialect/QC/IR/Operations/StandardGates/POp.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ using namespace mlir;
1919
using namespace mlir::qc;
2020
using namespace mlir::utils;
2121

22-
void POp::build(OpBuilder& builder, OperationState& state, Value qubitIn,
22+
void POp::build(OpBuilder& odsBuilder, OperationState& odsState, Value qubitIn,
2323
const std::variant<double, Value>& theta) {
24-
auto thetaOperand = variantToValue(builder, state.location, theta);
25-
build(builder, state, qubitIn, thetaOperand);
24+
auto thetaOperand = variantToValue(odsBuilder, odsState.location, theta);
25+
build(odsBuilder, odsState, qubitIn, thetaOperand);
2626
}

mlir/lib/Dialect/QC/IR/Operations/StandardGates/ROp.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ using namespace mlir;
1919
using namespace mlir::qc;
2020
using namespace mlir::utils;
2121

22-
void ROp::build(OpBuilder& builder, OperationState& state, Value qubitIn,
22+
void ROp::build(OpBuilder& odsBuilder, OperationState& odsState, Value qubitIn,
2323
const std::variant<double, Value>& theta,
2424
const std::variant<double, Value>& phi) {
25-
auto thetaOperand = variantToValue(builder, state.location, theta);
26-
auto phiOperand = variantToValue(builder, state.location, phi);
27-
build(builder, state, qubitIn, thetaOperand, phiOperand);
25+
auto thetaOperand = variantToValue(odsBuilder, odsState.location, theta);
26+
auto phiOperand = variantToValue(odsBuilder, odsState.location, phi);
27+
build(odsBuilder, odsState, qubitIn, thetaOperand, phiOperand);
2828
}

mlir/lib/Dialect/QC/IR/Operations/StandardGates/RXOp.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ using namespace mlir;
1919
using namespace mlir::qc;
2020
using namespace mlir::utils;
2121

22-
void RXOp::build(OpBuilder& builder, OperationState& state, Value qubitIn,
22+
void RXOp::build(OpBuilder& odsBuilder, OperationState& odsState, Value qubitIn,
2323
const std::variant<double, Value>& theta) {
24-
auto thetaOperand = variantToValue(builder, state.location, theta);
25-
build(builder, state, qubitIn, thetaOperand);
24+
auto thetaOperand = variantToValue(odsBuilder, odsState.location, theta);
25+
build(odsBuilder, odsState, qubitIn, thetaOperand);
2626
}

mlir/lib/Dialect/QC/IR/Operations/StandardGates/RXXOp.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ using namespace mlir;
1919
using namespace mlir::qc;
2020
using namespace mlir::utils;
2121

22-
void RXXOp::build(OpBuilder& builder, OperationState& state, Value qubit0In,
23-
Value qubit1In, const std::variant<double, Value>& theta) {
24-
auto thetaOperand = variantToValue(builder, state.location, theta);
25-
build(builder, state, qubit0In, qubit1In, thetaOperand);
22+
void RXXOp::build(OpBuilder& odsBuilder, OperationState& odsState,
23+
Value qubit0In, Value qubit1In,
24+
const std::variant<double, Value>& theta) {
25+
auto thetaOperand = variantToValue(odsBuilder, odsState.location, theta);
26+
build(odsBuilder, odsState, qubit0In, qubit1In, thetaOperand);
2627
}

mlir/lib/Dialect/QC/IR/Operations/StandardGates/RYOp.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ using namespace mlir;
1919
using namespace mlir::qc;
2020
using namespace mlir::utils;
2121

22-
void RYOp::build(OpBuilder& builder, OperationState& state, Value qubitIn,
22+
void RYOp::build(OpBuilder& odsBuilder, OperationState& odsState, Value qubitIn,
2323
const std::variant<double, Value>& theta) {
24-
auto thetaOperand = variantToValue(builder, state.location, theta);
25-
build(builder, state, qubitIn, thetaOperand);
24+
auto thetaOperand = variantToValue(odsBuilder, odsState.location, theta);
25+
build(odsBuilder, odsState, qubitIn, thetaOperand);
2626
}

mlir/lib/Dialect/QC/IR/Operations/StandardGates/RYYOp.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ using namespace mlir;
1919
using namespace mlir::qc;
2020
using namespace mlir::utils;
2121

22-
void RYYOp::build(OpBuilder& builder, OperationState& state, Value qubit0In,
23-
Value qubit1In, const std::variant<double, Value>& theta) {
24-
auto thetaOperand = variantToValue(builder, state.location, theta);
25-
build(builder, state, qubit0In, qubit1In, thetaOperand);
22+
void RYYOp::build(OpBuilder& odsBuilder, OperationState& odsState,
23+
Value qubit0In, Value qubit1In,
24+
const std::variant<double, Value>& theta) {
25+
auto thetaOperand = variantToValue(odsBuilder, odsState.location, theta);
26+
build(odsBuilder, odsState, qubit0In, qubit1In, thetaOperand);
2627
}

mlir/lib/Dialect/QC/IR/Operations/StandardGates/RZOp.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ using namespace mlir;
1919
using namespace mlir::qc;
2020
using namespace mlir::utils;
2121

22-
void RZOp::build(OpBuilder& builder, OperationState& state, Value qubitIn,
22+
void RZOp::build(OpBuilder& odsBuilder, OperationState& odsState, Value qubitIn,
2323
const std::variant<double, Value>& theta) {
24-
auto thetaOperand = variantToValue(builder, state.location, theta);
25-
build(builder, state, qubitIn, thetaOperand);
24+
auto thetaOperand = variantToValue(odsBuilder, odsState.location, theta);
25+
build(odsBuilder, odsState, qubitIn, thetaOperand);
2626
}

mlir/lib/Dialect/QC/IR/Operations/StandardGates/RZXOp.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ using namespace mlir;
1919
using namespace mlir::qc;
2020
using namespace mlir::utils;
2121

22-
void RZXOp::build(OpBuilder& builder, OperationState& state, Value qubit0In,
23-
Value qubit1In, const std::variant<double, Value>& theta) {
24-
auto thetaOperand = variantToValue(builder, state.location, theta);
25-
build(builder, state, qubit0In, qubit1In, thetaOperand);
22+
void RZXOp::build(OpBuilder& odsBuilder, OperationState& odsState,
23+
Value qubit0In, Value qubit1In,
24+
const std::variant<double, Value>& theta) {
25+
auto thetaOperand = variantToValue(odsBuilder, odsState.location, theta);
26+
build(odsBuilder, odsState, qubit0In, qubit1In, thetaOperand);
2627
}

mlir/lib/Dialect/QC/IR/Operations/StandardGates/RZZOp.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ using namespace mlir;
1919
using namespace mlir::qc;
2020
using namespace mlir::utils;
2121

22-
void RZZOp::build(OpBuilder& builder, OperationState& state, Value qubit0In,
23-
Value qubit1In, const std::variant<double, Value>& theta) {
24-
auto thetaOperand = variantToValue(builder, state.location, theta);
25-
build(builder, state, qubit0In, qubit1In, thetaOperand);
22+
void RZZOp::build(OpBuilder& odsBuilder, OperationState& odsState,
23+
Value qubit0In, Value qubit1In,
24+
const std::variant<double, Value>& theta) {
25+
auto thetaOperand = variantToValue(odsBuilder, odsState.location, theta);
26+
build(odsBuilder, odsState, qubit0In, qubit1In, thetaOperand);
2627
}

0 commit comments

Comments
 (0)