This patch updates validModule not to use getModule. getModule
will dereference module, but that will lead to a seg-fault if module
is a nullptr.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
flang/include/flang/Lower/Bridge.h | ||
---|---|---|
87 | Someone else called this "Yoda style". But their question remains: why use it? |
flang/include/flang/Lower/Bridge.h | ||
---|---|---|
87 | 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. |
flang/include/flang/Lower/Bridge.h | ||
---|---|---|
87 | I expect that module != nullptr wouldn't attract any attention. ;) |
Someone else called this "Yoda style". But their question remains: why use it?