Skip to content

Commit f78d522

Browse files
committed
[FIRRTL] Fix signed/unsigned comparison warning
1 parent 5955eff commit f78d522

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/Dialect/FIRRTL/FIRRTLInstanceImplementation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ instance_like_impl::verifyReferencedModule(Operation *instanceOp,
5656
}
5757
auto portDirections =
5858
instanceOp->getAttrOfType<mlir::DenseBoolArrayAttr>("portDirections");
59-
if (portDirections.size() != numExpected)
59+
if (static_cast<size_t>(portDirections.size()) != numExpected)
6060
return emitNote(
6161
instanceOp->emitOpError("the number of port directions should be "
6262
"equal to the number of results"));

lib/Dialect/FIRRTL/FIRRTLOpInterfaces.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ LogicalResult circt::firrtl::verifyModuleLikeOpInterface(FModuleLike module) {
6969
// TODO: bitwidth is 1 when there are no ports, since APInt previously did not
7070
// support 0 bit widths.
7171
auto bitWidth = portDirections.size();
72-
if (bitWidth != numPorts)
72+
if (static_cast<size_t>(bitWidth) != numPorts)
7373
return module.emitOpError("requires ") << numPorts << " port directions";
7474

7575
// Verify the port names.

0 commit comments

Comments
 (0)