[PATCH] D71133: [OpenCL] Add ExtVectorElementExpr constant evaluation (PR42387)

Sven van Haastregt via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 11 02:13:59 PST 2019


svenvh marked an inline comment as done.
svenvh added inline comments.


================
Comment at: clang/lib/AST/ExprConstant.cpp:7057
+
+    if (Val.isVector()) {
+      SmallVector<uint32_t, 4> Indices;
----------------
Anastasia wrote:
> can Val not be vector at this point?
Yes, for example when evaluating `const int2 fromConstexprFunc = addOne(int2(2));` from the included test case we get an LValue (that won't be folded by the code below).


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

https://reviews.llvm.org/D71133





More information about the cfe-commits mailing list