This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGa259005a215d: [clang][Interp] Convert logical binop operands
to bool (authored by tbaeder).
Changed prior to commit:
aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.
LGTM
Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:531-534
+ // For C, cast back to integer type.
+ assert(T);
+ if (T != PT_Bool)
+return
tbaeder added inline comments.
Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:531-534
+ // For C, cast back to integer type.
+ assert(T);
+ if (T != PT_Bool)
+return this->emitCast(PT_Bool, *T, E);
aaron.ballman wrote:
> This is casting to boolean
aaron.ballman added inline comments.
Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:531-534
+ // For C, cast back to integer type.
+ assert(T);
+ if (T != PT_Bool)
+return this->emitCast(PT_Bool, *T, E);
This is casting to boolean type, not integer
tbaeder updated this revision to Diff 547495.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D157174/new/
https://reviews.llvm.org/D157174
Files:
clang/lib/AST/Interp/ByteCodeExprGen.cpp
clang/test/AST/Interp/c.c
Index: clang/test/AST/Interp/c.c
tbaeder created this revision.
tbaeder added reviewers: aaron.ballman, erichkeane, shafik, cor3ntin.
Herald added a project: All.
tbaeder requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
Move the logic for this into `visitBool`, where it