[clang] Effect analysis: correctly detect `(x ? a : b)` as nonblocking when a and b are (PR #111224)

Doug Wyatt via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 8 03:39:47 PDT 2024


dougsonos wrote:

> Oh, also, are there any other places where we should maybe be using `FunctionEffectsRef::get()`?

Good question. I looked for other uses of `QualType` and `getType()` in SemaFunctionEffects, but this is the only spot (`checkIndirectCall`) where we are interested in obtaining effects from an expression which didn't come from a `Decl`. If there were a `Decl` it would have taken an earlier branch in `VisitCallExpr`, where we build a `CallableInfo`, whose constructor calls `FunctionEffectsRef::get()` in the case of an indirect call through a variable which has a `Decl`. So I think we're good.

Thanks for the quick review.

More patches? My favorite of Murphy's Laws of Programming is "if it is useful, it will have to be changed."

https://github.com/llvm/llvm-project/pull/111224


More information about the cfe-commits mailing list