[PATCH] D93101: [Clang][Codegen] Truncate initializers of union bitfield members

2021-01-28 Thread Tomas Matheson 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 rG01b9e613c28b: [Clang][Codegen] Truncate initializers of union bitfield members (authored by tmatheson). Repository: rG LLVM Github Monorepo

[PATCH] D93101: [Clang][Codegen] Truncate initializers of union bitfield members

2021-01-27 Thread Lucas Prates via Phabricator via cfe-commits
pratlucas accepted this revision. pratlucas added a comment. This revision is now accepted and ready to land. The truncate conditions look a lot better and the test coverage seems reasonable now. LGTM. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D93101: [Clang][Codegen] Truncate initializers of union bitfield members

2021-01-25 Thread Tomas Matheson via Phabricator via cfe-commits
tmatheson marked 2 inline comments as done. tmatheson added a comment. Ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93101/new/ https://reviews.llvm.org/D93101 ___ cfe-commits mailing list

[PATCH] D93101: [Clang][Codegen] Truncate initializers of union bitfield members

2021-01-18 Thread Tomas Matheson via Phabricator via cfe-commits
tmatheson marked 3 inline comments as done. tmatheson added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:9801-9804 +return EvaluateInPlace(Result.getUnionValue(), Info, Subobject, InitExpr) || + (Field->isBitField() && +

[PATCH] D93101: [Clang][Codegen] Truncate initializers of union bitfield members

2021-01-18 Thread Tomas Matheson via Phabricator via cfe-commits
tmatheson updated this revision to Diff 317340. tmatheson added a comment. Make unions in test cases const, and clarify logic Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93101/new/ https://reviews.llvm.org/D93101 Files:

[PATCH] D93101: [Clang][Codegen] Truncate initializers of union bitfield members

2021-01-18 Thread Tomas Matheson via Phabricator via cfe-commits
tmatheson updated this revision to Diff 317309. tmatheson added a comment. Add test RUN line that checks C++11 behaviour Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93101/new/ https://reviews.llvm.org/D93101 Files:

[PATCH] D93101: [Clang][Codegen] Truncate initializers of union bitfield members

2021-01-18 Thread Tomas Matheson via Phabricator via cfe-commits
tmatheson updated this revision to Diff 317306. tmatheson added a comment. Added more test cases and explanatory comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93101/new/ https://reviews.llvm.org/D93101 Files:

[PATCH] D93101: [Clang][Codegen] Truncate initializers of union bitfield members

2021-01-13 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:9801-9804 +return EvaluateInPlace(Result.getUnionValue(), Info, Subobject, InitExpr) || + (Field->isBitField() && +truncateBitfieldValue(Info, InitExpr, Result.getUnionValue(), +

[PATCH] D93101: [Clang][Codegen] Truncate initializers of union bitfield members

2021-01-13 Thread Joe Ellis via Phabricator via cfe-commits
joechrisellis added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:9803-9804 + (Field->isBitField() && +truncateBitfieldValue(Info, InitExpr, Result.getUnionValue(), + Field)); } nit: I would

[PATCH] D93101: [Clang][Codegen] Truncate initializers of union bitfield members

2021-01-04 Thread Tomas Matheson via Phabricator via cfe-commits
tmatheson added a comment. Ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93101/new/ https://reviews.llvm.org/D93101 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D93101: [Clang][Codegen] Truncate initializers of union bitfield members

2020-12-14 Thread Tomas Matheson via Phabricator via cfe-commits
tmatheson updated this revision to Diff 311529. tmatheson added a comment. Rebased Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93101/new/ https://reviews.llvm.org/D93101 Files: clang/lib/AST/ExprConstant.cpp

[PATCH] D93101: [Clang][Codegen] Truncate initializers of union bitfield members

2020-12-11 Thread Tomas Matheson via Phabricator via cfe-commits
tmatheson created this revision. tmatheson requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. If an initial value is given for a bitfield that does not fit in the bitfield, the value should be truncated. Constant folding for expressions did