[PATCH] D119705: [flang] Fix `LoweringBridge::validModule`
Andrzej Warzynski via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 14 10:06:07 PST 2022
awarzynski added inline comments.
================
Comment at: flang/include/flang/Lower/Bridge.h:87
- bool validModule() { return getModule(); }
+ bool validModule() { return (nullptr != module); }
----------------
schweitz wrote:
> Someone else called this "Yoda style". But their question remains: why use it?
[[ https://en.wikipedia.org/wiki/Yoda_conditions | Yoda Condition ]] ;-)
Tl:Dr With this style, you will never write `var = 0` instead of `var == 0` (compilers will complain about `0 = var`, but not about `0 == var`). Happy to change to `module != nullptr` if that's what you prefer.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D119705/new/
https://reviews.llvm.org/D119705
More information about the llvm-commits
mailing list