[clang] [StrTable] Mechanically convert Hexagon builtins to use TableGen (PR #123460)

2025-01-22 Thread Chandler Carruth via cfe-commits
https://github.com/chandlerc edited https://github.com/llvm/llvm-project/pull/123460 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [StrTable] Switch diag group names to `llvm::StringTable` (PR #123302)

2025-01-22 Thread Chandler Carruth via cfe-commits
https://github.com/chandlerc closed https://github.com/llvm/llvm-project/pull/123302 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lldb] [llvm] [StrTable] Switch the option parser to `llvm::StringTable` (PR #123308)

2025-01-22 Thread Chandler Carruth via cfe-commits
chandlerc wrote: Ping https://github.com/llvm/llvm-project/pull/123308 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [StrTable] Switch intrinsics to StringTable and work around MSVC (PR #123548)

2025-01-25 Thread Chandler Carruth via cfe-commits
@@ -51,28 +57,71 @@ class StringToOffsetTable { return II->second; } - // Emit the string using string literal concatenation, for better readability - // and searchability. - void EmitStringLiteralDef(raw_ostream &OS, const Twine &Decl, -co

[clang] Remove the `CustomEntry` escape hatch from builtin TableGen (PR #120861)

2025-01-14 Thread Chandler Carruth via cfe-commits
https://github.com/chandlerc closed https://github.com/llvm/llvm-project/pull/120861 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Mechanically convert NVPTX builtins to use TableGen (PR #122873)

2025-01-14 Thread Chandler Carruth via cfe-commits
chandlerc wrote: > ⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️ Note that the PR doesn't actually change the lines that `clang-format` changes here, and the `clang-format` change makes these lines inconsistent with the rest of the file, so I intentionally did not apply t

[clang] Mechanically convert NVPTX builtins to use TableGen (PR #122873)

2025-01-14 Thread Chandler Carruth via cfe-commits
chandlerc wrote: > > ⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️ > > Note that the PR doesn't actually change the lines that `clang-format` > changes here, and the `clang-format` change makes these lines inconsistent > with the rest of the file, so I intentionally did n

[clang] Bulk port 64-bit x86 builtins to TableGen (PR #121043)

2025-01-03 Thread Chandler Carruth via cfe-commits
chandlerc wrote: For many of the comments -- this, like the previous PR, is script generated based on the physical grouping of the current `.def` file. My preference would be to land it without trying to massage to better utilize the TableGen features, as I'd really like to get the first cut i

[clang] Bulk port 64-bit x86 builtins to TableGen (PR #121043)

2025-01-04 Thread Chandler Carruth via cfe-commits
https://github.com/chandlerc edited https://github.com/llvm/llvm-project/pull/121043 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Bulk port 64-bit x86 builtins to TableGen (PR #121043)

2025-01-04 Thread Chandler Carruth via cfe-commits
https://github.com/chandlerc closed https://github.com/llvm/llvm-project/pull/121043 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Mechanically port bulk of x86 builtins to TableGen (PR #120831)

2025-01-03 Thread Chandler Carruth via cfe-commits
@@ -108,9 +109,15 @@ class PrototypeParser { } else if (T.consume_back("&")) { ParseType(T); Type += "&"; +} else if (T.consume_front("long long")) { chandlerc wrote: This does maybe point at something that doesn't add much complexity -- I

[clang] Mechanically port bulk of x86 builtins to TableGen (PR #120831)

2025-01-04 Thread Chandler Carruth via cfe-commits
https://github.com/chandlerc closed https://github.com/llvm/llvm-project/pull/120831 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Mechanically port bulk of x86 builtins to TableGen (PR #120831)

2025-01-04 Thread Chandler Carruth via cfe-commits
chandlerc wrote: Thanks, merging! I've put the script here for posterity: https://gist.github.com/chandlerc/de807ea073beac351f87c660e1d4b7a0 https://github.com/llvm/llvm-project/pull/120831 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https

[clang] Mechanically port bulk of x86 builtins to TableGen (PR #120831)

2025-01-04 Thread Chandler Carruth via cfe-commits
https://github.com/chandlerc edited https://github.com/llvm/llvm-project/pull/120831 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Bulk port 64-bit x86 builtins to TableGen (PR #121043)

2025-01-04 Thread Chandler Carruth via cfe-commits
https://github.com/chandlerc updated https://github.com/llvm/llvm-project/pull/121043 >From 3314a7d9b2ab582769ce4b4438d24d31c280d9f8 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Tue, 24 Dec 2024 08:41:49 + Subject: [PATCH] Bulk port 64-bit x86 builtins to TableGen This PR follows

[clang] Mechanically port bulk of x86 builtins to TableGen (PR #120831)

2025-01-04 Thread Chandler Carruth via cfe-commits
@@ -108,9 +109,15 @@ class PrototypeParser { } else if (T.consume_back("&")) { ParseType(T); Type += "&"; +} else if (T.consume_front("long long")) { chandlerc wrote: Sure, I use the Fish shell and have a bunch of command line tools that he

[clang] Bulk port 64-bit x86 builtins to TableGen (PR #121043)

2025-01-04 Thread Chandler Carruth via cfe-commits
chandlerc wrote: Updated to rebase on top-of-tree with #120831 merged. Re-ran all the scripts to verify things. Using a variation on the command from my [comment](https://github.com/llvm/llvm-project/pull/120831#discussion_r1903059479) on the other PR: ```fish diff -u (rg '^TARGET' BuiltinsX

[clang] Bulk port 64-bit x86 builtins to TableGen (PR #121043)

2025-01-03 Thread Chandler Carruth via cfe-commits
chandlerc wrote: So looking through this, again, these are all done initially by automation. And the simple current form of that automation preserves the order of builtins in the `.def` file, and so can only merge groups when they are precisely adjacent. FWIW, I can add logic to my script to i

[clang] Mechanically port bulk of x86 builtins to TableGen (PR #120831)

2025-01-04 Thread Chandler Carruth via cfe-commits
@@ -108,9 +109,15 @@ class PrototypeParser { } else if (T.consume_back("&")) { ParseType(T); Type += "&"; +} else if (T.consume_front("long long")) { chandlerc wrote: Ok, PR updated with an explicit opt-in for OpenCL `long` type support. S

[clang] Mechanically port bulk of x86 builtins to TableGen (PR #120831)

2025-01-03 Thread Chandler Carruth via cfe-commits
chandlerc wrote: Ping, rebased to top-of-tree. @phoebewang -- I think you're the most relevant reviewer here. If the `O` vs. `LL` thing is really a blocker despite the added information, I'd like to know so I can explore options to switch back. All of the ones I've come up with add complexity

[clang] Remove the `CustomEntry` escape hatch from builtin TableGen (PR #120861)

2025-01-03 Thread Chandler Carruth via cfe-commits
https://github.com/chandlerc updated https://github.com/llvm/llvm-project/pull/120861 >From e50a1dc121c00be4451d70b9bcdd1f3b6dbc98da Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Sat, 21 Dec 2024 23:42:57 + Subject: [PATCH] Remove the `CustomEntry` escape hatch from builtin TableGen

[clang] Remove the `CustomEntry` escape hatch from builtin TableGen (PR #120861)

2025-01-03 Thread Chandler Carruth via cfe-commits
chandlerc wrote: Rebased -- ping for a review in the new year maybe? I think this one is pretty simple... https://github.com/llvm/llvm-project/pull/120861 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

[clang] Factor common code for quoting a builtin name (PR #120835)

2025-01-03 Thread Chandler Carruth via cfe-commits
https://github.com/chandlerc closed https://github.com/llvm/llvm-project/pull/120835 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Mechanically port bulk of x86 builtins to TableGen (PR #120831)

2025-01-03 Thread Chandler Carruth via cfe-commits
@@ -108,9 +109,15 @@ class PrototypeParser { } else if (T.consume_back("&")) { ParseType(T); Type += "&"; +} else if (T.consume_front("long long")) { chandlerc wrote: Not sure -- the vast majority of x86 builtins use `O` for this. It's a n

[clang] Mechanically port bulk of x86 builtins to TableGen (PR #120831)

2025-01-04 Thread Chandler Carruth via cfe-commits
chandlerc wrote: > LLVM Buildbot has detected a new failure on builder `clang-debian-cpp20` > running on `clang-debian-cpp20` while building `clang` at step 6 > "test-build-unified-tree-check-all". > > Full details are available at: > https://lab.llvm.org/buildbot/#/builders/108/builds/7722 >

[clang] Patch series to reapply #118734 and substantially improve it (PR #120534)

2025-01-05 Thread Chandler Carruth via cfe-commits
chandlerc wrote: > > @dyung -- Ok, my latest attempt to work around these MSVC issues is now > > pushed to this PR. It also contains a commit of specifically debugging > > hacks to try and extract more information from any failure here. If you > > could try doing another build with the latest

[clang] Bulk port 64-bit x86 builtins to TableGen (PR #121043)

2025-01-04 Thread Chandler Carruth via cfe-commits
chandlerc wrote: I've put the script in a gist here: https://gist.github.com/chandlerc/de807ea073beac351f87c660e1d4b7a0 X-macros: the `BUILTIN(...)` macro invocations in an included file, where the includer defines those macros to a specific pattern. https://en.wikipedia.org/wiki/X_macro LLVM

[clang] Patch series to reapply #118734 and substantially improve it (PR #120534)

2025-01-05 Thread Chandler Carruth via cfe-commits
chandlerc wrote: @dyung -- Ok, my latest attempt to work around these MSVC issues is now pushed to this PR. It also contains a commit of specifically debugging hacks to try and extract more information from any failure here. If you could try doing another build with the latest commit ([2ec750

[clang] Patch series to reapply #118734 and substantially improve it (PR #120534)

2024-12-22 Thread Chandler Carruth via cfe-commits
@@ -68,23 +70,144 @@ enum ID { FirstTSBuiltin }; +// The info used to represent each builtin. struct Info { - llvm::StringLiteral Name; - const char *Type, *Attributes; - const char *Features; + // Rather than store pointers to the string literals describing these four

[clang] Patch series to reapply #118734 and substantially improve it (PR #120534)

2024-12-22 Thread Chandler Carruth via cfe-commits
@@ -100,10 +244,17 @@ class Context { /// Return the identifier name for the specified builtin, /// e.g. "__builtin_abs". - llvm::StringRef getName(unsigned ID) const { return getRecord(ID).Name; } + std::string getName(unsigned ID) const; + + /// Return the identifier

[clang] Patch series to reapply #118734 and substantially improve it (PR #120534)

2024-12-22 Thread Chandler Carruth via cfe-commits
@@ -100,10 +244,17 @@ class Context { /// Return the identifier name for the specified builtin, /// e.g. "__builtin_abs". - llvm::StringRef getName(unsigned ID) const { return getRecord(ID).Name; } + std::string getName(unsigned ID) const; chandlerc wrot

[clang] Patch series to reapply #118734 and substantially improve it (PR #120534)

2024-12-22 Thread Chandler Carruth via cfe-commits
@@ -68,23 +70,144 @@ enum ID { FirstTSBuiltin }; +// The info used to represent each builtin. struct Info { - llvm::StringLiteral Name; - const char *Type, *Attributes; - const char *Features; + // Rather than store pointers to the string literals describing these four

[clang] Patch series to reapply #118734 and substantially improve it (PR #120534)

2024-12-22 Thread Chandler Carruth via cfe-commits
https://github.com/chandlerc commented: I think I've addressed most of the review comments here at this point. But maybe most excitingly, I think the latest version may dodge the issues that have cropped up with MSVC -- both LoongArch and X86 fixes have been incorporated that hopefully help. @

[clang] Patch series to reapply #118734 and substantially improve it (PR #120534)

2024-12-22 Thread Chandler Carruth via cfe-commits
https://github.com/chandlerc edited https://github.com/llvm/llvm-project/pull/120534 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Patch series to reapply #118734 and substantially improve it (PR #120534)

2024-12-22 Thread Chandler Carruth via cfe-commits
@@ -112,6 +112,16 @@ static constexpr std::array MakeInfos(std::array Infos) { return Infos; } +/// A shard of a target's builtins string table and info. +/// +/// Target builtins are sharded across multiple tables due to different +/// structures, origins, and also to impr

[clang] Patch series to reapply #118734 and substantially improve it (PR #120534)

2025-01-15 Thread Chandler Carruth via cfe-commits
chandlerc wrote: @dyung -- this PR is updated with new fixes. NVPTX hopefully works and neither of my debugging checks fires. But there may still be some other failures I need to chase down, let me know? https://github.com/llvm/llvm-project/pull/120534 _

[clang] Patch series to reapply #118734 and substantially improve it (PR #120534)

2025-01-15 Thread Chandler Carruth via cfe-commits
chandlerc wrote: > @dyung -- this PR is updated with new fixes. NVPTX hopefully works and > neither of my debugging checks fires. But there may still be some other > failures I need to chase down, let me know? Hmm, looks like there are likely to be ARM and Hexagon failures remaining at least.

[clang] Patch series to reapply #118734 and substantially improve it (PR #120534)

2025-01-15 Thread Chandler Carruth via cfe-commits
chandlerc wrote: > > > @dyung -- this PR is updated with new fixes. NVPTX hopefully works and > > > neither of my debugging checks fires. But there may still be some other > > > failures I need to chase down, let me know? > > > > > > Hmm, looks like there are likely to be ARM and Hexagon fail

[clang] Patch series to reapply #118734 and substantially improve it (PR #120534)

2025-01-16 Thread Chandler Carruth via cfe-commits
chandlerc wrote: > > Is there any hope of upgrading MSVC? I know you were looking at that, but > > not sure what progress happened there. > > I didn't go through with it and was hoping you would be able to find a > work-around. I'll start talking to people to try and do a stop-gap update to >

[clang] [llvm] [StrTable] Switch diag group names to `llvm::StringTable` (PR #123302)

2025-01-17 Thread Chandler Carruth via cfe-commits
https://github.com/chandlerc created https://github.com/llvm/llvm-project/pull/123302 Previously, they used a hand-rolled Pascal-string encoding different from all the other string tables produced from TableGen. This moves them to use the newly introduced runtime abstraction, and enhances that

[clang] [lldb] [llvm] [StrTable] Switch the option parser to `llvm::StringTable` (PR #123308)

2025-01-17 Thread Chandler Carruth via cfe-commits
https://github.com/chandlerc created https://github.com/llvm/llvm-project/pull/123308 Now that we have a dedicated abstraction for string tables, switch the option parser library's string table over to it rather than using a raw `const char*`. Also try to use the `StringTable::Offset` type rat

[clang] Make the `-disable-free` flag more full featured (PR #136213)

2025-04-17 Thread Chandler Carruth via cfe-commits
@@ -7889,9 +7889,13 @@ def code_completion_with_fixits : Flag<["-"], "code-completion-with-fixits">, def skip_function_bodies : Flag<["-"], "skip-function-bodies">, HelpText<"Skip function bodies when possible">, MarshallingInfoFlag>; -def disable_free : Flag<["-"], "disab

[clang] Make the `-disable-free` flag more full featured (PR #136213)

2025-04-17 Thread Chandler Carruth via cfe-commits
https://github.com/chandlerc closed https://github.com/llvm/llvm-project/pull/136213 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Make the `-disable-free` flag more full featured (PR #136213)

2025-04-17 Thread Chandler Carruth via cfe-commits
@@ -7889,9 +7889,13 @@ def code_completion_with_fixits : Flag<["-"], "code-completion-with-fixits">, def skip_function_bodies : Flag<["-"], "skip-function-bodies">, HelpText<"Skip function bodies when possible">, MarshallingInfoFlag>; -def disable_free : Flag<["-"], "disab

[clang] Make the `-disable-free` flag more full featured (PR #136213)

2025-04-17 Thread Chandler Carruth via cfe-commits
@@ -7889,9 +7889,13 @@ def code_completion_with_fixits : Flag<["-"], "code-completion-with-fixits">, def skip_function_bodies : Flag<["-"], "skip-function-bodies">, HelpText<"Skip function bodies when possible">, MarshallingInfoFlag>; -def disable_free : Flag<["-"], "disab

[clang] Make the `-disable-free` flag more full featured (PR #136213)

2025-04-17 Thread Chandler Carruth via cfe-commits
https://github.com/chandlerc updated https://github.com/llvm/llvm-project/pull/136213 >From 6c53f36e9306d5abc50b9afcc1fe6a204d67c6e1 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Wed, 16 Apr 2025 22:57:18 + Subject: [PATCH] Make the `-disable-free` flag more full featured This lets

[clang] Remove no-op visibility markers (PR #136271)

2025-04-18 Thread Chandler Carruth via cfe-commits
https://github.com/chandlerc created https://github.com/llvm/llvm-project/pull/136271 Richard Smith noticed that these are overridden by the surrounding visibility `let` region. Remove them to avoid confusion. This should be a no-op given how the `.td` file is structured. >From 541894c25062d6

[clang] Make the `-disable-free` flag more full featured (PR #136213)

2025-04-18 Thread Chandler Carruth via cfe-commits
chandlerc wrote: Follow-up PR as requested: #136271 https://github.com/llvm/llvm-project/pull/136213 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Make the `-disable-free` flag more full featured (PR #136213)

2025-04-18 Thread Chandler Carruth via cfe-commits
https://github.com/chandlerc created https://github.com/llvm/llvm-project/pull/136213 This lets us pass `-no-disable-free` to re-enable freeing memory for example. This is especially helpful for library users of Clang where it is important to not slowly leak memory. >From 4e4ca5ab0f49252ea5a5

[clang] Make the `-disable-free` flag more full featured (PR #136213)

2025-04-18 Thread Chandler Carruth via cfe-commits
chandlerc wrote: > You might want to change the `DisableFree` default for library uses so that > users don't need to specify `-no-disable-free`. > > ``` > // Clang calls BuryPointer on the internal AST and CodeGen-related elements > like TargetMachine. > // This will cause memory leaks if

<    1   2   3   4