[PATCH] D115253: [C2x] Support the *_WIDTH macros in limits.h and stdint.h

2022-01-13 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman closed this revision. aaron.ballman added a comment. In D115253#3240789 , @jyknight wrote: > Accepting assuming the last comment will be addressed before pushing. Thanks! Thank you for the excellent reviews, I really appreciate it! I made

[PATCH] D115253: [C2x] Support the *_WIDTH macros in limits.h and stdint.h

2022-01-13 Thread James Y Knight via Phabricator via cfe-commits
jyknight accepted this revision. jyknight added a comment. Accepting assuming the last comment will be addressed before pushing. Thanks! Comment at: clang/lib/Frontend/InitPreprocessor.cpp:257 + if (IsSigned) +DefineTypeSizeAndWidth("__INT" + Twine(TypeWidth), Ty, TI, Buil

[PATCH] D115253: [C2x] Support the *_WIDTH macros in limits.h and stdint.h

2022-01-12 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman updated this revision to Diff 399383. aaron.ballman added a comment. Reworked a different way -- expose the signed versions of the width macros rather than the unsigned versions or both versions. Note, `__UINTPTR_WIDTH__` and `__UINTMAX_WIDTH__` were both preexisting macros, so I d

[PATCH] D115253: [C2x] Support the *_WIDTH macros in limits.h and stdint.h

2022-01-12 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/Frontend/InitPreprocessor.cpp:900-903 + Builder.defineMacro("__USHRT_WIDTH__", Twine(TI.getShortWidth())); + Builder.defineMacro("__UINT_WIDTH__", Twine(TI.getIntWidth())); + Builder.defineMacro("__ULONG_WIDTH__", Twin

[PATCH] D115253: [C2x] Support the *_WIDTH macros in limits.h and stdint.h

2022-01-12 Thread James Y Knight via Phabricator via cfe-commits
jyknight added inline comments. Comment at: clang/lib/Frontend/InitPreprocessor.cpp:900-903 + Builder.defineMacro("__USHRT_WIDTH__", Twine(TI.getShortWidth())); + Builder.defineMacro("__UINT_WIDTH__", Twine(TI.getIntWidth())); + Builder.defineMacro("__ULONG_WIDTH__", Twine(TI.

[PATCH] D115253: [C2x] Support the *_WIDTH macros in limits.h and stdint.h

2022-01-12 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/Frontend/InitPreprocessor.cpp:900-903 + Builder.defineMacro("__USHRT_WIDTH__", Twine(TI.getShortWidth())); + Builder.defineMacro("__UINT_WIDTH__", Twine(TI.getIntWidth())); + Builder.defineMacro("__ULONG_WIDTH__", Twin

[PATCH] D115253: [C2x] Support the *_WIDTH macros in limits.h and stdint.h

2022-01-12 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman updated this revision to Diff 399337. aaron.ballman added a comment. Updating based on review feedback -- adds the signed versions of the __macros__ for consistency and uses them in limits.h. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115253/new/ https://reviews.llvm.o

[PATCH] D115253: [C2x] Support the *_WIDTH macros in limits.h and stdint.h

2022-01-11 Thread James Y Knight via Phabricator via cfe-commits
jyknight added inline comments. Comment at: clang/lib/Frontend/InitPreprocessor.cpp:900-903 + Builder.defineMacro("__USHRT_WIDTH__", Twine(TI.getShortWidth())); + Builder.defineMacro("__UINT_WIDTH__", Twine(TI.getIntWidth())); + Builder.defineMacro("__ULONG_WIDTH__", Twine(TI.

[PATCH] D115253: [C2x] Support the *_WIDTH macros in limits.h and stdint.h

2022-01-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D115253#3217331 , @aaron.ballman wrote: > Ping Ping (I'd like to get this into Clang 14 as I have follow-up work that's related for `_BitInt` support in C23). CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115

[PATCH] D115253: [C2x] Support the *_WIDTH macros in limits.h and stdint.h

2022-01-03 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. Ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115253/new/ https://reviews.llvm.org/D115253 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D115253: [C2x] Support the *_WIDTH macros in limits.h and stdint.h

2021-12-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman updated this revision to Diff 394320. aaron.ballman added a comment. Updated based on review feedback. This protects all of the _WIDTH macros in stdint.h, which was a previous oversight. It also corrects the test case to actually test the scenario we care about (which requires that

[PATCH] D115253: [C2x] Support the *_WIDTH macros in limits.h and stdint.h

2021-12-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/Frontend/InitPreprocessor.cpp:900-903 + Builder.defineMacro("__USHRT_WIDTH__", Twine(TI.getShortWidth())); + Builder.defineMacro("__UINT_WIDTH__", Twine(TI.getIntWidth())); + Builder.defineMacro("__ULONG_WIDTH__", Twin

[PATCH] D115253: [C2x] Support the *_WIDTH macros in limits.h and stdint.h

2021-12-14 Thread James Y Knight via Phabricator via cfe-commits
jyknight added inline comments. Comment at: clang/lib/Frontend/InitPreprocessor.cpp:900-903 + Builder.defineMacro("__USHRT_WIDTH__", Twine(TI.getShortWidth())); + Builder.defineMacro("__UINT_WIDTH__", Twine(TI.getIntWidth())); + Builder.defineMacro("__ULONG_WIDTH__", Twine(TI.

[PATCH] D115253: [C2x] Support the *_WIDTH macros in limits.h and stdint.h

2021-12-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D115253#3192652 , @aaron.ballman wrote: > Updating based on off-list review feedback and adding a new reviewer. This added `DefineTypeSizeAndWidth()` as a helper for setting the `_MAX` and `_WIDTH` macros as a pair and

[PATCH] D115253: [C2x] Support the *_WIDTH macros in limits.h and stdint.h

2021-12-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman updated this revision to Diff 394291. aaron.ballman added a reviewer: joerg. aaron.ballman added a comment. Updating based on off-list review feedback and adding a new reviewer. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115253/new/ https://reviews.llvm.org/D115253 Fil

[PATCH] D115253: [C2x] Support the *_WIDTH macros in limits.h and stdint.h

2021-12-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. Ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115253/new/ https://reviews.llvm.org/D115253 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D115253: [C2x] Support the *_WIDTH macros in limits.h and stdint.h

2021-12-07 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added inline comments. Comment at: clang/test/Headers/limits.cpp:33 -const bool char_is_signed = (char)-1 < (char)0; -_Static_assert(CHAR_MIN == (char_is_signed ? -CHAR_MAX-1 : 0), ""); -_Static_assert(CHAR_MAX == (char_is_signed ? -(CHAR_MIN+1) : (char)~0ULL), "");

[PATCH] D115253: [C2x] Support the *_WIDTH macros in limits.h and stdint.h

2021-12-07 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman updated this revision to Diff 392424. aaron.ballman marked 2 inline comments as done. aaron.ballman added a comment. Updated based on review feedback. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115253/new/ https://reviews.llvm.org/D115253 Files: clang/docs/ReleaseNot

[PATCH] D115253: [C2x] Support the *_WIDTH macros in limits.h and stdint.h

2021-12-07 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman marked 2 inline comments as done. aaron.ballman added inline comments. Comment at: clang/lib/Frontend/InitPreprocessor.cpp:260 DefineFmt(Prefix + Twine(TypeWidth), Ty, TI, Builder); + DefineTypeWidth(Prefix + Twine(TypeWidth) + "_WIDTH__", Ty, TI, Builder); } -

[PATCH] D115253: [C2x] Support the *_WIDTH macros in limits.h and stdint.h

2021-12-07 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added a comment. A few nits, but not nearly 'expert' enough to approve without giving everyone else some time to look this over. Comment at: clang/lib/Frontend/InitPreprocessor.cpp:260 DefineFmt(Prefix + Twine(TypeWidth), Ty, TI, Builder); + DefineTypeWidth(Pref

[PATCH] D115253: [C2x] Support the *_WIDTH macros in limits.h and stdint.h

2021-12-07 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman created this revision. aaron.ballman added reviewers: rsmith, jfb, jyknight, erichkeane. Herald added subscribers: mstorsjo, fedor.sergeev, dschuff. aaron.ballman requested review of this revision. Herald added a subscriber: aheejin. Herald added a project: clang. This completes the