[PATCH] D73645: Add IntegerAttr::verifyConstructionInvariants.

River Riddle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 29 10:26:22 PST 2020


rriddle accepted this revision.
rriddle added inline comments.
This revision is now accepted and ready to land.


================
Comment at: mlir/lib/IR/Attributes.cpp:294
+                                           int64_t value) {
+  if (failed(verifyIntegerTypeInvariants(loc, type)))
+    return failure();
----------------
nit: can you just return this directly?


================
Comment at: mlir/lib/IR/Attributes.cpp:308
+      return emitOptionalError(
+          loc, "integer type bit width doesn't match value bit width");
+  return success();
----------------
nit: Can you add the widths as well to the message?

Note: emitOptionalError takes variadic arguments that are passed to the diagnostic

emitOptionalError(loc, "these are ", 3, " arguments to the diagnostic");


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73645/new/

https://reviews.llvm.org/D73645





More information about the llvm-commits mailing list