tbaeder added a comment.

In D135569#3847493 <https://reviews.llvm.org/D135569#3847493>, @aaron.ballman 
wrote:

> This function is testing whether something is potentially a constant 
> expression. Something might not be a valid constant expression for two 
> reasons: 1) it uses some prohibited language construct, 2) it hit undefined 
> behavior. You don't know if you hit undefined behavior until you run the 
> function, so could that be why the function was being run? However, I don't 
> know how you would run an arbitrary function that might accept arguments, so 
> the `Run` call does look suspicious -- especially because it landed in the 
> initial patch of the functionality (https://reviews.llvm.org/D64146) without 
> comment.

Yes. A few weeks ago I thought it might make sense to actually set functions to 
invalid if `isPotentialConstantExpr()` returns `false`, but found out that it 
returns `false` all the time, e.g. if the function expects parameters.

I think the whole "lets compile all constexpr functions" approach will probably 
go away at some point anyway? When including stdlib headers, we're probably 
compiling a lot of code that will never run...


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135569/new/

https://reviews.llvm.org/D135569

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to