[clang] [clang-format][NFC] Eliminate the IsCpp parameter in all functions (PR #84599)

2024-03-19 Thread Benjamin Kramer via cfe-commits
d0k wrote: It calls `clang::format::cleanupAroundReplacements` from multiple threads. Now there's a race condition on IsCpp. If this was supposed to be a cleanup please revert it. https://github.com/llvm/llvm-project/pull/84599 ___ cfe-commits mailin

[clang] [clang-format][NFC] Eliminate the IsCpp parameter in all functions (PR #84599)

2024-03-18 Thread Owen Pan via cfe-commits
owenca wrote: Can you provide more info about the failed use cases? https://github.com/llvm/llvm-project/pull/84599 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format][NFC] Eliminate the IsCpp parameter in all functions (PR #84599)

2024-03-18 Thread Benjamin Kramer via cfe-commits
d0k wrote: This is now breaking multithreaded IDE use cases, can you explain why this change is necessary? https://github.com/llvm/llvm-project/pull/84599 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

[clang] [clang-format][NFC] Eliminate the IsCpp parameter in all functions (PR #84599)

2024-03-14 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/84599 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format][NFC] Eliminate the IsCpp parameter in all functions (PR #84599)

2024-03-14 Thread Björn Schäpers via cfe-commits
HazardyKnusperkeks wrote: > > I mean multiple threads in the same process with different languages. maybe > > unlikely, but not impossible. > > But libFormat/clang-format are _not_ multithreaded, right? clang-format is not, but libFormat I don't know. I know my IDE uses directly libFormat. I

[clang] [clang-format][NFC] Eliminate the IsCpp parameter in all functions (PR #84599)

2024-03-13 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/84599 >From 43238d58ff490073c13ff621faddceb89b05b22e Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 8 Mar 2024 19:47:54 -0800 Subject: [PATCH 1/2] [clang-format][NFC] Eliminate the IsCpp parameter in all functions

[clang] [clang-format][NFC] Eliminate the IsCpp parameter in all functions (PR #84599)

2024-03-11 Thread Owen Pan via cfe-commits
owenca wrote: > I mean multiple threads in the same process with different languages. maybe > unlikely, but not impossible. But libFormat/clang-format are _not_ multithreaded, right? https://github.com/llvm/llvm-project/pull/84599 ___ cfe-commits mai

[clang] [clang-format][NFC] Eliminate the IsCpp parameter in all functions (PR #84599)

2024-03-11 Thread Björn Schäpers via cfe-commits
HazardyKnusperkeks wrote: > > What happens if you use libFormat concurrently? > > Can you elaborate? Doesn't each process get its own copy of the globals of a > shared library? I mean multiple threads in the same process with different languages. maybe unlikely, but not impossible. https://g

[clang] [clang-format][NFC] Eliminate the IsCpp parameter in all functions (PR #84599)

2024-03-11 Thread via cfe-commits
https://github.com/mydeveloperday approved this pull request. This looks good to me https://github.com/llvm/llvm-project/pull/84599 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format][NFC] Eliminate the IsCpp parameter in all functions (PR #84599)

2024-03-10 Thread Owen Pan via cfe-commits
owenca wrote: > Then I'd go back to `Style.isCpp()`. That would still require passing `Style.isCpp()` as the parameter to the `FormatToken` (and other) functions. > What happens if you use libFormat concurrently? Can you elaborate? Doesn't each process get its own copy of the globals of a sh

[clang] [clang-format][NFC] Eliminate the IsCpp parameter in all functions (PR #84599)

2024-03-10 Thread Björn Schäpers via cfe-commits
HazardyKnusperkeks wrote: Then I'd go back to `Style.isCpp()`. What happens if you use libFormat concurrently? https://github.com/llvm/llvm-project/pull/84599 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailm

[clang] [clang-format][NFC] Eliminate the IsCpp parameter in all functions (PR #84599)

2024-03-09 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/84599 >From 43238d58ff490073c13ff621faddceb89b05b22e Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 8 Mar 2024 19:47:54 -0800 Subject: [PATCH 1/2] [clang-format][NFC] Eliminate the IsCpp parameter in all functions

[clang] [clang-format][NFC] Eliminate the IsCpp parameter in all functions (PR #84599)

2024-03-09 Thread Owen Pan via cfe-commits
owenca wrote: > That's okay for clang-format, but you couldn't use libFormat with different > languages at once anymore. I believe we still could because `IsCpp` is set to `Style.isCpp()` every time new instances of the classes are constructed. I'll add a couple of test cases to demonstrate t

[clang] [clang-format][NFC] Eliminate the IsCpp parameter in all functions (PR #84599)

2024-03-09 Thread Björn Schäpers via cfe-commits
HazardyKnusperkeks wrote: That's okay for clang-format, but you couldn't use libFormat with different languages at once anymore. I dislike global state in libraries. https://github.com/llvm/llvm-project/pull/84599 ___ cfe-commits mailing list cfe-com

[clang] [clang-format][NFC] Eliminate the IsCpp parameter in all functions (PR #84599)

2024-03-08 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/84599 >From 43238d58ff490073c13ff621faddceb89b05b22e Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 8 Mar 2024 19:47:54 -0800 Subject: [PATCH] [clang-format][NFC] Eliminate the IsCpp parameter in all functions ---

[clang] [clang-format][NFC] Eliminate the IsCpp parameter in all functions (PR #84599)

2024-03-08 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-format Author: Owen Pan (owenca) Changes --- Patch is 25.61 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/84599.diff 12 Files Affected: - (modified) clang/include/clang/Format/Format.h (+2) - (mo

[clang] [clang-format][NFC] Eliminate the IsCpp parameter in all functions (PR #84599)

2024-03-08 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/84599 None >From bd3e866189ad4c238ea0afbbc30fbe88e0406eb9 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 8 Mar 2024 19:47:54 -0800 Subject: [PATCH] [clang-format][NFC] Eliminate the IsCpp parameter in all function