[clang] Extension: allow recursive macros (PR #65851)

2023-10-03 Thread via cfe-commits
https://github.com/kelbon updated https://github.com/llvm/llvm-project/pull/65851 >From d10ce5dd9e49fe85eac2e1f93a65cb27b511a71f Mon Sep 17 00:00:00 2001 From: Kelbon Nik Date: Sat, 9 Sep 2023 17:51:15 +0400 Subject: [PATCH 01/18] add define2 pp directive --- clang/include/clang/Basic/TokenKi

[clang] Extension: allow recursive macros (PR #65851)

2023-10-03 Thread via cfe-commits
https://github.com/kelbon updated https://github.com/llvm/llvm-project/pull/65851 >From d10ce5dd9e49fe85eac2e1f93a65cb27b511a71f Mon Sep 17 00:00:00 2001 From: Kelbon Nik Date: Sat, 9 Sep 2023 17:51:15 +0400 Subject: [PATCH 01/17] add define2 pp directive --- clang/include/clang/Basic/TokenKi

[clang] Extension: allow recursive macros (PR #65851)

2023-09-24 Thread via cfe-commits
kelbon wrote: Version with `__THIS_MACRO__` instead of new preprocessor directive is ready, so actual examples are like ```C++ #define reverse(head, ...) __VA_OPT__(__THIS_MACRO__(__VA_ARGS__) , ) head ``` `__THIS_MACRO__` behaves exactly as macro name(`reverse` in this case), but its allowed

[clang] Extension: allow recursive macros (PR #65851)

2023-09-24 Thread via cfe-commits
https://github.com/kelbon updated https://github.com/llvm/llvm-project/pull/65851 >From d10ce5dd9e49fe85eac2e1f93a65cb27b511a71f Mon Sep 17 00:00:00 2001 From: Kelbon Nik Date: Sat, 9 Sep 2023 17:51:15 +0400 Subject: [PATCH 01/16] add define2 pp directive --- clang/include/clang/Basic/TokenKi

[clang] Extension: allow recursive macros (PR #65851)

2023-09-24 Thread via cfe-commits
https://github.com/kelbon updated https://github.com/llvm/llvm-project/pull/65851 >From d10ce5dd9e49fe85eac2e1f93a65cb27b511a71f Mon Sep 17 00:00:00 2001 From: Kelbon Nik Date: Sat, 9 Sep 2023 17:51:15 +0400 Subject: [PATCH 01/15] add define2 pp directive --- clang/include/clang/Basic/TokenKi

[clang] Extension: allow recursive macros (PR #65851)

2023-09-24 Thread via cfe-commits
https://github.com/kelbon updated https://github.com/llvm/llvm-project/pull/65851 >From d10ce5dd9e49fe85eac2e1f93a65cb27b511a71f Mon Sep 17 00:00:00 2001 From: Kelbon Nik Date: Sat, 9 Sep 2023 17:51:15 +0400 Subject: [PATCH 01/14] add define2 pp directive --- clang/include/clang/Basic/TokenKi

[clang] Extension: allow recursive macros (PR #65851)

2023-09-24 Thread via cfe-commits
https://github.com/kelbon updated https://github.com/llvm/llvm-project/pull/65851 >From d10ce5dd9e49fe85eac2e1f93a65cb27b511a71f Mon Sep 17 00:00:00 2001 From: Kelbon Nik Date: Sat, 9 Sep 2023 17:51:15 +0400 Subject: [PATCH 01/13] add define2 pp directive --- clang/include/clang/Basic/TokenKi

[clang] Extension: allow recursive macros (PR #65851)

2023-09-24 Thread via cfe-commits
https://github.com/kelbon updated https://github.com/llvm/llvm-project/pull/65851 >From d10ce5dd9e49fe85eac2e1f93a65cb27b511a71f Mon Sep 17 00:00:00 2001 From: Kelbon Nik Date: Sat, 9 Sep 2023 17:51:15 +0400 Subject: [PATCH 01/12] add define2 pp directive --- clang/include/clang/Basic/TokenKi

[clang] Extension: allow recursive macros (PR #65851)

2023-09-24 Thread via cfe-commits
https://github.com/kelbon updated https://github.com/llvm/llvm-project/pull/65851 >From d10ce5dd9e49fe85eac2e1f93a65cb27b511a71f Mon Sep 17 00:00:00 2001 From: Kelbon Nik Date: Sat, 9 Sep 2023 17:51:15 +0400 Subject: [PATCH 01/11] add define2 pp directive --- clang/include/clang/Basic/TokenKi

[clang] Extension: allow recursive macros (PR #65851)

2023-09-24 Thread via cfe-commits
https://github.com/kelbon updated https://github.com/llvm/llvm-project/pull/65851 >From d10ce5dd9e49fe85eac2e1f93a65cb27b511a71f Mon Sep 17 00:00:00 2001 From: Kelbon Nik Date: Sat, 9 Sep 2023 17:51:15 +0400 Subject: [PATCH 01/10] add define2 pp directive --- clang/include/clang/Basic/TokenKi

[clang] Extension: allow recursive macros (PR #65851)

2023-09-24 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 6fbbcb4ee724e23edd0fcd5b51877aff19dabd77 49d7fa2e638f3903375f6f1de8443c63ff909a5d --

[clang] Extension: allow recursive macros (PR #65851)

2023-09-24 Thread via cfe-commits
https://github.com/kelbon updated https://github.com/llvm/llvm-project/pull/65851 >From d10ce5dd9e49fe85eac2e1f93a65cb27b511a71f Mon Sep 17 00:00:00 2001 From: Kelbon Nik Date: Sat, 9 Sep 2023 17:51:15 +0400 Subject: [PATCH 1/9] add define2 pp directive --- clang/include/clang/Basic/TokenKind

[clang] Extension: allow recursive macros (PR #65851)

2023-09-24 Thread via cfe-commits
https://github.com/kelbon updated https://github.com/llvm/llvm-project/pull/65851 >From 2f807b312baef8c6038c2452b84232acb6d6d2c2 Mon Sep 17 00:00:00 2001 From: Kelbon Nik Date: Sat, 9 Sep 2023 17:51:15 +0400 Subject: [PATCH 1/9] add define2 pp directive --- clang/include/clang/Basic/TokenKind

[clang] Extension: allow recursive macros (PR #65851)

2023-09-14 Thread via cfe-commits
https://github.com/cor3ntin requested changes to this pull request. A RFC is in progress here https://discourse.llvm.org/t/rfc-allow-recursive-macros-as-extension/73401 https://github.com/llvm/llvm-project/pull/65851 ___ cfe-commits mailing list cfe-co

[clang] Extension: allow recursive macros (PR #65851)

2023-09-11 Thread via cfe-commits
https://github.com/kelbon updated https://github.com/llvm/llvm-project/pull/65851: >From 2f807b312baef8c6038c2452b84232acb6d6d2c2 Mon Sep 17 00:00:00 2001 From: Kelbon Nik Date: Sat, 9 Sep 2023 17:51:15 +0400 Subject: [PATCH 1/8] add define2 pp directive --- clang/include/clang/Basic/TokenKin

[clang] Extension: allow recursive macros (PR #65851)

2023-09-11 Thread via cfe-commits
kelbon wrote: > this needs an RFC to be posted to Discourse so the community is aware of the > potential new language extension I will create it soon > I'm not certain it's a particularly good name in terms of standardization as > there's no way for users to distinguish between define and def

[clang] Extension: allow recursive macros (PR #65851)

2023-09-11 Thread via cfe-commits
https://github.com/kelbon updated https://github.com/llvm/llvm-project/pull/65851: >From 2f807b312baef8c6038c2452b84232acb6d6d2c2 Mon Sep 17 00:00:00 2001 From: Kelbon Nik Date: Sat, 9 Sep 2023 17:51:15 +0400 Subject: [PATCH 1/7] add define2 pp directive --- clang/include/clang/Basic/TokenKin

[clang] Extension: allow recursive macros (PR #65851)

2023-09-11 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: I'd like to echo what @cor3ntin suggested above -- this needs an RFC to be posted to Discourse so the community is aware of the potential new language extension. We have a set of criteria for what we're looking for in such an RFC: https://clang.llvm.org/get_involved.html#cr

[clang] Extension: allow recursive macros (PR #65851)

2023-09-11 Thread via cfe-commits
https://github.com/kelbon updated https://github.com/llvm/llvm-project/pull/65851: >From 2f807b312baef8c6038c2452b84232acb6d6d2c2 Mon Sep 17 00:00:00 2001 From: Kelbon Nik Date: Sat, 9 Sep 2023 17:51:15 +0400 Subject: [PATCH 1/6] add define2 pp directive --- clang/include/clang/Basic/TokenKin

[clang] Extension: allow recursive macros (PR #65851)

2023-09-11 Thread via cfe-commits
https://github.com/kelbon updated https://github.com/llvm/llvm-project/pull/65851: >From 2f807b312baef8c6038c2452b84232acb6d6d2c2 Mon Sep 17 00:00:00 2001 From: Kelbon Nik Date: Sat, 9 Sep 2023 17:51:15 +0400 Subject: [PATCH 1/5] add define2 pp directive --- clang/include/clang/Basic/TokenKin

[clang] Extension: allow recursive macros (PR #65851)

2023-09-11 Thread via cfe-commits
https://github.com/kelbon updated https://github.com/llvm/llvm-project/pull/65851: >From 2f807b312baef8c6038c2452b84232acb6d6d2c2 Mon Sep 17 00:00:00 2001 From: Kelbon Nik Date: Sat, 9 Sep 2023 17:51:15 +0400 Subject: [PATCH 1/3] add define2 pp directive --- clang/include/clang/Basic/TokenKin

[clang] Extension: allow recursive macros (PR #65851)

2023-09-10 Thread via cfe-commits
https://github.com/kelbon updated https://github.com/llvm/llvm-project/pull/65851: >From 2f807b312baef8c6038c2452b84232acb6d6d2c2 Mon Sep 17 00:00:00 2001 From: Kelbon Nik Date: Sat, 9 Sep 2023 17:51:15 +0400 Subject: [PATCH 1/2] add define2 pp directive --- clang/include/clang/Basic/TokenKin

[clang] Extension: allow recursive macros (PR #65851)

2023-09-09 Thread via cfe-commits
kelbon wrote: > How would you deal with the issue of infinite loops? The following program: > > ```c++ > #define2 boom(X) boom(X) > > boom(0) > ``` > > Will continue to infinitely(?) consume memory until it is killed, either by > the user or due to running out of memory on the system As fo o

[clang] Extension: allow recursive macros (PR #65851)

2023-09-09 Thread Emilia Kond via cfe-commits
rymiel wrote: How would you deal with the issue of infinite loops? The following program: ```cpp #define2 boom(X) boom(X) boom(0) ``` Will continue to infinitely(?) consume memory until it is killed, either by the user or due to running out of memory on the system https://github.com/llvm/llv

[clang] Extension: allow recursive macros (PR #65851)

2023-09-09 Thread via cfe-commits
kelbon wrote: > There are questions about the name, theorically this is an identifier that c > and c++ committees may want to use in the future. Yes, the name define2 is a placeholder, but the more I look at it, the more it looks appropriate > Is this something you plan to propose to other

[clang] Extension: allow recursive macros (PR #65851)

2023-09-09 Thread via cfe-commits
cor3ntin wrote: Compiler extensions are best proposed through a RFC, ie a discourse post here: https://discourse.llvm.org/c/clang/6 Explaining the motivation for the feature, which the pr description already does a good job. There are questions about the name, theorically this is an identifie

[clang] Extension: allow recursive macros (PR #65851)

2023-09-09 Thread via cfe-commits
https://github.com/kelbon edited https://github.com/llvm/llvm-project/pull/65851 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits