[PATCH] D76096: [clang] allow const structs to be constant expressions in initializer lists
Nick Desaulniers via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 13 10:11:56 PDT 2020
nickdesaulniers planned changes to this revision.
nickdesaulniers added a comment.
> The performance implications of deleting those lines is the complicated part.
Where does compile time performance suffer from this? I guess if we have massive array initializers, or large struct definitions, or deeply nested struct definitions, it might take time to recursively evaluate if all members are constant expressions; but isn't that what I want as a developer, to offload the calculations to compile time rather than runtime? Or is the cost way too significant? Looks like @rsmith added those comments/checks back in 2012 via commit dafff947599e ("constexpr irgen: Add irgen support for APValue::Struct, APValue::Union,").
Let me see if I comment out the code I've added, then modify those two spots in ExprConstant.cpp you pointed out, if that works as well.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D76096/new/
https://reviews.llvm.org/D76096
More information about the cfe-commits
mailing list