[clang] [Clang] Correctly initialize placeholder fields from their initializers (PR #114196)

2024-10-30 Thread via cfe-commits
https://github.com/cor3ntin created https://github.com/llvm/llvm-project/pull/114196 We made the incorrect assumption that names of fields are unique when creating their default initializers. We fix that by keeping track of the instantiaation pattern for field decls that are placeholder vars,

[clang-tools-extra] [clang-tidy] Create a check for signed and unsigned integers comparison (PR #113144)

2024-10-30 Thread via cfe-commits
@@ -0,0 +1,68 @@ +.. title:: clang-tidy - qt-integer-sign-comparison + +qt-integer-sign-comparison += + +The qt-integer-sign-comparison check is an alias, please see +:doc:`modernize-use-integer-sign-comparison <../modernize/use-integer-sign-comparison

[clang] [NFC} Call base class method in DarwinAArch64TargetInfo::getOSDefines (PR #114241)

2024-10-30 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak created https://github.com/llvm/llvm-project/pull/114241 None >From 606344e958371d8978b2b64d870db5bfc0bd7b28 Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Wed, 30 Oct 2024 07:36:31 -0700 Subject: [PATCH] [NFC} Call base class method in DarwinAArch64TargetInfo

[clang] [clang-tools-extra] [llvm] [clang] Introduce diagnostics suppression mappings (PR #112517)

2024-10-30 Thread Boaz Brickner via cfe-commits
@@ -477,6 +486,109 @@ void DiagnosticsEngine::setSeverityForAll(diag::Flavor Flavor, setSeverity(Diag, Map, Loc); } +namespace { +class WarningsSpecialCaseList : public llvm::SpecialCaseList { +public: + static std::unique_ptr + create(const llvm::MemoryBuffer &MB, st

[clang] [Clang][SYCL] Introduce clang-sycl-linker to link SYCL offloading device code (Part 1 of many) (PR #112245)

2024-10-30 Thread Chris B via cfe-commits
https://github.com/llvm-beanz dismissed https://github.com/llvm/llvm-project/pull/112245 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC] Call base class method in DarwinAArch64TargetInfo::getOSDefines (PR #114241)

2024-10-30 Thread Akira Hatanaka via cfe-commits
ahatanak wrote: This is needed for a private patch we'll be upstreaming in the future. Even without that, I think it's an improvement over what we are doing now. https://github.com/llvm/llvm-project/pull/114241 ___ cfe-commits mailing list cfe-commits

[clang-tools-extra] [clang-tidy] Create a check for signed and unsigned integers comparison (PR #113144)

2024-10-30 Thread via cfe-commits
https://github.com/qt-tatiana updated https://github.com/llvm/llvm-project/pull/113144 >From 34ee6f5836efe3acddbdd1c9810af358b8c4f981 Mon Sep 17 00:00:00 2001 From: Tatiana Borisova Date: Thu, 17 Oct 2024 18:00:08 +0200 Subject: [PATCH 1/7] [clang-tidy] Create a check for signed and unsigned i

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -0,0 +1,42 @@ +//===--- SYCLKernelInfo.h --- Information about SYCL kernels --===// +// +// 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] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Erich Keane via cfe-commits
@@ -455,6 +455,174 @@ The SYCL kernel in the previous code sample meets these expectations. }]; } +def SYCLKernelEntryPointDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The ``sycl_kernel_entry_point`` attribute facilitates the generation of a

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Erich Keane via cfe-commits
@@ -14296,6 +14296,29 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap, } } +static SYCLKernelInfo BuildSYCLKernelInfo(CanQualType KernelNameType, erichkeane wrote: Got it, thanks! https://github.com/llvm/llvm-project/pull/111389

[clang] [clang] Clean up enumerators when merging named enums (PR #114240)

2024-10-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Michael Jabbour (michael-jabbour-sonarsource) Changes Clang already has a mechanism to cleanup enumerators for typedefs to anonymous enums. So the following example code used to be handled correctly while merging, and ASTWriter behaves as

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -12053,6 +12053,10 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD, if (LangOpts.OpenMP) OpenMP().ActOnFinishedFunctionDefinitionInOpenMPAssumeScope(NewFD); + if (LangOpts.isSYCL() && NewFD->hasAttr() && + !NewFD->isInvalidDecl() && !NewFD-

[clang] [NFC] [clang] Use std::string instead of StringRef to reduce stack usage (PR #114285)

2024-10-30 Thread Chinmay Deshpande via cfe-commits
https://github.com/chinmaydd closed https://github.com/llvm/llvm-project/pull/114285 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Always use latest redeclaration of primary template (PR #114258)

2024-10-30 Thread Felipe de Azevedo Piovezan via cfe-commits
felipepiovezan wrote: I reverted locally and confirmed that it was this commit that introduced the regression. I don't know much about clang importer to be honest, but this can be reproed by adding `lldb` to the list of projects to build, then building the `check-lldb` target. You can stop th

[clang] [Clang] prevent setting default lexical access specifier for missing primary declarations (PR #112424)

2024-10-30 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. Assuming it passes the test LGTM https://github.com/llvm/llvm-project/pull/112424 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix crash in __builtin_assume_aligned (PR #114217)

2024-10-30 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/114217 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix crash in __builtin_assume_aligned (PR #114217)

2024-10-30 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Thank you for the fix, I think this makes sense. Please add the tests I commented on and a release note. https://github.com/llvm/llvm-project/pull/114217 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http

[clang] [Clang] Fix crash in __builtin_assume_aligned (PR #114217)

2024-10-30 Thread Shafik Yaghmour via cfe-commits
@@ -74,7 +74,7 @@ int test13(int *a) { } int test14(int *a, int b) { - a = (int *)__builtin_assume_aligned(b, 32); // expected-error {{incompatible integer to pointer conversion passing 'int' to parameter of type 'const void *}} + a = (int *)__builtin_assume_aligned(b, 32);

[clang] [ObjC] Insert method parameters in scope as they are parsed (PR #113745)

2024-10-30 Thread via cfe-commits
@@ -4768,60 +4822,9 @@ Decl *SemaObjC::ActOnMethodDeclaration( HasRelatedResultType); SmallVector Params; - - for (unsigned i = 0, e = Sel.getNumArgs(); i != e; ++i) { -QualType ArgType; -TypeSourceInfo *DI; - -if (!ArgInfo[i].Type) { - ArgType = Cont

[clang] [llvm] [InstrPGO] Support cold function coverage instrumentation (PR #109837)

2024-10-30 Thread Lei Wang via cfe-commits
@@ -1182,8 +1187,13 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level, const bool IsCtxProfUse = !UseCtxProfile.empty() && Phase == ThinOrFullLTOPhase::ThinLTOPreLink; + // Enable cold function coverage instrumentation if + // InstrumentColdF

[clang] [LinkerWrapper] Remove handling of special bitcode flags (PR #114298)

2024-10-30 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/114298 Summary: These flags were used in the very early days while we were trying to port stuff. Now that we just pass bitcode to the device link job it can be easily replaced by `-Xoffload-linker foo.bc`. >From 1a38b

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Erich Keane via cfe-commits
@@ -12053,6 +12053,10 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD, if (LangOpts.OpenMP) OpenMP().ActOnFinishedFunctionDefinitionInOpenMPAssumeScope(NewFD); + if (LangOpts.isSYCL() && NewFD->hasAttr() && + !NewFD->isInvalidDecl() && !NewFD-

[clang] [MS] Add /Zc:tlsGuards option to control tls guard emission (PR #113830)

2024-10-30 Thread Eli Friedman via cfe-commits
@@ -4063,6 +4063,11 @@ defm threadsafe_statics : BoolFOption<"threadsafe-statics", NegFlag, PosFlag>; +defm tls_guards : BoolFOption<"tls-guards", + LangOpts<"TlsGuards">, DefaultTrue, efriedma-quic wrote: If we're going to expose this as a clang option (

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -12053,6 +12053,10 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD, if (LangOpts.OpenMP) OpenMP().ActOnFinishedFunctionDefinitionInOpenMPAssumeScope(NewFD); + if (LangOpts.isSYCL() && NewFD->hasAttr() && + !NewFD->isInvalidDecl() && !NewFD-

[clang] [clang][ASTMatcher] Handle variable templates in `isInstantiated` and `isInTemplateInstantiation` matchers (PR #110666)

2024-10-30 Thread Fred Tingaud via cfe-commits
frederic-tingaud-sonarsource wrote: Pinging some recent contributors/reviewers to AST Matchers. @danix800, @AaronBallman, @shafik, @PiotrZSL, @steakhal, @cor3ntin https://github.com/llvm/llvm-project/pull/110666 ___ cfe-commits mailing list cfe-commit

[clang] [HLSL] add IsLineVectorLayoutCompatible type trait (PR #113730)

2024-10-30 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/113730 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] add IsLineVectorLayoutCompatible type trait (PR #113730)

2024-10-30 Thread Helena Kotas via cfe-commits
https://github.com/hekota requested changes to this pull request. If you are going to store `isHLSLLineVectorLayoutCompatibleType` on a declaration you need to modify addMember to analyze newly added members. Then move the IsLineVectorLayoutCompatibleType implementation from SemaHLSL to Type a

[clang] [llvm] [HLSL] implement elementwise firstbithigh hlsl builtin (PR #111082)

2024-10-30 Thread Sarah Spall via cfe-commits
https://github.com/spall edited https://github.com/llvm/llvm-project/pull/111082 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] implement elementwise firstbithigh hlsl builtin (PR #111082)

2024-10-30 Thread Sarah Spall via cfe-commits
@@ -449,6 +449,15 @@ Register SPIRVGlobalRegistry::getOrCreateCompositeOrNull( return Res; } +Register SPIRVGlobalRegistry::getOrCreateConstScalarOrVector( +uint64_t Val, MachineInstr &I, SPIRVType *SpvType, +const SPIRVInstrInfo &TII, bool ZeroAsNull) { + if (SpvTy

[clang] [Clang] prevent setting default lexical access specifier for missing primary declarations (PR #112424)

2024-10-30 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/112424 >From a22c6bae4f42f42e67f8e0c2b1f914e50d140099 Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Tue, 15 Oct 2024 22:43:24 +0300 Subject: [PATCH 1/3] [Clang] prevent setting default lexical access specifier f

[clang] [rtsan][NFC] Add 'known to have non-deterministic' caveat to documentation (PR #114281)

2024-10-30 Thread Chris Apple via cfe-commits
cjappl wrote: (doc build failure is unrelated, I will rebase after approval and make sure that passes): > Warning, treated as error: > /home/runner/work/llvm-project/llvm-project/clang-build/tools/clang/docs/index.rst:89:toctree > contains reference to nonexisting document 'ClangFormattedStatu

[clang] [Clang] prevent assertion failure from an invalid template instantiation pattern when adding instantiated params to the scope in friend functions with defaulted params (PR #113777)

2024-10-30 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/113777 >From 78019b9d9dc138f38bb5b32576b621351ae6427c Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Sun, 27 Oct 2024 01:07:57 +0300 Subject: [PATCH] [Clang] prevent assertion failure from an invalid template ins

[clang] [Clang] Add __ugly__ spelling for the msvc attribute scope (PR #113765)

2024-10-30 Thread Erich Keane via cfe-commits
erichkeane wrote: > > I'm personally sympathetic, and would be ok with something that we know > > MSVC won't step on (`__clang_msvc__` would be fine to me). As far as the > > `no_unique_address`, I THINK we already get the double-underscore spelling > > of that, don't we? I don't think we excl

[clang] [llvm] [HLSL] implement elementwise firstbithigh hlsl builtin (PR #111082)

2024-10-30 Thread Farzon Lotfi via cfe-commits
@@ -2717,82 +2717,82 @@ bool SPIRVInstructionSelector::selectFirstBitHigh64(Register ResVReg, Register FBHReg = MRI->createVirtualRegister(GR.getRegClass(postCastT)); Result &= selectFirstBitHigh32(FBHReg, postCastT, I, bitcastReg, IsSigned); - // 3. check if result of e

[clang] [clang][bytecode] Start implementing __builtin_bit_cast (PR #112126)

2024-10-30 Thread Aaron Ballman via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/112126 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[clang] [NFC] [clang] Use std::string instead of StringRef to reduce stack usage (PR #114285)

2024-10-30 Thread Matt Arsenault via cfe-commits
arsenm wrote: That sounds like MSVC's problem to solve. Why does the amount of stack size matter https://github.com/llvm/llvm-project/pull/114285 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/

[clang] [NFC] [clang] Use std::string instead of StringRef to reduce stack usage (PR #114285)

2024-10-30 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > That sounds like MSVC's problem to solve. Why does the amount of stack size > matter Yeah, I'd like to know what the benefit is -- `StringRef` seems like the correct type to use, not `std::string`, IMO. Is this showing up in a performance profile or something? https://g

[clang] [clang][ASTMatcher] Handle variable templates in `isInstantiated` and `isInTemplateInstantiation` matchers (PR #110666)

2024-10-30 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/110666 >From be911d8d0a00d5c6d42b23b40ca6d6abec51966c Mon Sep 17 00:00:00 2001 From: Fred Tingaud Date: Tue, 1 Oct 2024 16:10:55 +0200 Subject: [PATCH 1/2] Handle variable templates in isInstantiated and isInTemp

[clang] [Clang][Sema] Always use latest redeclaration of primary template (PR #114258)

2024-10-30 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @asmok-g You're in luck, because I was just about to merge this now :) https://github.com/llvm/llvm-project/pull/114258 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

[clang] bc79ec0 - [clang][ASTMatcher] Handle variable templates in `isInstantiated` and `isInTemplateInstantiation` matchers (#110666)

2024-10-30 Thread via cfe-commits
Author: Fred Tingaud Date: 2024-10-30T14:57:09-04:00 New Revision: bc79ec0c5bc3fce31448419846c343017ae1c5ad URL: https://github.com/llvm/llvm-project/commit/bc79ec0c5bc3fce31448419846c343017ae1c5ad DIFF: https://github.com/llvm/llvm-project/commit/bc79ec0c5bc3fce31448419846c343017ae1c5ad.diff

[clang] [clang][ASTMatcher] Handle variable templates in `isInstantiated` and `isInTemplateInstantiation` matchers (PR #110666)

2024-10-30 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman closed https://github.com/llvm/llvm-project/pull/110666 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Always use latest redeclaration of primary template (PR #114258)

2024-10-30 Thread via cfe-commits
asmok-g wrote: @sdkrystian thanks a lot : ) https://github.com/llvm/llvm-project/pull/114258 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Driver] Allow -fuse-lld=lld-link when lto is enabled on *windows-msvc targets (PR #113966)

2024-10-30 Thread Zhaoshi Zheng via cfe-commits
zhaoshiz wrote: > Windows should use `-fuse-ld=lld` as well, not `-fuse-ld=lld-link` I don't disagree... But `-fuse-ld=lld-link` is auto generated by CMake in our case. I can add `-fuse-ld=lld` to CMAKE_C_FLAGS. But I have no control over what or how our downstream users build with LLVM. http

[clang] [AST] Bump Type::NumOfBuiltinTypeBits. NFCI. (PR #113559)

2024-10-30 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > The community doesn't add new builtin types particularly often, so having > > four leftover bits isn't actually that close to the limit for us. > > I guess "close" is subjective. > > > Is there a problem with keeping this change downstream until we get to the > > limit

[clang] [HLSL][SPIRV] Add HLSL type translation for spirv. (PR #114273)

2024-10-30 Thread Steven Perron via cfe-commits
https://github.com/s-perron updated https://github.com/llvm/llvm-project/pull/114273 >From 689f8d6be270321ffc1930162b318c134c9bb7f4 Mon Sep 17 00:00:00 2001 From: Steven Perron Date: Tue, 1 Oct 2024 09:56:20 -0400 Subject: [PATCH] [HLSL][SPIRV] Add HLSL type translation for spirv. This commit

[clang] [NFC] [clang] Use std::string instead of StringRef to reduce stack usage (PR #114285)

2024-10-30 Thread Krzysztof Parzyszek via cfe-commits
kparzysz wrote: I was able to see the internal bug report. This shows up when some code on Windows runs clang (via a library call), and it ends up crashing due to stack overflow. The crash happens in this function, in "__chkstk" to be exact. https://github.com/llvm/llvm-project/pull/114285 _

[clang] [clang-tools-extra] [llvm] [clang] Introduce diagnostics suppression mappings (PR #112517)

2024-10-30 Thread Boaz Brickner via cfe-commits
@@ -4493,6 +4493,13 @@ static void RenderDiagnosticsOptions(const Driver &D, const ArgList &Args, Args.addOptOutFlag(CmdArgs, options::OPT_fspell_checking, options::OPT_fno_spell_checking); + + if (const Arg *A = + Args.getLastArg(options::OPT

[clang] [rtsan][NFC] Add 'known to have non-deterministic' caveat to documentation (PR #114281)

2024-10-30 Thread Chris Apple via cfe-commits
https://github.com/cjappl created https://github.com/llvm/llvm-project/pull/114281 As suggested by @fmayer in #113979 >From 8d3e3d29b317a35a06780f8ad2a90f437b6f3bcc Mon Sep 17 00:00:00 2001 From: Chris Apple Date: Wed, 30 Oct 2024 10:50:30 -0700 Subject: [PATCH] [rtsan][NFC] Add 'known to hav

[clang] [rtsan][NFC] Add 'known to have non-deterministic' caveat to documentation (PR #114281)

2024-10-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Chris Apple (cjappl) Changes As suggested by @fmayer in #113979 --- Full diff: https://github.com/llvm/llvm-project/pull/114281.diff 1 Files Affected: - (modified) clang/docs/RealtimeSanitizer.rst (+2-2) ``diff diff --git a/

[clang] [clang-tools-extra] [llvm] [clang] Introduce diagnostics suppression mappings (PR #112517)

2024-10-30 Thread Boaz Brickner via cfe-commits
@@ -477,6 +486,109 @@ void DiagnosticsEngine::setSeverityForAll(diag::Flavor Flavor, setSeverity(Diag, Map, Loc); } +namespace { +class WarningsSpecialCaseList : public llvm::SpecialCaseList { +public: + static std::unique_ptr + create(const llvm::MemoryBuffer &MB, st

[clang] 7d1e283 - [Clang][Sema] Ignore previous partial specializations of member templates explicitly specialized for an implicitly instantiated class template specialization (#113464)

2024-10-30 Thread via cfe-commits
Author: Krystian Stasiowski Date: 2024-10-30T11:24:10-04:00 New Revision: 7d1e283bd3b4440aea9ac375ca51e2ee6b0e86f5 URL: https://github.com/llvm/llvm-project/commit/7d1e283bd3b4440aea9ac375ca51e2ee6b0e86f5 DIFF: https://github.com/llvm/llvm-project/commit/7d1e283bd3b4440aea9ac375ca51e2ee6b0e86f5

[clang] [Clang][Sema] Ignore previous partial specializations of member class templates explicitly specialized for a implicitly instantiated class template specialization (PR #113464)

2024-10-30 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian closed https://github.com/llvm/llvm-project/pull/113464 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [libcxxabi] [Fuchsia][cmake] Allow using FatLTO when building runtimes (PR #112277)

2024-10-30 Thread Paul Kirth via cfe-commits
ilovepi wrote: ping. https://github.com/llvm/llvm-project/pull/112277 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang/AST] Make it possible to use SwiftAttr in type context (PR #108631)

2024-10-30 Thread Pavel Yaskevich via cfe-commits
xedin wrote: No worries, I can just rebase and push force, that should do it :) https://github.com/llvm/llvm-project/pull/108631 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -12053,6 +12053,10 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD, if (LangOpts.OpenMP) OpenMP().ActOnFinishedFunctionDefinitionInOpenMPAssumeScope(NewFD); + if (LangOpts.isSYCL() && NewFD->hasAttr() && + !NewFD->isInvalidDecl() && !NewFD-

[clang] 463a4c1 - [clang] Remove some uses of llvm::StructType::setBody. NFC. (#113691)

2024-10-30 Thread via cfe-commits
Author: Jay Foad Date: 2024-10-30T16:53:08Z New Revision: 463a4c16ea9c1a3c1210d0ac39e56a75b43b5a8d URL: https://github.com/llvm/llvm-project/commit/463a4c16ea9c1a3c1210d0ac39e56a75b43b5a8d DIFF: https://github.com/llvm/llvm-project/commit/463a4c16ea9c1a3c1210d0ac39e56a75b43b5a8d.diff LOG: [cla

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Erich Keane via cfe-commits
@@ -12053,6 +12053,10 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD, if (LangOpts.OpenMP) OpenMP().ActOnFinishedFunctionDefinitionInOpenMPAssumeScope(NewFD); + if (LangOpts.isSYCL() && NewFD->hasAttr() && + !NewFD->isInvalidDecl() && !NewFD-

[clang] [HLSL] Remove old resource annotations for UAVs and SRVs (PR #114139)

2024-10-30 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/114139 >From f9b74fe0a9631a01edbad1e8c8e02ca05e3ee0ee Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Tue, 29 Oct 2024 15:22:27 -0700 Subject: [PATCH 1/3] [HLSL] Remove old resource annotations for UAVs and SRVs UAVs

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Erich Keane via cfe-commits
@@ -455,6 +455,174 @@ The SYCL kernel in the previous code sample meets these expectations. }]; } +def SYCLKernelEntryPointDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The ``sycl_kernel_entry_point`` attribute facilitates the generation of a

[clang] [clang][CodeGen] `sret` args should always point to the `alloca` AS, so use that (PR #114062)

2024-10-30 Thread John McCall via cfe-commits
rjmccall wrote: I agree that it doesn't meaningfully come from a source-level type and should be specified by the target lowering. I just want to make sure we write the new code in a way that plausibly supports the target ABI specifying something other than "it's always in the alloca AS". Ca

[clang] Remove device override for operator new when the C++ standard >= 26 (PR #114056)

2024-10-30 Thread Artem Belevich via cfe-commits
https://github.com/Artem-B approved this pull request. https://github.com/llvm/llvm-project/pull/114056 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Remove some uses of llvm::StructType::setBody. NFC. (PR #113691)

2024-10-30 Thread John McCall via cfe-commits
https://github.com/rjmccall approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/113691 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang/AST] Make it possible to use SwiftAttr in type context (PR #108631)

2024-10-30 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: I think this would be a great opportunity to save a bit of memory on `AttributedType`, else this is probably ok to me. https://github.com/llvm/llvm-project/pull/108631 ___ cfe-commits mailing list cfe-commits@l

[clang] [clang/AST] Make it possible to use SwiftAttr in type context (PR #108631)

2024-10-30 Thread Erich Keane via cfe-commits
@@ -668,12 +668,16 @@ let Class = AttributedType in { def : Property<"equivalentType", QualType> { let Read = [{ node->getEquivalentType() }]; } - def : Property<"attribute", AttrKind> { + def : Property<"attrKind", AttrKind> { let Read = [{ node->getAttrKind() }

[clang] [clang] Add sincos builtin using `llvm.sincos` intrinsic (PR #114086)

2024-10-30 Thread Benjamin Maxwell via cfe-commits
MacDue wrote: > CC @rohitaggarwal007 who added sincos vectorisation for amdlibm recently - > hopefully we can get ensure amdlibm uses the new builtin + intrinsic safely I have another patch #114039, that allows lowering the `llvm.sincos` intrinsic to the existing vector function mappings. So o

[clang-tools-extra] Extend bugprone-use-after-move check to handle std::optional::reset() and std::any::reset() (PR #114255)

2024-10-30 Thread via cfe-commits
https://github.com/higher-performance updated https://github.com/llvm/llvm-project/pull/114255 >From 560140c5d7d0cc0c8ca011b3700db0592ba8e29b Mon Sep 17 00:00:00 2001 From: higher-performance Date: Wed, 30 Oct 2024 12:01:00 -0400 Subject: [PATCH] Extend bugprone-use-after-move check to handle

[clang] [llvm] [clang][LLVM Demangler] Add a diagnostic that validates that all mang… (PR #111391)

2024-10-30 Thread Erich Keane via cfe-commits
erichkeane wrote: > The RFC is published > https://discourse.llvm.org/t/rfc-clang-diagnostic-for-demangling-failures/82835. Thanks! I thought i commented elsewhere, but I think `diagnose` vs `diagnostics` for the flags/etc makes more sense: `fdiagnostics_demangler_failures` should be `-fdiagn

[clang] [llvm] [Clang] Match MSVC handling of duplicate header search paths in Microsoft compatibility modes. (PR #105738)

2024-10-30 Thread Tom Honermann via cfe-commits
https://github.com/tahonermann ready_for_review https://github.com/llvm/llvm-project/pull/105738 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -12053,6 +12053,10 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD, if (LangOpts.OpenMP) OpenMP().ActOnFinishedFunctionDefinitionInOpenMPAssumeScope(NewFD); + if (LangOpts.isSYCL() && NewFD->hasAttr() && + !NewFD->isInvalidDecl() && !NewFD-

[clang] [llvm] [llvm] Allow always dropping all llvm.type.test sequences (PR #112787)

2024-10-30 Thread Paul Kirth via cfe-commits
ilovepi wrote: @pcc I think I've addressed your comments from https://github.com/llvm/llvm-project/pull/112788 https://github.com/llvm/llvm-project/pull/112787 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

[clang] [Clang] prevent assertion failure from an invalid template instantiation pattern when adding instantiated params to the scope in friend functions with defaulted params (PR #113777)

2024-10-30 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/113777 >From 78019b9d9dc138f38bb5b32576b621351ae6427c Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Sun, 27 Oct 2024 01:07:57 +0300 Subject: [PATCH] [Clang] prevent assertion failure from an invalid template ins

[clang] [analyzer] EvalBinOpLL should return Unknown less often (PR #114222)

2024-10-30 Thread Balazs Benics via cfe-commits
https://github.com/steakhal updated https://github.com/llvm/llvm-project/pull/114222 >From 37ef4f72d42b01e70795bb2fa86138f7fbdd8077 Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Wed, 30 Oct 2024 13:56:40 +0100 Subject: [PATCH 1/2] [analyzer] EvalBinOpLL should return Unknown less often SV

[clang-tools-extra] Extend bugprone-use-after-move check to handle std::optional::reset() and std::any::reset() (PR #114255)

2024-10-30 Thread via cfe-commits
https://github.com/higher-performance created https://github.com/llvm/llvm-project/pull/114255 These need to be handled similarly to the standard smart pointers; they all have a `reset` method. >From 2d907aa6453b43a2bb537cf1eb32d7f3f8a850a7 Mon Sep 17 00:00:00 2001 From: higher-performance Da

[clang] [llvm] [clang][LLVM Demangler] Add a diagnostic that validates that all mang… (PR #111391)

2024-10-30 Thread Viktoriia Bakalova via cfe-commits
VitaNuo wrote: The RFC is published https://discourse.llvm.org/t/rfc-clang-diagnostic-for-demangling-failures/82835. https://github.com/llvm/llvm-project/pull/111391 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-b

[clang] [llvm] [Clang] Match MSVC handling of duplicate header search paths in Microsoft compatibility modes. (PR #105738)

2024-10-30 Thread Tom Honermann via cfe-commits
https://github.com/tahonermann edited https://github.com/llvm/llvm-project/pull/105738 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Extend bugprone-use-after-move check to handle std::optional::reset() and std::any::reset() (PR #114255)

2024-10-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tidy @llvm/pr-subscribers-clang-tools-extra Author: None (higher-performance) Changes These need to be handled similarly to the standard smart pointers; they all have a `reset` method. --- Full diff: https://github.com/llvm/llvm-project/pull/1142

[clang] [llvm] [Clang] restrict use of attribute names reserved by the C++ standard (PR #106036)

2024-10-30 Thread Erich Keane via cfe-commits
@@ -177,6 +180,20 @@ static bool isLanguageDefinedBuiltin(const SourceManager &SourceMgr, return false; } +static bool isReservedCXXAttributeName(Preprocessor &PP, IdentifierInfo *II) { + const LangOptions &Lang = PP.getLangOpts(); + if (Lang.CPlusPlus && + hasAttrib

[clang] [llvm] [Clang] restrict use of attribute names reserved by the C++ standard (PR #106036)

2024-10-30 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/106036 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Wunsafe-buffer-usage] False positives for & expression indexing constant size array (arr[anything & 0]) (PR #112284)

2024-10-30 Thread via cfe-commits
@@ -420,6 +420,118 @@ AST_MATCHER(CXXConstructExpr, isSafeSpanTwoParamConstruct) { return false; } +class MaxValueEval : public RecursiveASTVisitor { + + std::vector val; + ASTContext &Context; + llvm::APInt Max; + unsigned bit_width; + +public: + typedef RecursiveASTV

[clang] [HLSL] get inout/out ABI for array parameters working (PR #111047)

2024-10-30 Thread Sarah Spall via cfe-commits
https://github.com/spall updated https://github.com/llvm/llvm-project/pull/111047 >From 0797f19cad4ca9cf605725de1ac838cccacda1fc Mon Sep 17 00:00:00 2001 From: Sarah Spall Date: Tue, 17 Sep 2024 20:25:46 + Subject: [PATCH 1/6] theoretically fix issue --- clang/lib/Sema/SemaType.cpp | 4 ++

[clang] [clang] Fix crash after merging named enums (PR #114240)

2024-10-30 Thread Michael Jabbour via cfe-commits
https://github.com/michael-jabbour-sonarsource edited https://github.com/llvm/llvm-project/pull/114240 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Suppress a dangling false positive when owner is moved in member initializer. (PR #114213)

2024-10-30 Thread Gábor Horváth via cfe-commits
https://github.com/Xazax-hun approved this pull request. LG! https://github.com/llvm/llvm-project/pull/114213 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement labelled type filtering for overflow/truncation sanitizers w/ SSCLs (PR #107332)

2024-10-30 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt updated https://github.com/llvm/llvm-project/pull/107332 >From 548efc6414503f8ae005f1bd9ef2c7f15ad16241 Mon Sep 17 00:00:00 2001 From: Justin Stitt Date: Tue, 3 Sep 2024 18:28:53 -0700 Subject: [PATCH 1/6] hook up sscl categories with overflow/truncation sanitize

[clang] [NFC] [clang] Use std::string instead of StringRef to reduce stack usage (PR #114285)

2024-10-30 Thread Erich Keane via cfe-commits
erichkeane wrote: > > If you really want to work around MSVC's bug, you could change tablegen to > > emit the string literals as constant globals / StringLiteral > > I spent a bit thinking about this, and this function is incredibly wasteful. > It ends up re-doing a ton of work that is ALREADY

[clang] [ObjC] Insert method parameters in scope as they are parsed (PR #113745)

2024-10-30 Thread Akira Hatanaka via cfe-commits
@@ -4768,60 +4822,9 @@ Decl *SemaObjC::ActOnMethodDeclaration( HasRelatedResultType); SmallVector Params; - - for (unsigned i = 0, e = Sel.getNumArgs(); i != e; ++i) { -QualType ArgType; -TypeSourceInfo *DI; - -if (!ArgInfo[i].Type) { - ArgType = Cont

[clang] [llvm] [HLSL] implement elementwise firstbithigh hlsl builtin (PR #111082)

2024-10-30 Thread Farzon Lotfi via cfe-commits
@@ -2626,6 +2671,151 @@ Register SPIRVInstructionSelector::buildPointerToResource( MIRBuilder); } +bool SPIRVInstructionSelector::selectFirstBitHigh16(Register ResVReg, +const

[clang] [llvm] [HLSL] implement elementwise firstbithigh hlsl builtin (PR #111082)

2024-10-30 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl edited https://github.com/llvm/llvm-project/pull/111082 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -12053,6 +12053,10 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD, if (LangOpts.OpenMP) OpenMP().ActOnFinishedFunctionDefinitionInOpenMPAssumeScope(NewFD); + if (LangOpts.isSYCL() && NewFD->hasAttr() && + !NewFD->isInvalidDecl() && !NewFD-

[clang] [llvm] [InstrPGO] Support cold function coverage instrumentation (PR #109837)

2024-10-30 Thread Reid Kleckner via cfe-commits
@@ -1182,8 +1187,13 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level, const bool IsCtxProfUse = !UseCtxProfile.empty() && Phase == ThinOrFullLTOPhase::ThinLTOPreLink; + // Enable cold function coverage instrumentation if + // InstrumentColdF

[clang] [ObjC] Insert method parameters in scope as they are parsed (PR #113745)

2024-10-30 Thread via cfe-commits
@@ -4768,60 +4822,9 @@ Decl *SemaObjC::ActOnMethodDeclaration( HasRelatedResultType); SmallVector Params; - - for (unsigned i = 0, e = Sel.getNumArgs(); i != e; ++i) { -QualType ArgType; -TypeSourceInfo *DI; - -if (!ArgInfo[i].Type) { - ArgType = Cont

[clang] [Clang][Sema] Always use latest redeclaration of primary template (PR #114258)

2024-10-30 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @erichkeane @felipepiovezan Given that all the failing tests relate to expression evaluation within modules, I think the problem is in `ASTImporter`. https://github.com/llvm/llvm-project/pull/114258 ___ cfe-commits mailing list cfe-c

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Erich Keane via cfe-commits
@@ -12053,6 +12053,10 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD, if (LangOpts.OpenMP) OpenMP().ActOnFinishedFunctionDefinitionInOpenMPAssumeScope(NewFD); + if (LangOpts.isSYCL() && NewFD->hasAttr() && + !NewFD->isInvalidDecl() && !NewFD-

[clang] [llvm] [HLSL] implement elementwise firstbithigh hlsl builtin (PR #111082)

2024-10-30 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl edited https://github.com/llvm/llvm-project/pull/111082 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Always use latest redeclaration of primary template (PR #114258)

2024-10-30 Thread Felipe de Azevedo Piovezan via cfe-commits
felipepiovezan wrote: There seems to be some kind of infinite recursion, I attached the debugger to one such test, and stack at the time of the crash has 59,000 frames. The top few are: ``` (lldb) bt 30 * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=2, address

[clang] [ObjC] Insert method parameters in scope as they are parsed (PR #113745)

2024-10-30 Thread via cfe-commits
https://github.com/apple-fcloutier updated https://github.com/llvm/llvm-project/pull/113745 >From 48013dd32b3fdf6d80f5109c47a2f30a92baf99f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Cloutier?= Date: Thu, 24 Oct 2024 17:50:23 -0700 Subject: [PATCH] [ObjC] Insert method parameters in s

[clang] [llvm] [HLSL] implement elementwise firstbithigh hlsl builtin (PR #111082)

2024-10-30 Thread Farzon Lotfi via cfe-commits
@@ -2626,6 +2671,151 @@ Register SPIRVInstructionSelector::buildPointerToResource( MIRBuilder); } +bool SPIRVInstructionSelector::selectFirstBitHigh16(Register ResVReg, +const

[clang] [libunwind] [llvm] Replace documentation mentions of IRC with Discord (PR #114276)

2024-10-30 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: The developer policy got nailed by line ending changes; I'll try to redo that so it's more obvious what's changed. https://github.com/llvm/llvm-project/pull/114276 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lis

[clang] [LinkerWrapper] Remove handling of special bitcode flags (PR #114298)

2024-10-30 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/114298 >From 2d8e6cba481617f2158d6ac687210636747ea168 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Wed, 30 Oct 2024 15:05:39 -0500 Subject: [PATCH] [LinkerWrapper] Remove handling of special bitcode flags Summary

[clang] [clang] Suppress a dangling false positive when owner is moved in member initializer. (PR #114213)

2024-10-30 Thread Haojian Wu via cfe-commits
https://github.com/hokein ready_for_review https://github.com/llvm/llvm-project/pull/114213 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [LinkerWrapper] Remove handling of special bitcode flags (PR #114298)

2024-10-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Joseph Huber (jhuber6) Changes Summary: These flags were used in the very early days while we were trying to port stuff. Now that we just pass bitcode to the device link job it can be easily replaced by `-Xoffload-linker foo.bc`. --- Full

<    1   2   3   4   5   6   >