[PATCH] D144157: Add 128-bit integer support to enum element

2023-03-25 Thread zhouyizhou via Phabricator via cfe-commits
zhouyizhou updated this revision to Diff 508350. zhouyizhou added a comment. Add 128-bit integer support to enum element like GCC extension do. Also test coverage around _BitInt which can be arbitrarily large depending on the target. Also leave room for improvements to C2X because C2x made change

[PATCH] D144157: Add 128-bit integer support to enum element

2023-02-22 Thread zhouyizhou via Phabricator via cfe-commits
zhouyizhou marked an inline comment as done. zhouyizhou added a comment. Thank you all for your guidance! Now I am starting to learn C2X N2997, this is a fruitful process of learning for me ;-) Cheers Zhouyi Comment at: clang/lib/Sema/SemaDecl.cpp:19571-19573 - // TODO: If

[PATCH] D144157: Add 128-bit integer support to enum element

2023-02-22 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. I think this needs additional test coverage around `_BitInt` as those can be arbitrarily large depending on the target. Also, C2x made changes in this area to how we calculate what type to represent the enumerations in; we don't have to implement that support as p

[PATCH] D144157: Add 128-bit integer support to enum element

2023-02-18 Thread H. Vetinari via Phabricator via cfe-commits
h-vetinari added inline comments. Comment at: clang/lib/Sema/SemaDecl.cpp:19571-19573 - // TODO: If the result value doesn't fit in an int, it must be a long or long - // long value. ISO C does not support this, but GCC does as an extension, - // emit a warning. -

[PATCH] D144157: Add 128-bit integer support to enum element

2023-02-18 Thread zhouyizhou via Phabricator via cfe-commits
zhouyizhou updated this revision to Diff 498571. zhouyizhou added a comment. delete the trailing blank line Thank you all ;-) I have no access write to LLVM, could you commit it for me when you are not busy? Thanks a lot Cheers Zhouyi Zhouyi Zhou CHANGES SINCE LAST ACTION https://reviews

[PATCH] D144157: Add 128-bit integer support to enum element

2023-02-18 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay accepted this revision. MaskRay added inline comments. This revision is now accepted and ready to land. Comment at: clang/test/CodeGen/enum2.c:30 +// CHECK: ![[E]] = !DIEnumerator(name: "b0", value: 24197857203266734864629346612071973665, isUnsigned: true) +

[PATCH] D144157: Add 128-bit integer support to enum element

2023-02-17 Thread zhouyizhou via Phabricator via cfe-commits
zhouyizhou updated this revision to Diff 498557. zhouyizhou added a comment. make test case even better according to MaskRay's guidance CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144157/new/ https://reviews.llvm.org/D144157 Files: clang/lib/Sema/SemaDecl.cpp clang/test/CodeGen/e

[PATCH] D144157: Add 128-bit integer support to enum element

2023-02-17 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: clang/test/CodeGen/enum3.c:1 +// RUN: %clang_cc1 -triple x86_64-linux-gnu %s -debug-info-kind=limited -emit-llvm -o - | FileCheck %s + We don't need a new test file. Reusing can improve test discoverability and readabi

[PATCH] D144157: Add 128-bit integer support to enum element

2023-02-17 Thread zhouyizhou via Phabricator via cfe-commits
zhouyizhou updated this revision to Diff 498520. zhouyizhou added a comment. Add CodeGen Test following MaskRay(Fangrui Song)'s Advice, I learned a lot during this process, to be honest ;-) CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144157/new/ https://reviews.llvm.org/D144157 File

[PATCH] D144157: Add 128-bit integer support to enum element

2023-02-16 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. We also need a codegen test. `clang/test/CodeGen/enum2.c` may be a good one. It tests that debug information is correct as well. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144157/new/ https://reviews.llvm.org/D144157

[PATCH] D144157: Add 128-bit integer support to enum element

2023-02-15 Thread zhouyizhou via Phabricator via cfe-commits
zhouyizhou updated this revision to Diff 497893. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144157/new/ https://reviews.llvm.org/D144157 Files: clang/lib/Sema/SemaDecl.cpp clang/test/Sema/enum.c Index: clang/test/Sema/enum.c ==

[PATCH] D144157: Add 128-bit integer support to enum element

2023-02-15 Thread zhouyizhou via Phabricator via cfe-commits
zhouyizhou updated this revision to Diff 497889. zhouyizhou added a comment. reformat the patch according to Chuanqi's Advice CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144157/new/ https://reviews.llvm.org/D144157 Files: clang/lib/Sema/SemaDecl.cpp clang/test/Sema/enum.c Index

[PATCH] D144157: Add 128-bit integer support to enum element

2023-02-15 Thread zhouyizhou via Phabricator via cfe-commits
zhouyizhou added a comment. In D144157#4131103 , @ChuanqiXu wrote: >> debian build bot won't let me pass, so I clang-formatted the function >> ActOnEnumBody > > You can try `git diff -U0 --no-color --relative HEAD^ | > clang/tools/clang-format/clang-for

[PATCH] D144157: Add 128-bit integer support to enum element

2023-02-15 Thread Chuanqi Xu via Phabricator via cfe-commits
ChuanqiXu added a comment. > debian build bot won't let me pass, so I clang-formatted the function > ActOnEnumBody You can try `git diff -U0 --no-color --relative HEAD^ | clang/tools/clang-format/clang-format-diff.py -p1 -i` to format the changed part only. Currently there are many untouched p

[PATCH] D144157: Add 128-bit integer support to enum element

2023-02-15 Thread zhouyizhou via Phabricator via cfe-commits
zhouyizhou updated this revision to Diff 497884. zhouyizhou added a comment. debian build bot won't me pass, so I clang-formatted the function ActOnEnumBody CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144157/new/ https://reviews.llvm.org/D144157 Files: clang/lib/Sema/SemaDecl.cpp

[PATCH] D144157: Add 128-bit integer support to enum element

2023-02-15 Thread zhouyizhou via Phabricator via cfe-commits
zhouyizhou updated this revision to Diff 497874. zhouyizhou added a comment. add assertion for int128 support CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144157/new/ https://reviews.llvm.org/D144157 Files: clang/lib/Sema/SemaDecl.cpp clang/test/Sema/enum.c Index: clang/test/Sem

[PATCH] D144157: Add 128-bit integer support to enum element

2023-02-15 Thread zhouyizhou via Phabricator via cfe-commits
zhouyizhou created this revision. zhouyizhou added reviewers: aaron.ballman, doug.gregor, eddy-geek, rjmccall, MaskRay, ChuanqiXu, pengfei. Herald added a project: All. zhouyizhou requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Add 128-bit