This is an archive of the discontinued LLVM Phabricator instance.

[ParseResult] Mark this as LLVM_NODISCARD (like LogicalResult) and fix issues.
ClosedPublic

Authored by lattner on May 13 2022, 7:39 AM.

Details

Summary

There are a lot of cases where we accidentally ignored the result of some
parsing hook. Mark ParseResult as LLVM_NODISCARD just like ParseResult is.
This exposed some stuff to clean up, so do.

Diff Detail

Event Timeline

lattner created this revision.May 13 2022, 7:39 AM
lattner requested review of this revision.May 13 2022, 7:39 AM
lattner accepted this revision.May 13 2022, 8:28 AM
This revision is now accepted and ready to land.May 13 2022, 8:28 AM

Nice!

mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp
3116

It isn't clear why any of these variables needed to move, they looked fine in the place they were before.

mlir/lib/Parser/AffineParser.cpp
521

Why doesn't this have : in the error?

(Thanks for cleaning this up! The original was confusing and hard to follow)

lattner added inline comments.May 13 2022, 3:18 PM
mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp
3116

I moved them for reasons now irrelevant, will move them back, thanks!

mlir/lib/Parser/AffineParser.cpp
521

Good point. I kept the wrong error message from the original, which was broken as well. I'll fix in a follow-up thx for noticing!