[clang] [RISCV][FMV] Support target_version (PR #99040)

2024-09-22 Thread Craig Topper via cfe-commits
@@ -3056,6 +3056,45 @@ bool Sema::checkTargetVersionAttr(SourceLocation LiteralLoc, Decl *D, enum SecondParam { None }; enum ThirdParam { Target, TargetClones, TargetVersion }; llvm::SmallVector Features; + if (Context.getTargetInfo().getTriple().isRISCV()) { + +llv

[clang] [llvm] [RISCV][VCIX] Add vcix_state to GNU inline assembly register set (PR #106914)

2024-09-22 Thread Brandon Wu via cfe-commits
@@ -44,7 +44,7 @@ ArrayRef RISCVTargetInfo::getGCCRegNames() const { "v24", "v25", "v26", "v27", "v28", "v29", "v30", "v31", // CSRs - "fflags", "frm", "vtype", "vl", "vxsat", "vxrm" + "fflags", "frm", "vtype", "vl", "vxsat", "vxrm", "sf_vcix_state"

[clang-tools-extra] Add clang-tidy external examples (PR #106675)

2024-09-22 Thread Danny Mösch via cfe-commits
SimplyDanny wrote: There is an error in doc generation. Is it caused by the new file being added? Is there a configuration that needs adaption? https://github.com/llvm/llvm-project/pull/106675 ___ cfe-commits mailing list cfe-commits@lists.llvm.org ht

[clang] [Clang] Include the clang-shlib CMake project when building for MSVC (PR #109457)

2024-09-22 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `llvm-clang-aarch64-darwin` running on `doug-worker-4` while building `clang` at step 6 "test-build-unified-tree-check-all". Full details are available at: https://lab.llvm.org/buildbot/#/builders/190/builds/6283 Here is the

[clang] [llvm] [KCFI][NFC] Rename the !kcfi_type Function metadata to !cfi_type (PR #109080)

2024-09-22 Thread Fangrui Song via cfe-commits
MaskRay wrote: > > I feel that we should make such renaming at this time. > > But then you propose that we make the renaming now. (??) Sorry, it's a typo. We should not do the renaming, unless there is strong argument renaming is useful. https://github.com/llvm/llvm-project/pull/109080 __

[clang] [clang] [Driver] Ensure we error on lto with link.exe and target `*-windows-msvc` on non cl driver modes (PR #109607)

2024-09-22 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/109607 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] [Driver] Ensure we error on lto with link.exe and target `*-windows-msvc` on non cl driver modes (PR #109607)

2024-09-22 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/109607 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] [Driver] Ensure we error on lto with link.exe and target `*-windows-msvc` on non cl driver modes (PR #109607)

2024-09-22 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/109607 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] [Driver] Ensure we error on lto with link.exe and target `*-windows-msvc` on non cl driver modes (PR #109607)

2024-09-22 Thread Fangrui Song via cfe-commits
@@ -5,7 +5,7 @@ // CHECK-COMPILE-ACTIONS: 2: compiler, {1}, ir // CHECK-COMPILE-ACTIONS: 3: backend, {2}, lto-bc -// RUN: %clang -ccc-print-phases %s -flto 2> %t +// RUN: %clang -ccc-print-phases -fuse-ld=lld %s -flto 2> %t MaskRay wrote: This requirement is

[clang] [clang] [Driver] Ensure we error on lto with link.exe and target `*-windows-msvc` on non cl driver modes (PR #109607)

2024-09-22 Thread Fangrui Song via cfe-commits
@@ -605,7 +605,7 @@ // RUN: %clang -### -S -fjmc -g -fno-jmc -target x86_64-pc-windows-msvc %s 2>&1 | FileCheck -check-prefix=CHECK_NOJMC %s // RUN: %clang -### -S -fjmc -g -target x86_64-unknown-linux %s 2>&1 | FileCheck -check-prefix=CHECK_JMC %s // RUN: %clang -### -S -fjm

[clang] [RISCV][FMV] Support target_version (PR #99040)

2024-09-22 Thread Piyou Chen via cfe-commits
@@ -3056,6 +3056,45 @@ bool Sema::checkTargetVersionAttr(SourceLocation LiteralLoc, Decl *D, enum SecondParam { None }; enum ThirdParam { Target, TargetClones, TargetVersion }; llvm::SmallVector Features; + if (Context.getTargetInfo().getTriple().isRISCV()) { + +llv

[clang] [RISCV][FMV] Support target_version (PR #99040)

2024-09-22 Thread Piyou Chen via cfe-commits
@@ -3056,6 +3056,45 @@ bool Sema::checkTargetVersionAttr(SourceLocation LiteralLoc, Decl *D, enum SecondParam { None }; enum ThirdParam { Target, TargetClones, TargetVersion }; llvm::SmallVector Features; + if (Context.getTargetInfo().getTriple().isRISCV()) { + +llv

[clang] [RISCV][FMV] Support target_version (PR #99040)

2024-09-22 Thread Piyou Chen via cfe-commits
@@ -15501,8 +15511,10 @@ Decl *Sema::ActOnStartOfFunctionDef(Scope *FnBodyScope, Decl *D, FD->setInvalidDecl(); } if (const auto *Attr = FD->getAttr()) { -if (!Context.getTargetInfo().hasFeature("fmv") && -!Attr->isDefaultVersion()) { +if (Context.getTa

[clang] [RISCV][FMV] Support target_version (PR #99040)

2024-09-22 Thread Piyou Chen via cfe-commits
@@ -4268,8 +4268,12 @@ void CodeGenModule::emitMultiVersionFunctions() { } else if (const auto *TVA = CurFD->getAttr()) { if (TVA->isDefaultVersion() && IsDefined) ShouldEmitResolver = true; -TVA->getFeatures(Feats);

[clang] [RISCV][FMV] Support target_version (PR #99040)

2024-09-22 Thread Piyou Chen via cfe-commits
@@ -14270,9 +14270,16 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap, Target->initFeatureMap(FeatureMap, getDiagnostics(), TargetCPU, Features); } } else if (const auto *TV = FD->getAttr()) { -llvm::SmallVector Feats; -TV->getFeature

[clang] [RISCV][FMV] Support target_version (PR #99040)

2024-09-22 Thread Piyou Chen via cfe-commits
https://github.com/BeMg updated https://github.com/llvm/llvm-project/pull/99040 >From 54b5d6833a52271dfd1ca3912d5d9e886b1970c2 Mon Sep 17 00:00:00 2001 From: Piyou Chen Date: Tue, 19 Mar 2024 02:02:35 -0700 Subject: [PATCH 1/9] [RISCV][FMV] Support target_version --- clang/lib/AST/ASTContext.c

[clang] [Clang] Add explicit visibility symbol macros (PR #108276)

2024-09-22 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: > > One thing I don't understand about this PR is why we need Compiler.h in > > Clang -- wouldn't the LLVM definitions in their Compiler.h work for Clang > > as well? (This would probably be worth explaining in the patch summary.) > > The symbol lookup in PE/COFF is two level

[clang] [Clang] Include the clang-shlib CMake project when building for MSVC (PR #109457)

2024-09-22 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev closed https://github.com/llvm/llvm-project/pull/109457 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 80cdc37 - [Clang] Include the clang-shlib CMake project when building for MSVC (#109457)

2024-09-22 Thread via cfe-commits
Author: Thomas Fransham Date: 2024-09-23T07:24:04+02:00 New Revision: 80cdc3718036cd3ee33424953821ac01046d5278 URL: https://github.com/llvm/llvm-project/commit/80cdc3718036cd3ee33424953821ac01046d5278 DIFF: https://github.com/llvm/llvm-project/commit/80cdc3718036cd3ee33424953821ac01046d5278.dif

[clang] [RISCV] Implement validateGlobalRegisterVariable. (PR #109596)

2024-09-22 Thread Pengcheng Wang via cfe-commits
@@ -486,3 +486,15 @@ bool RISCVTargetInfo::validateCpuSupports(StringRef Feature) const { bool RISCVTargetInfo::isValidFeatureName(StringRef Name) const { return llvm::RISCVISAInfo::isSupportedExtensionFeature(Name); } + +bool RISCVTargetInfo::validateGlobalRegisterVariable(

[clang] [clang] [Driver] Ensure we error on lto with link.exe and target `*-windows-msvc` on non cl driver modes (PR #109607)

2024-09-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Max Winkler (MaxEW707) Changes Similar to previous PRs I've done to change some `IsCLMode` checks to `isWindowsMSVCEnvironment`. I stumbled into this one accidentally last week. I did some greps and I think this is the last one for now. A

[clang] [clang] [Driver] Ensure we error on lto with link.exe and target `*-windows-msvc` on non cl driver modes (PR #109607)

2024-09-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: Max Winkler (MaxEW707) Changes Similar to previous PRs I've done to change some `IsCLMode` checks to `isWindowsMSVCEnvironment`. I stumbled into this one accidentally last week. I did some greps and I think this is the last one for

[clang] [clang] [Driver] Ensure we error on lto with link.exe and target `*-windows-msvc` on non cl driver modes (PR #109607)

2024-09-22 Thread Max Winkler via cfe-commits
https://github.com/MaxEW707 created https://github.com/llvm/llvm-project/pull/109607 Similar to previous PRs I've done to change some `IsCLMode` checks to `isWindowsMSVCEnvironment`. I stumbled into this one accidentally last week. I did some greps and I think this is the last one for now. All

[clang] [Clang] Include LLVM CodeGen CMake file (PR #109601)

2024-09-22 Thread Tristan Ross via cfe-commits
https://github.com/RossComputerGuy updated https://github.com/llvm/llvm-project/pull/109601 >From cab2a5cebdc63425ed03a31028e6eb2aee00e5d9 Mon Sep 17 00:00:00 2001 From: Tristan Ross Date: Sun, 22 Sep 2024 21:02:12 -0700 Subject: [PATCH] [Clang] Include LLVM CodeGen CMake file --- clang/lib/C

[clang] [Rewrite] Avoid repeated hash lookups (NFC) (PR #109605)

2024-09-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Kazu Hirata (kazutakahirata) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/109605.diff 1 Files Affected: - (modified) clang/lib/Frontend/Rewrite/RewriteObjC.cpp (+4-4) ``diff diff --git a/clang/lib/Fronten

[clang] [Rewrite] Avoid repeated hash lookups (NFC) (PR #109605)

2024-09-22 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/109605 None >From 50ce6d0114f8abd4b5580d2c277525eebdf25874 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sun, 22 Sep 2024 08:05:27 -0700 Subject: [PATCH] [Rewrite] Avoid repeated hash lookups (NFC) --- cla

[clang] [Clang][RISCV] Add preprocessor macros for Zicfilp CFI scheme (PR #109600)

2024-09-22 Thread Kito Cheng via cfe-commits
@@ -1781,3 +1781,35 @@ // RUN: %clang --target=riscv64-unknown-linux-gnu -mcpu=sifive-p450 -E -dM %s \ // RUN: -o - | FileCheck %s --check-prefix=CHECK-MISALIGNED-FAST // CHECK-MISALIGNED-FAST: __riscv_misaligned_fast 1 + +// Landing Pad + +// RUN: %clang --target=riscv32 -men

[clang] [AST] Avoid repeated hash lookups (NFC) (PR #109603)

2024-09-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Kazu Hirata (kazutakahirata) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/109603.diff 1 Files Affected: - (modified) clang/lib/AST/ASTContext.cpp (+1-2) ``diff diff --git a/clang/lib/AST/ASTContext.cpp b/

[clang] [Clang][RISCV] Add preprocessor macros for Zicfilp CFI scheme (PR #109600)

2024-09-22 Thread Kito Cheng via cfe-commits
@@ -3952,6 +3981,16 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args, } } + if (const Arg *const A = Args.getLastArg(OPT_fcf_branch_label_scheme_EQ)) { kito-cheng wrote: ```suggestion if (const Arg *A = Args.getLastArg(OPT_

[clang] [Clang][RISCV] Add preprocessor macros for Zicfilp CFI scheme (PR #109600)

2024-09-22 Thread Kito Cheng via cfe-commits
@@ -2022,6 +2035,22 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << Name; } + if (const Arg *const A = Args.getLastArg(OPT_fcf_branch_label_scheme_EQ)) { -

[clang] [AST] Avoid repeated hash lookups (NFC) (PR #109603)

2024-09-22 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/109603 None >From 6d29a8a0d011a13a9ac17fa4bf53523cfc70992d Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sun, 22 Sep 2024 07:54:30 -0700 Subject: [PATCH] [AST] Avoid repeated hash lookups (NFC) --- clang/l

[clang] [Clang] Include LLVM CodeGen CMake file (PR #109601)

2024-09-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Tristan Ross (RossComputerGuy) Changes Fixes a build failure with Clang being built from standalone sources (environments like Nix). Exact error: ``` CMake Error at /nix/store/h9yw8mg03z3dz6rgcjr7gbzkjysqc2sj-llvm-20.0.0-unstable-2024-09

[clang] [Clang] Include LLVM CodeGen CMake file (PR #109601)

2024-09-22 Thread Tristan Ross via cfe-commits
https://github.com/RossComputerGuy created https://github.com/llvm/llvm-project/pull/109601 Fixes a build failure with Clang being built from standalone sources (environments like Nix). Exact error: ``` CMake Error at /nix/store/h9yw8mg03z3dz6rgcjr7gbzkjysqc2sj-llvm-20.0.0-unstable-2024-09-22

[clang] [flang] [Driver][X86] Add flang visibility for -m[no-]evex512 (PR #109598)

2024-09-22 Thread Shengchen Kan via cfe-commits
https://github.com/KanRobert commented: LGTM https://github.com/llvm/llvm-project/pull/109598 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][RISCV] Add preprocessor macros for Zicfilp CFI scheme (PR #109600)

2024-09-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-risc-v Author: Ming-Yi Lai (mylai-mtk) Changes This patch adds preprocessor macros when Zicfilp CFI is enabled. The macros are proposed in riscv-non-isa/riscv-c-api-doc#76 , and the CLI flags are from riscv-non-isa/riscv-toolchain-conventions#5

[clang] [Clang][RISCV] Add preprocessor macros for Zicfilp CFI scheme (PR #109600)

2024-09-22 Thread Ming-Yi Lai via cfe-commits
https://github.com/mylai-mtk created https://github.com/llvm/llvm-project/pull/109600 This patch adds preprocessor macros when Zicfilp CFI is enabled. The macros are proposed in riscv-non-isa/riscv-c-api-doc#76 , and the CLI flags are from riscv-non-isa/riscv-toolchain-conventions#54. >From

[clang] [lldb] [llvm] [mlir] [APInt] Fix APInt constructions where value does not fit bitwidth (NFCI) (PR #80309)

2024-09-22 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: https://github.com/llvm/llvm-project/blob/62f737f7409b5d2b33c746158c62f14e5bb78aed/llvm/lib/Transforms/Utils/SimplifyCFG.cpp#L6516 We should allow truncations here. ``` ; bin/opt -passes='simplifycfg' reduced.ll -S target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:6

[clang] [llvm] [KCFI][NFC] Rename the !kcfi_type Function metadata to !cfi_type (PR #109080)

2024-09-22 Thread Ming-Yi Lai via cfe-commits
mylai-mtk wrote: Excuse me, @MaskRay . I don't understand your stance: > I understand the intention to generalize naming, but I feel that there is > significance chance that the over-generalization may not work with the > alternative CFI schemes, and this change could turn out to be needed w

[clang] [flang] [Driver][X86] Add flang visibility for -m[no-]evex512 (PR #109598)

2024-09-22 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang closed https://github.com/llvm/llvm-project/pull/109598 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 62f737f - [Driver][X86] Add flang visibility for -m[no-]evex512 (#109598)

2024-09-22 Thread via cfe-commits
Author: Phoebe Wang Date: 2024-09-23T11:21:48+08:00 New Revision: 62f737f7409b5d2b33c746158c62f14e5bb78aed URL: https://github.com/llvm/llvm-project/commit/62f737f7409b5d2b33c746158c62f14e5bb78aed DIFF: https://github.com/llvm/llvm-project/commit/62f737f7409b5d2b33c746158c62f14e5bb78aed.diff L

[clang] [clang][codegen] Don't mark "int" TBAA on FP libcalls with indirect args (PR #108853)

2024-09-22 Thread via cfe-commits
https://github.com/vfdff edited https://github.com/llvm/llvm-project/pull/108853 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [Driver][X86] Add flang visibility for -m[no-]evex512 (PR #109598)

2024-09-22 Thread Freddy Ye via cfe-commits
https://github.com/FreddyLeaf approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/109598 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][codegen] Don't mark "int" TBAA on FP libcalls with indirect args (PR #108853)

2024-09-22 Thread via cfe-commits
https://github.com/vfdff approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/108853 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [Driver][X86] Add flang visibility for -m[no-]evex512 (PR #109598)

2024-09-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Phoebe Wang (phoebewang) Changes The `-m[no-]evex512` are nontrivial options which are used to control vector size of other AVX512 features. Hence we expose both to flang for Fortran users. --- Full diff: https://github.com/llvm/llvm-proj

[clang] [flang] [Driver][X86] Add flang visibility for -m[no-]evex512 (PR #109598)

2024-09-22 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang created https://github.com/llvm/llvm-project/pull/109598 The `-m[no-]evex512` are nontrivial options which are used to control vector size of other AVX512 features. Hence we expose both to flang for Fortran users. >From d9aa2912206bb435bc830a42bc5ddd8b604c7d98 Mon

[clang] [RISCV] Implement validateGlobalRegisterVariable. (PR #109596)

2024-09-22 Thread Yingwei Zheng via cfe-commits
@@ -486,3 +486,15 @@ bool RISCVTargetInfo::validateCpuSupports(StringRef Feature) const { bool RISCVTargetInfo::isValidFeatureName(StringRef Name) const { return llvm::RISCVISAInfo::isSupportedExtensionFeature(Name); } + +bool RISCVTargetInfo::validateGlobalRegisterVariable(

[clang] [RISCV] Implement validateGlobalRegisterVariable. (PR #109596)

2024-09-22 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/109596 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RISCV] Implement validateGlobalRegisterVariable. (PR #109596)

2024-09-22 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw edited https://github.com/llvm/llvm-project/pull/109596 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [clang][CodeGen] Use byval for SystemZ indirect arguments (PR #66404)

2024-09-22 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic closed https://github.com/llvm/llvm-project/pull/66404 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 6521945 - [RISCV][test] Fix incorrect check prefix in riscv32-toolchain.c and riscv64-toolchain.c. (#109390)

2024-09-22 Thread via cfe-commits
Author: Jim Lin Date: 2024-09-23T09:16:43+08:00 New Revision: 652194531c45682715503355676e39b5b57c9394 URL: https://github.com/llvm/llvm-project/commit/652194531c45682715503355676e39b5b57c9394 DIFF: https://github.com/llvm/llvm-project/commit/652194531c45682715503355676e39b5b57c9394.diff LOG:

[clang] [RISCV][test] Fix incorrect check prefix in riscv32-toolchain.c and riscv64-toolchain.c. (PR #109390)

2024-09-22 Thread Jim Lin via cfe-commits
https://github.com/tclin914 closed https://github.com/llvm/llvm-project/pull/109390 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RISCV][test] Fix incorrect check prefix in riscv32-toolchain.c and riscv64-toolchain.c. (PR #109390)

2024-09-22 Thread Jim Lin via cfe-commits
https://github.com/tclin914 edited https://github.com/llvm/llvm-project/pull/109390 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-09-22 Thread Owen Pan via cfe-commits
@@ -616,6 +626,62 @@ class LineJoiner { return 1; } + unsigned tryMergeNamespace(SmallVectorImpl::const_iterator I, + SmallVectorImpl::const_iterator E, + unsigned Limit) { +if (Limit == 0) + return 0; +

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-09-22 Thread Owen Pan via cfe-commits
@@ -27981,6 +27981,132 @@ TEST_F(FormatTest, BreakBinaryOperations) { Style); } +TEST_F(FormatTest, ShortNamespacesOption) { + auto BaseStyle = getLLVMStyle(); + BaseStyle.AllowShortNamespacesOnASingleLine = true; + BaseStyle.FixNamespaceComments = false; + +

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-09-22 Thread Owen Pan via cfe-commits
@@ -616,6 +626,62 @@ class LineJoiner { return 1; } + unsigned tryMergeNamespace(SmallVectorImpl::const_iterator I, + SmallVectorImpl::const_iterator E, + unsigned Limit) { +if (Limit == 0) + return 0; +

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-09-22 Thread Owen Pan via cfe-commits
@@ -616,6 +626,62 @@ class LineJoiner { return 1; } + unsigned tryMergeNamespace(SmallVectorImpl::const_iterator I, + SmallVectorImpl::const_iterator E, + unsigned Limit) { +if (Limit == 0) + return 0; +

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-09-22 Thread Owen Pan via cfe-commits
@@ -616,6 +626,62 @@ class LineJoiner { return 1; } + unsigned tryMergeNamespace(SmallVectorImpl::const_iterator I, + SmallVectorImpl::const_iterator E, + unsigned Limit) { +if (Limit == 0) + return 0; +

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-09-22 Thread Owen Pan via cfe-commits
@@ -616,6 +626,62 @@ class LineJoiner { return 1; } + unsigned tryMergeNamespace(SmallVectorImpl::const_iterator I, + SmallVectorImpl::const_iterator E, + unsigned Limit) { +if (Limit == 0) + return 0; +

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-09-22 Thread Owen Pan via cfe-commits
@@ -616,6 +626,62 @@ class LineJoiner { return 1; } + unsigned tryMergeNamespace(SmallVectorImpl::const_iterator I, + SmallVectorImpl::const_iterator E, + unsigned Limit) { +if (Limit == 0) o

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-09-22 Thread Owen Pan via cfe-commits
@@ -361,9 +361,18 @@ class LineJoiner { const auto *FirstNonComment = TheLine->getFirstNonComment(); if (!FirstNonComment) return 0; + // FIXME: There are probably cases where we should use FirstNonComment // instead of TheLine->First. +if (TheLine

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-09-22 Thread Owen Pan via cfe-commits
@@ -616,6 +626,62 @@ class LineJoiner { return 1; } + unsigned tryMergeNamespace(SmallVectorImpl::const_iterator I, + SmallVectorImpl::const_iterator E, + unsigned Limit) { +if (Limit == 0) + return 0; +

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-09-22 Thread Owen Pan via cfe-commits
@@ -27981,6 +27981,132 @@ TEST_F(FormatTest, BreakBinaryOperations) { Style); } +TEST_F(FormatTest, ShortNamespacesOption) { + auto BaseStyle = getLLVMStyle(); + BaseStyle.AllowShortNamespacesOnASingleLine = true; + BaseStyle.FixNamespaceComments = false; + +

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-09-22 Thread Owen Pan via cfe-commits
@@ -27981,6 +27981,132 @@ TEST_F(FormatTest, BreakBinaryOperations) { Style); } +TEST_F(FormatTest, ShortNamespacesOption) { + auto BaseStyle = getLLVMStyle(); + BaseStyle.AllowShortNamespacesOnASingleLine = true; + BaseStyle.FixNamespaceComments = false; + +

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-09-22 Thread Owen Pan via cfe-commits
@@ -972,6 +972,11 @@ struct FormatStyle { /// \version 3.7 bool AllowShortLoopsOnASingleLine; + /// If ``true``, ``namespace a { class b; }`` can be put on a single a single + /// line. owenca wrote: ```suggestion /// If ``true``, ``namespace a { clas

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-22 Thread Keith Packard via cfe-commits
https://github.com/keith-packard updated https://github.com/llvm/llvm-project/pull/108942 >From 60ad4f7793701bc50d1c65db4fe665558678fd7b Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 16 Sep 2024 15:41:38 +0200 Subject: [PATCH 1/3] riscv: Support -mstack-protector-guard=tls Add suppor

[clang] [RISCV] Implement validateGlobalRegisterVariable. (PR #109596)

2024-09-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-risc-v Author: Craig Topper (topperc) Changes Only allow GPR registers and verify the size is the same as XLen. This fixes the crash seen in #109588 by making it a frontend error. gcc does accept the code so we may need to consider if we can fi

[clang] [RISCV] Implement validateGlobalRegisterVariable. (PR #109596)

2024-09-22 Thread Craig Topper via cfe-commits
https://github.com/topperc edited https://github.com/llvm/llvm-project/pull/109596 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RISCV] Implement validateGlobalRegisterVariable. (PR #109596)

2024-09-22 Thread Craig Topper via cfe-commits
https://github.com/topperc created https://github.com/llvm/llvm-project/pull/109596 Only allow GPR registers and verify the size is the same as XLen. This fixes the crash seen in #109588 by making it a frontend error. gcc does accept the code so we need to consider if we can fix the backend. S

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-22 Thread Keith Packard via cfe-commits
@@ -3644,13 +3645,28 @@ static void RenderSSPOptions(const Driver &D, const ToolChain &TC, << A->getOption().getName() << Value << "sysreg global"; return; } +if (EffectiveTriple.isRISCV()) { + if (Value != "tls" && Value != "global") { ---

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-22 Thread Keith Packard via cfe-commits
@@ -3681,6 +3698,11 @@ static void RenderSSPOptions(const Driver &D, const ToolChain &TC, D.Diag(diag::err_drv_invalid_value) << A->getOption().getName() << Value; return; } +if (EffectiveTriple.isRISCV() && Value != "tp") { + D.Diag(diag::err_drv_inva

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-22 Thread Keith Packard via cfe-commits
https://github.com/keith-packard updated https://github.com/llvm/llvm-project/pull/108942 >From a295c6d8057ddd712097e3bf659cdbe3bb4ec869 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 16 Sep 2024 15:41:38 +0200 Subject: [PATCH 1/3] riscv: Support -mstack-protector-guard=tls Add suppor

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-22 Thread Keith Packard via cfe-commits
@@ -0,0 +1,19 @@ +; RUN: llc -mtriple=riscv64-unknown-elf < %s | \ keith-packard wrote: Thanks. I wondered how that was supposed to work. https://github.com/llvm/llvm-project/pull/108942 ___ cfe-commits mailing list cf

[clang-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-09-22 Thread via cfe-commits
@@ -0,0 +1,92 @@ +//===--- IncorrectEnableSharedFromThisCheck.cpp - clang-tidy --===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] Add support for aligning BlockComments in declarations (PR #109497)

2024-09-22 Thread via cfe-commits
https://github.com/mydeveloperday requested changes to this pull request. You have not regenerated the rst https://github.com/llvm/llvm-project/pull/109497 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/

[clang] clang-format: Add AlignFunctionDeclarations attribute to AlignConsecutiveDeclarations (PR #108241)

2024-09-22 Thread Brad House via cfe-commits
@@ -225,6 +225,21 @@ struct FormatStyle { /// bbb = 2; /// \endcode bool AlignCompound; +/// Only for ``AlignConsecutiveDeclarations``. Whether function declarations +/// are aligned. +/// \code +/// true: +/// unsigned int f1(void); +

[clang] clang-format: Add AlignFunctionDeclarations attribute to AlignConsecutiveDeclarations (PR #108241)

2024-09-22 Thread Brad House via cfe-commits
https://github.com/bradh352 updated https://github.com/llvm/llvm-project/pull/108241 >From 00cbf31807ca8d8e1c0c86c6a691c47835522fe9 Mon Sep 17 00:00:00 2001 From: Brad House Date: Wed, 11 Sep 2024 10:27:50 -0400 Subject: [PATCH 1/2] Add AlignFunctionDeclarations attribute to AlignConsecutiveDe

[clang] clang-format: Add AlignFunctionDeclarations attribute to AlignConsecutiveDeclarations (PR #108241)

2024-09-22 Thread Brad House via cfe-commits
@@ -409,6 +409,21 @@ the configuration (without a prefix: ``Auto``). int *p; int (*f)(); + * ``bool AlignFunctionDeclarations`` Only for ``AlignConsecutiveDeclarations``. Whether function declarations bradh352 wrote: ah, gotcha https://gith

[clang] clang-format: Add AlignFunctionDeclarations attribute to AlignConsecutiveDeclarations (PR #108241)

2024-09-22 Thread Brad House via cfe-commits
@@ -225,6 +225,21 @@ struct FormatStyle { /// bbb = 2; /// \endcode bool AlignCompound; +/// Only for ``AlignConsecutiveDeclarations``. Whether function declarations +/// are aligned. +/// \code +/// true: +/// unsigned int f1(void); +

[clang] clang-format: Add AlignFunctionDeclarations attribute to AlignConsecutiveDeclarations (PR #108241)

2024-09-22 Thread Owen Pan via cfe-commits
@@ -409,6 +409,21 @@ the configuration (without a prefix: ``Auto``). int *p; int (*f)(); + * ``bool AlignFunctionDeclarations`` Only for ``AlignConsecutiveDeclarations``. Whether function declarations owenca wrote: Version badge is unsupport

[clang] clang-format: Add AlignFunctionDeclarations attribute to AlignConsecutiveDeclarations (PR #108241)

2024-09-22 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/108241 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] clang-format: Add AlignFunctionDeclarations attribute to AlignConsecutiveDeclarations (PR #108241)

2024-09-22 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/108241 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] clang-format: Add AlignFunctionDeclarations attribute to AlignConsecutiveDeclarations (PR #108241)

2024-09-22 Thread Owen Pan via cfe-commits
@@ -225,6 +225,21 @@ struct FormatStyle { /// bbb = 2; /// \endcode bool AlignCompound; +/// Only for ``AlignConsecutiveDeclarations``. Whether function declarations +/// are aligned. +/// \code +/// true: +/// unsigned int f1(void); +

[clang] df935ff - [clang-format] Fix regression with BlockIndent of Braced Initializers (#108717)

2024-09-22 Thread via cfe-commits
Author: Gedare Bloom Date: 2024-09-22T14:31:19-07:00 New Revision: df935ff4eca91013553edbf3ca1d45b568f6709f URL: https://github.com/llvm/llvm-project/commit/df935ff4eca91013553edbf3ca1d45b568f6709f DIFF: https://github.com/llvm/llvm-project/commit/df935ff4eca91013553edbf3ca1d45b568f6709f.diff

[clang] [clang-format] Fix regression with BlockIndent of Braced Initializers (PR #108717)

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

[clang] [clang-format] Fix regression with BlockIndent of Braced Initializers (PR #108717)

2024-09-22 Thread Owen Pan via cfe-commits
https://github.com/owenca approved this pull request. https://github.com/llvm/llvm-project/pull/108717 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] clang-format: Add AlignFunctionDeclarations attribute to AlignConsecutiveDeclarations (PR #108241)

2024-09-22 Thread Brad House via cfe-commits
@@ -225,6 +225,21 @@ struct FormatStyle { /// bbb = 2; /// \endcode bool AlignCompound; +/// Only for ``AlignConsecutiveDeclarations``. Whether function declarations +/// are aligned. +/// \code +/// true: +/// unsigned int f1(void); +

[clang] [clang][bytecode] Check allocation size limit for operator new (PR #109590)

2024-09-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Timm Baeder (tbaederr) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/109590.diff 3 Files Affected: - (modified) clang/lib/AST/ByteCode/InterpBuiltin.cpp (+10-1) - (modified) clang/lib/AST/ByteCode/InterpFrame.cpp (+

[clang] [clang][bytecode] Check allocation size limit for operator new (PR #109590)

2024-09-22 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/109590 None >From 6b37086bbaa01e9daa069771a3e54c6b80bd7e5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sun, 22 Sep 2024 22:33:05 +0200 Subject: [PATCH] [clang][bytecode] Check allocation size l

[clang] [clang-format] Fix regression with BlockIndent of Braced Initializers (PR #108717)

2024-09-22 Thread Gedare Bloom via cfe-commits
https://github.com/gedare updated https://github.com/llvm/llvm-project/pull/108717 >From a95b990e48df19b8b674fe9df6bea803415129bf Mon Sep 17 00:00:00 2001 From: Gedare Bloom Date: Sat, 14 Sep 2024 13:13:26 -0600 Subject: [PATCH 1/3] [clang-format] Fix regression with BlockIndent of Braced Init

[clang] [clang-format] Fix regression with BlockIndent of Braced Initializers (PR #108717)

2024-09-22 Thread Gedare Bloom via cfe-commits
https://github.com/gedare updated https://github.com/llvm/llvm-project/pull/108717 >From a95b990e48df19b8b674fe9df6bea803415129bf Mon Sep 17 00:00:00 2001 From: Gedare Bloom Date: Sat, 14 Sep 2024 13:13:26 -0600 Subject: [PATCH 1/2] [clang-format] Fix regression with BlockIndent of Braced Init

[clang] clang-format: Add AlignFunctionDeclarations attribute to AlignConsecutiveDeclarations (PR #108241)

2024-09-22 Thread Owen Pan via cfe-commits
owenca wrote: > In regards to the "Test documentation build / Test documentation build > (pull_request) " failure, I'm honestly not sure how to fix the formatting in > this. I'm not seeing anything wrong with my addition in Format.h, but maybe > there's something I'm missing. I never touch Cla

[clang] clang-format: Add AlignFunctionDeclarations attribute to AlignConsecutiveDeclarations (PR #108241)

2024-09-22 Thread Owen Pan via cfe-commits
@@ -225,6 +225,21 @@ struct FormatStyle { /// bbb = 2; /// \endcode bool AlignCompound; +/// Only for ``AlignConsecutiveDeclarations``. Whether function declarations +/// are aligned. +/// \code +/// true: +/// unsigned int f1(void); +

[clang] 090dc77 - [-Wunsafe-buffer-usage] Fix a bug and suppress libc warnings for C files (#109496)

2024-09-22 Thread via cfe-commits
Author: Ziqing Luo Date: 2024-09-22T12:29:06-07:00 New Revision: 090dc77a8d636415b772f7e5f95cd120370e41d1 URL: https://github.com/llvm/llvm-project/commit/090dc77a8d636415b772f7e5f95cd120370e41d1 DIFF: https://github.com/llvm/llvm-project/commit/090dc77a8d636415b772f7e5f95cd120370e41d1.diff LO

[clang] [-Wunsafe-buffer-usage] Fix a bug and suppress libc warnings for C files (PR #109496)

2024-09-22 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 closed https://github.com/llvm/llvm-project/pull/109496 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] adding clang codegen (PR #109331)

2024-09-22 Thread via cfe-commits
https://github.com/joaosaffran updated https://github.com/llvm/llvm-project/pull/109331 >From 13a095ca2671cd69b120d9c394831b9ba8e20a50 Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Thu, 19 Sep 2024 00:13:51 + Subject: [PATCH] Codegen builtin --- clang/include/clang/Basic/Builtins.td

[clang] [flang] [llvm] [mlir] Make MMIWP not have ownership over MMI + Make MMI Only Use an External MCContext (PR #105541)

2024-09-22 Thread Matin Raayai via cfe-commits
matinraayai wrote: > > @aeubanks @arsenm after looking into this in more detail, I realized that > > the `getContext` method of `MMI` is heavily used in the `AsmPrinter` to > > create symbols. Also not having it makes it harder for the `MMI` to create > > machine functions using `getOrCreateMa

[clang] [flang] [llvm] [mlir] Make MMIWP not have ownership over MMI + Make MMI Only Use an External MCContext (PR #105541)

2024-09-22 Thread Matt Arsenault via cfe-commits
arsenm wrote: > @aeubanks @arsenm after looking into this in more detail, I realized that the > `getContext` method of `MMI` is heavily used in the `AsmPrinter` to create > symbols. Also not having it makes it harder for the `MMI` to create machine > functions using `getOrCreateMachineFunction

[clang] [Frontend] Teach LoadFromASTFile to take FileName by StringRef (NFC) (PR #109583)

2024-09-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Kazu Hirata (kazutakahirata) Changes Without this patch, several callers of LoadFromASTFile construct an instance of std::string to be passed as FileName, only to be converted back to StringRef when LoadFromASTFile calls ReadAST. This patc

[clang] [Frontend] Teach LoadFromASTFile to take FileName by StringRef (NFC) (PR #109583)

2024-09-22 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/109583 Without this patch, several callers of LoadFromASTFile construct an instance of std::string to be passed as FileName, only to be converted back to StringRef when LoadFromASTFile calls ReadAST. This patch

[clang-tools-extra] Add clang-tidy external examples (PR #106675)

2024-09-22 Thread via cfe-commits
MichelleCDjunaidi wrote: @5chmidti @SimplyDanny can anyone help merge this into main? https://github.com/llvm/llvm-project/pull/106675 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

  1   2   >