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
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
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
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
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
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 {
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()) {
---
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
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
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
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
11 matches
Mail list logo