[PATCH] D135858: [clang][Interp] Support pointer arithmetic in binary operators

2022-11-06 Thread Timm Bäder via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG10483ac743e6: [clang][Interp] Support pointer arithmethic in binary operators (authored by tbaeder). Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D135858: [clang][Interp] Support pointer arithmetic in binary operators

2022-10-30 Thread Shafik Yaghmour via Phabricator via cfe-commits
shafik accepted this revision. shafik added a comment. This revision is now accepted and ready to land. LGTM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135858/new/ https://reviews.llvm.org/D135858 ___ cfe-commits mailing list cfe-commits@l

[PATCH] D135858: [clang][Interp] Support pointer arithmetic in binary operators

2022-10-28 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/Interp.h:970 + if (!Pointer::hasSameArray(LHS, RHS)) { +// TODO: Diagnose. +return false; shafik wrote: > tbaeder wrote: > > This is also not being diagnosed (only rejected) by the current

[PATCH] D135858: [clang][Interp] Support pointer arithmetic in binary operators

2022-10-28 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 471711. tbaeder marked 2 inline comments as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135858/new/ https://reviews.llvm.org/D135858 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/lib/AST/Interp/ByteCodeExprGen.h clang/lib/AST/In

[PATCH] D135858: [clang][Interp] Support pointer arithmetic in binary operators

2022-10-28 Thread Shafik Yaghmour via Phabricator via cfe-commits
shafik added inline comments. Comment at: clang/lib/AST/Interp/Interp.h:970 + if (!Pointer::hasSameArray(LHS, RHS)) { +// TODO: Diagnose. +return false; tbaeder wrote: > This is also not being diagnosed (only rejected) by the current interpreter. > But

[PATCH] D135858: [clang][Interp] Support pointer arithmetic in binary operators

2022-10-28 Thread Shafik Yaghmour via Phabricator via cfe-commits
shafik added inline comments. Comment at: clang/test/AST/Interp/arrays.cpp:69 +constexpr int const * ap1 = &arr[0]; +constexpr int const * ap2 = ap1 + 3; // expected-error {{must be initialized by a constant expression}} \ + // expected-note {

[PATCH] D135858: [clang][Interp] Support pointer arithmetic in binary operators

2022-10-28 Thread Shafik Yaghmour via Phabricator via cfe-commits
shafik added inline comments. Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:241 + // Pointer arithmethic special case. This is supported for one of + // LHS and RHS being a pointer type and the other being an integer type. + if (BO->getType()->isPointerType()) { ---

[PATCH] D135858: [clang][Interp] Support pointer arithmetic in binary operators

2022-10-27 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder marked an inline comment as done. tbaeder added inline comments. Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:241 + // Pointer arithmethic special case. This is supported for one of + // LHS and RHS being a pointer type and the other being an integer type. + if

[PATCH] D135858: [clang][Interp] Support pointer arithmetic in binary operators

2022-10-25 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 470400. tbaeder marked 5 inline comments as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135858/new/ https://reviews.llvm.org/D135858 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/lib/AST/Interp/ByteCodeExprGen.h clang/lib/AST/In

[PATCH] D135858: [clang][Interp] Support pointer arithmetic in binary operators

2022-10-24 Thread Shafik Yaghmour via Phabricator via cfe-commits
shafik added inline comments. Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:259 + + if (Op != BO_Add && Op != BO_Sub) +return false; or neither left or right operand is a pointer type Comment at: clang/lib/AST/Interp/ByteCodeExprGen

[PATCH] D135858: [clang][Interp] Support pointer arithmetic in binary operators

2022-10-22 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 469875. tbaeder added a comment. Ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135858/new/ https://reviews.llvm.org/D135858 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/lib/AST/Interp/ByteCodeExprGen.h clang/lib/AST/Interp/Inter