[PATCH] D157331: [clang] Implement C23

2023-10-16 Thread Zijun Zhao via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG3694697003bb: [clang] Implement C23 (authored by ZijunZhao). Changed prior to commit: https://reviews.llvm.org/D157331?vs=557650&id=557720#toc Repository: rG LLVM Github Monorepo CHANG

[PATCH] D157331: [clang] Implement C23

2023-10-09 Thread Zijun Zhao via Phabricator via cfe-commits
ZijunZhao updated this revision to Diff 557650. ZijunZhao added a comment. Add the blank lines back and then rerun the utc script Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157331/new/ https://reviews.llvm.org/D157331 Files: clang/docs/Relea

[PATCH] D157331: [clang] Implement C23

2023-10-05 Thread Zijun Zhao via Phabricator via cfe-commits
ZijunZhao updated this revision to Diff 557622. ZijunZhao added a comment. 1. set `--triple=x86-64` as the first argument 2. run the script for the tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157331/new/ https://reviews.llvm.org/D157331 Fi

[PATCH] D157331: [clang] Implement C23

2023-10-05 Thread Zijun Zhao via Phabricator via cfe-commits
ZijunZhao updated this revision to Diff 557621. ZijunZhao added a comment. Add --triple=x86_64 into the tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157331/new/ https://reviews.llvm.org/D157331 Files: clang/docs/ReleaseNotes.rst clang/

[PATCH] D157331: [clang] Implement C23

2023-10-05 Thread Zijun Zhao via Phabricator via cfe-commits
ZijunZhao updated this revision to Diff 557619. ZijunZhao added a comment. Run the script to update the test Test command: llvm/utils/update_cc_test_checks.py --clang build/bin/clang ./clang/test/C/C2x/n2683_2.c llvm/utils/update_cc_test_checks.py --clang build/bin/clang ./clang/test/Headers/s

[PATCH] D157331: [clang] Implement C23

2023-10-05 Thread Zijun Zhao via Phabricator via cfe-commits
ZijunZhao updated this revision to Diff 557618. ZijunZhao marked 3 inline comments as done. ZijunZhao added a comment. Name a regex pattern and then use that to avoid post-commit CI breakage. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157331/new/

[PATCH] D157331: [clang] Implement C23

2023-10-04 Thread Zijun Zhao via Phabricator via cfe-commits
ZijunZhao updated this revision to Diff 557589. ZijunZhao added a comment. Remove stdckdint.h in module.map Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157331/new/ https://reviews.llvm.org/D157331 Files: clang/docs/ReleaseNotes.rst clang/inc

[PATCH] D157331: [clang] Implement C23

2023-10-03 Thread Zijun Zhao via Phabricator via cfe-commits
ZijunZhao updated this revision to Diff 557565. ZijunZhao added a comment. Rebase to latest main branch Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157331/new/ https://reviews.llvm.org/D157331 Files: clang/docs/ReleaseNotes.rst clang/include

[PATCH] D157331: [clang] Implement C23

2023-09-29 Thread Zijun Zhao via Phabricator via cfe-commits
ZijunZhao updated this revision to Diff 557493. ZijunZhao added a comment. Update the SemaChecking.cpp and the test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157331/new/ https://reviews.llvm.org/D157331 Files: clang/docs/ReleaseNotes.rst

[PATCH] D157331: [clang] Implement C23

2023-09-28 Thread Zijun Zhao via Phabricator via cfe-commits
ZijunZhao updated this revision to Diff 557470. ZijunZhao marked 5 inline comments as done. ZijunZhao added a comment. 1. Simplify code in SemaChecking.cpp 2. Fix the nit and rename the variable in SemaChecking.cpp 3. Update the condition in SemaChecking.cpp 4. Add wchar_t test to show our care

[PATCH] D157331: [clang] Implement C23

2023-09-11 Thread Zijun Zhao via Phabricator via cfe-commits
ZijunZhao updated this revision to Diff 556504. ZijunZhao added a comment. Remove c++ related conditions Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157331/new/ https://reviews.llvm.org/D157331 Files: clang/docs/ReleaseNotes.rst clang/includ

[PATCH] D157331: [clang] Implement C23

2023-09-11 Thread Zijun Zhao via Phabricator via cfe-commits
ZijunZhao updated this revision to Diff 556496. ZijunZhao added a comment. update comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157331/new/ https://reviews.llvm.org/D157331 Files: clang/docs/ReleaseNotes.rst clang/include/clang/Basic/

[PATCH] D157331: [clang] Implement C23

2023-09-11 Thread Zijun Zhao via Phabricator via cfe-commits
ZijunZhao updated this revision to Diff 556494. ZijunZhao added a comment. add #include_next Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157331/new/ https://reviews.llvm.org/D157331 Files: clang/docs/ReleaseNotes.rst clang/include/clang/Basi

[PATCH] D157331: [clang] Implement C23

2023-09-11 Thread Zijun Zhao via Phabricator via cfe-commits
ZijunZhao updated this revision to Diff 556484. ZijunZhao added a comment. update the reformat msg and tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157331/new/ https://reviews.llvm.org/D157331 Files: clang/docs/ReleaseNotes.rst clang/in

[PATCH] D157331: [clang] Implement C23

2023-09-11 Thread Zijun Zhao via Phabricator via cfe-commits
ZijunZhao updated this revision to Diff 556475. ZijunZhao marked an inline comment as done. ZijunZhao added a comment. Reformat the error msg Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157331/new/ https://reviews.llvm.org/D157331 Files: clang

[PATCH] D157331: [clang] Implement C23

2023-08-30 Thread Zijun Zhao via Phabricator via cfe-commits
ZijunZhao updated this revision to Diff 554784. ZijunZhao marked 3 inline comments as done. ZijunZhao added a comment. Remove the short type check part. >From Aaron Ballman: > Instead, we'd want to do some data flow analysis (in the clang static > analyzer) so we know the potential range of va

[PATCH] D157331: [clang] Implement C23

2023-08-29 Thread Zijun Zhao via Phabricator via cfe-commits
ZijunZhao marked an inline comment as not done. ZijunZhao added inline comments. Comment at: clang/lib/Sema/SemaChecking.cpp:388 + } + // First two arguments should be integers. aaron.ballman wrote: > I keeps my original code because it just checks once but

[PATCH] D157331: [clang] Implement C23

2023-08-29 Thread Zijun Zhao via Phabricator via cfe-commits
ZijunZhao updated this revision to Diff 554534. ZijunZhao marked 3 inline comments as done. ZijunZhao added a comment. 1. Remove pure integer check to the right place 2. Update error msg and all related tests 3. Add explanations to header file Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D157331: [clang] Implement C23

2023-08-25 Thread Zijun Zhao via Phabricator via cfe-commits
ZijunZhao updated this revision to Diff 553639. ZijunZhao added a comment. Add integer type test and update c2x tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157331/new/ https://reviews.llvm.org/D157331 Files: clang/docs/ReleaseNotes.rst

[PATCH] D157331: [clang] Implement C23

2023-08-24 Thread Zijun Zhao via Phabricator via cfe-commits
ZijunZhao updated this revision to Diff 553274. ZijunZhao added a comment. Prevent result type from being short and fix the breaking in builtinoverflow.cpp Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157331/new/ https://reviews.llvm.org/D157331

[PATCH] D157331: [clang] Implement C23

2023-08-24 Thread Zijun Zhao via Phabricator via cfe-commits
ZijunZhao updated this revision to Diff 553199. ZijunZhao added a comment. Rename the warn_overflow_builtin_can_not_be_short for precision Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157331/new/ https://reviews.llvm.org/D157331 Files: clang/do

[PATCH] D157331: [clang] Implement C23

2023-08-23 Thread Zijun Zhao via Phabricator via cfe-commits
ZijunZhao updated this revision to Diff 552899. ZijunZhao marked 2 inline comments as done. ZijunZhao added a comment. 1. define __STDC_VERSION_STDCKDINT_H__ 2. check short type Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157331/new/ https://revi

[PATCH] D157331: [clang] Implement C23

2023-08-21 Thread Zijun Zhao via Phabricator via cfe-commits
ZijunZhao added inline comments. Comment at: clang/lib/Headers/stdckdint.h:1 +/*=== stdckdint.h - Standard header for checking integer + *-=== aaron.ballman wrote: > hiraditya wrote: > > nit: format. > The formatting for this is still

[PATCH] D157331: [clang] Implement C23

2023-08-21 Thread Zijun Zhao via Phabricator via cfe-commits
ZijunZhao added inline comments. Comment at: clang/test/C/C2x/n2683.c:16 + +bool flag_add = ckd_add(&result, a33, char_var); +bool flag_sub = ckd_sub(&result, bool_var, day); aaron.ballman wrote: > It looks like the builtins are missing some checks that a

[PATCH] D157331: [clang] Implement C23

2023-08-21 Thread Zijun Zhao via Phabricator via cfe-commits
ZijunZhao updated this revision to Diff 552177. ZijunZhao marked 9 inline comments as done. ZijunZhao added a comment. 1. Reformat test files in C/C2x 2. Update the definition and the test about `__STDC_VERSION_STDCKDINT_H__` 3. Update release docs and the introduction in the test file 4. Update R

[PATCH] D157331: [clang] Implement C23

2023-08-18 Thread Zijun Zhao via Phabricator via cfe-commits
ZijunZhao added a comment. Reformat clang/lib/Lex/PPDirectives.cpp. I use git-clang-format due to previous pre-check failure but lots of modifications in clang/lib/Lex/ directory. Should I keep running git-clang-format if the pre-check fails again? Repository: rG LLVM Github Monorepo CHANGE

[PATCH] D157331: [clang] Implement C23

2023-08-18 Thread Zijun Zhao via Phabricator via cfe-commits
ZijunZhao updated this revision to Diff 551607. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157331/new/ https://reviews.llvm.org/D157331 Files: clang/docs/ReleaseNotes.rst clang/lib/Headers/CMakeLists.txt clang/lib/Headers/stdckdint.h clan

[PATCH] D157331: [clang] Implement C23

2023-08-16 Thread Zijun Zhao via Phabricator via cfe-commits
ZijunZhao added inline comments. Comment at: clang/test/C/C2x/n2359.c:40 +#error "__STDC_VERSION_STDCKDINT_H__ not defined" +// expected-error@-1 {{"__STDC_VERSION_STDCKDINT_H__ not defined"}} +#endif enh wrote: > don't you need another test somewhere that this _

[PATCH] D157331: [clang] Implement C23

2023-08-16 Thread Zijun Zhao via Phabricator via cfe-commits
ZijunZhao added a comment. Skip `static_assert()` tests because `constexpr` is not supported in C23 yet: https://github.com/llvm/llvm-project/issues/64742 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157331/new/ https://reviews.llvm.org/D157331

[PATCH] D157331: [clang] Implement C23

2023-08-16 Thread Zijun Zhao via Phabricator via cfe-commits
ZijunZhao updated this revision to Diff 550910. ZijunZhao added a comment. 1. separate two files in clang/test/C/C2x 2. make some update about the macro __STDC_VERSION_STDCKDINT_H__ add the test for testing it Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.ll

[PATCH] D157331: [clang] Implement C23

2023-08-15 Thread Zijun Zhao via Phabricator via cfe-commits
ZijunZhao updated this revision to Diff 550547. ZijunZhao added a comment. 1. rename to .c file 2. create clang/test/C/C2x/n2683.c and add codegen tests and semantic tests 3. update clang/docs/ReleseNotes.rst 4. update clang/www/c_status.html 5. reformat PPDirectives.cpp 6. set __STDC_VERSION__ in

[PATCH] D157331: [clang] Implement C23

2023-08-11 Thread Zijun Zhao via Phabricator via cfe-commits
ZijunZhao added a comment. In D157331#4576540 , @aaron.ballman wrote: > In D157331#4575224 , @ZijunZhao > wrote: > >> Another followup question: I check >> https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2683

[PATCH] D157331: [clang] Implement C23

2023-08-09 Thread Zijun Zhao via Phabricator via cfe-commits
ZijunZhao added a comment. Another followup question: I check https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2683.pdf and I only add Core Proposal here. Do I need to add Supplemental Proposal, like some types? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://review

[PATCH] D157331: [clang] Implement C23

2023-08-09 Thread Zijun Zhao via Phabricator via cfe-commits
ZijunZhao added inline comments. Comment at: clang/lib/Headers/stdckdint.h:13 + +#if defined(__GNUC__) +#define ckd_add(R, A, B) __builtin_add_overflow((A), (B), (R)) cor3ntin wrote: > aaron.ballman wrote: > > hiraditya wrote: > > > enh wrote: > > > > hiraditya w

[PATCH] D157331: [clang] Implement C23

2023-08-09 Thread Zijun Zhao via Phabricator via cfe-commits
ZijunZhao added inline comments. Comment at: clang/test/Headers/stdckdint.cpp:1 +// RUN: %clang_cc1 -emit-llvm -fgnuc-version=4.2.1 -std=gnu++11 %s -o - | FileCheck %s + enh wrote: > ZijunZhao wrote: > > enh wrote: > > > ZijunZhao wrote: > > > > enh wrote: > > >

[PATCH] D157331: [clang] Implement C23

2023-08-08 Thread Zijun Zhao via Phabricator via cfe-commits
ZijunZhao added inline comments. Comment at: clang/test/Headers/stdckdint.cpp:1 +// RUN: %clang_cc1 -emit-llvm -fgnuc-version=4.2.1 -std=gnu++11 %s -o - | FileCheck %s + enh wrote: > ZijunZhao wrote: > > enh wrote: > > > hiraditya wrote: > > > > seems like we do

[PATCH] D157331: [clang] Implement C23

2023-08-08 Thread Zijun Zhao via Phabricator via cfe-commits
ZijunZhao added inline comments. Comment at: clang/test/Headers/stdckdint.cpp:1 +// RUN: %clang_cc1 -emit-llvm -fgnuc-version=4.2.1 -std=gnu++11 %s -o - | FileCheck %s + enh wrote: > hiraditya wrote: > > seems like we don't have a -std=gnu23, or -std=c23 standar

[PATCH] D157331: [clang] Implement C23

2023-08-07 Thread Zijun Zhao via Phabricator via cfe-commits
ZijunZhao added inline comments. Comment at: clang/lib/Headers/stdckdint.h:13 + +#if defined(__GNUC__) +#define ckd_add(R, A, B) __builtin_add_overflow((A), (B), (R)) enh wrote: > is this ever _not_ set for clang? https://github.com/llvm/llvm-project/blob/main/cl

[PATCH] D157331: [clang] Implement C23

2023-08-07 Thread Zijun Zhao via Phabricator via cfe-commits
ZijunZhao updated this revision to Diff 547986. ZijunZhao marked an inline comment as done. ZijunZhao added a comment. 1. Fix some format nits 2. Change `CHECK-NEXT` to `CHECK` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157331/new/ https://revie

[PATCH] D157331: [clang] Implement C23

2023-08-07 Thread Zijun Zhao via Phabricator via cfe-commits
ZijunZhao updated this revision to Diff 547949. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157331/new/ https://reviews.llvm.org/D157331 Files: clang/lib/Headers/CMakeLists.txt clang/lib/Headers/stdckdint.h clang/lib/Lex/ModuleMap.cpp clan

[PATCH] D157331: [clang] Implement C23

2023-08-07 Thread Zijun Zhao via Phabricator via cfe-commits
ZijunZhao created this revision. Herald added a project: All. ZijunZhao requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. https://github.com/llvm/llvm-project/issues/62248 Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D157