Skip to content
Commit 43f6e042 authored by Mehdi Amini's avatar Mehdi Amini
Browse files

Make `mlir::OpState::operator bool` explicit

This change makes the conversion of an mlir::OpState to bool `explicit`. Idiomatic boolean uses continue to work as before, but questionable implicit uses (e.g. accumulating over a range of OpStates to count "true" states) become ill-formed. This makes the class interface a lilttle less error-prone.

I tested this change on our internal (fairly large) codebase, and only one fix was needed, which was ultimately an improvement of the affected code.

Reviewed By: rriddle, mehdi_amini

Differential Revision: https://reviews.llvm.org/D101989
parent 18cb17ce
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment