[clang-tools-extra] [clang-tidy] add default error message for performance-avoid-endl (PR #107867)

2024-09-12 Thread Julian Schmidt via cfe-commits
@@ -46,14 +46,15 @@ void AvoidEndlCheck::check(const MatchFinder::MatchResult &Result) { // Handle the more common streaming '... << std::endl' case const CharSourceRange TokenRange = CharSourceRange::getTokenRange(Expression->getSourceRange()); -const Stri

[clang-tools-extra] [clang-tidy] add default error message for performance-avoid-endl (PR #107867)

2024-09-12 Thread Julian Schmidt via cfe-commits
@@ -120,6 +120,10 @@ Changes in existing checks ` check to support replacing member function calls too. +- Improved :doc:`performance-avoid-endl + ` check by fixing incorrect + message. + 5chmidti wrote: This feels a bit terse to me. (possible change wo

[clang] [llvm] [HLSL] Implement elementwise popcount (PR #108121)

2024-09-12 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,80 @@ +// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ +// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \ +// RUN: -emit-llvm -disable-llvm-passes -O3 -o - | FileCheck %s + +#ifdef __HLSL_ENABLE_16_BIT +// CHECK: define nound

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-12 Thread via cfe-commits
https://github.com/joaosaffran updated https://github.com/llvm/llvm-project/pull/107292 >From c6434c06d17a2442863f8843e75dc870966fb97c Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Tue, 3 Sep 2024 19:06:22 + Subject: [PATCH 1/5] Adding `asuint` implementation to hlsl --- clang/includ

[clang] [llvm] [HLSL] Implement elementwise popcount (PR #108121)

2024-09-12 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,28 @@ +; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s farzonl wrote: so I don't have to clean this up later can you change this to ```suggestion ; RUN: opt -S -scalarizer -dxil-op-lower -mtriple=dxil-pc-shader

[clang] [llvm] [HLSL] Implement elementwise popcount (PR #108121)

2024-09-12 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,28 @@ +; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s + +; Make sure dxil operation function calls for countbits are generated for all integer types. + +define noundef i16 @test_countbits_short(i16 noundef %a) { +entry: +; CHECK

[clang] [llvm] [HLSL] Implement elementwise popcount (PR #108121)

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

[clang] [llvm] [HLSL] Implement elementwise popcount (PR #108121)

2024-09-12 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,21 @@ +; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv-unknown-unknown %s -o - | FileCheck %s +; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-unknown %s -o - -filetype=obj | spirv-val %} + +; CHECK: OpMemoryModel Logical GLSL450 + +define noundef i32 @co

[clang] [llvm] [HLSL] Implement elementwise popcount (PR #108121)

2024-09-12 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,28 @@ +; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s + +; Make sure dxil operation function calls for countbits are generated for all integer types. + +define noundef i16 @test_countbits_short(i16 noundef %a) { +entry: +; CHECK

[clang] [llvm] [HLSL] Implement elementwise popcount (PR #108121)

2024-09-12 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,27 @@ +// RUN: %clang_cc1 -finclude-default-header +// -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only +// -disable-llvm-passes -verify + + +double test_int_builtin(double p0) { + return countbits(p0); + // expected-error@-1 {{call to 'cou

[clang] [llvm] [HLSL] Implement elementwise popcount (PR #108121)

2024-09-12 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,27 @@ +// RUN: %clang_cc1 -finclude-default-header +// -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only +// -disable-llvm-passes -verify + + +double test_int_builtin(double p0) { + return countbits(p0); + // expected-error@-1 {{call to 'cou

[clang] [llvm] [HLSL] Implement elementwise popcount (PR #108121)

2024-09-12 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl approved this pull request. https://github.com/llvm/llvm-project/pull/108121 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add HLSL 202y language mode (PR #108437)

2024-09-12 Thread Chris B via cfe-commits
@@ -12397,6 +12397,9 @@ def warn_attr_min_eq_max: Warning< def err_hlsl_attribute_number_arguments_insufficient_shader_model: Error< "attribute %0 with %1 arguments requires shader model %2 or greater">; +def ext_hlsl_auto_type_specifier : ExtWarn< llvm-bea

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-12 Thread via cfe-commits
https://github.com/joaosaffran updated https://github.com/llvm/llvm-project/pull/107292 >From c6434c06d17a2442863f8843e75dc870966fb97c Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Tue, 3 Sep 2024 19:06:22 + Subject: [PATCH 1/5] Adding `asuint` implementation to hlsl --- clang/includ

[clang] [HLSL] Add HLSL 202y language mode (PR #108437)

2024-09-12 Thread Chris B via cfe-commits
@@ -12397,6 +12397,9 @@ def warn_attr_min_eq_max: Warning< def err_hlsl_attribute_number_arguments_insufficient_shader_model: Error< "attribute %0 with %1 arguments requires shader model %2 or greater">; +def ext_hlsl_auto_type_specifier : ExtWarn< + "'auto' type specifier

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-12 Thread via cfe-commits
@@ -0,0 +1,18 @@ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify -verify-ignore-unexpected joaosaffran wrote: I've updated the tests, but here is the full err

[clang] [compiler-rt] [llvm] [FMV][AArch64] Remove feature sha1 from FMV. (PR #108383)

2024-09-12 Thread Eli Friedman via cfe-commits
@@ -33,7 +33,6 @@ enum CPUFeatures { FEAT_FP, FEAT_SIMD, FEAT_CRC, - FEAT_SHA1, efriedma-quic wrote: Are there ABI stability concerns if you modify this enum? https://github.com/llvm/llvm-project/pull/108383

[clang] [HLSL] Add HLSL 202y language mode (PR #108437)

2024-09-12 Thread Xiang Li via cfe-commits
https://github.com/python3kgae approved this pull request. https://github.com/llvm/llvm-project/pull/108437 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][test] Fix some windows driver tests with legacy runtime dir layout (PR #108452)

2024-09-12 Thread Nico Weber via cfe-commits
https://github.com/nico approved this pull request. https://github.com/llvm/llvm-project/pull/108452 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 8814b6d - [clang][test] Fix some windows driver tests with legacy runtime dir layout (#108452)

2024-09-12 Thread via cfe-commits
Author: Arthur Eubanks Date: 2024-09-12T18:34:43-04:00 New Revision: 8814b6db3809b1cc341a3672e680faa5d167f52b URL: https://github.com/llvm/llvm-project/commit/8814b6db3809b1cc341a3672e680faa5d167f52b DIFF: https://github.com/llvm/llvm-project/commit/8814b6db3809b1cc341a3672e680faa5d167f52b.diff

[clang] [clang][test] Fix some windows driver tests with legacy runtime dir layout (PR #108452)

2024-09-12 Thread Nico Weber via cfe-commits
https://github.com/nico closed https://github.com/llvm/llvm-project/pull/108452 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add `[[hlsl::contained_type()]]` attribute (PR #108456)

2024-09-12 Thread Helena Kotas via cfe-commits
@@ -30,9 +31,9 @@ class Scope; // FIXME: This can be hidden (as static function in SemaHLSL.cpp) once we no // longer need to create builtin buffer types in HLSLExternalSemaSource. -bool CreateHLSLAttributedResourceType(Sema &S, QualType Wrapped, -

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

2024-09-12 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,95 @@ +//===--- 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-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-09-12 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,95 @@ +//===--- 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-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-09-12 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,95 @@ +//===--- 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-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-09-12 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,35 @@ +//===--- IncorrectEnableSharedFromThisCheck.h - clang-tidy --*- C++ -*-===// +// +// 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-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-09-12 Thread Julian Schmidt via cfe-commits
5chmidti wrote: Please add tests with macros involved. https://github.com/llvm/llvm-project/pull/102299 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

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

2024-09-12 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,95 @@ +//===--- 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-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-09-12 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,121 @@ +// RUN: %check_clang_tidy -std=c++11 %s bugprone-incorrect-enable-shared-from-this %t + +// NOLINTBEGIN +namespace std { +template class enable_shared_from_this {}; +} //namespace std +// NOLINTEND + +class BadClassExample : std::enable_shared_from_this {}

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

2024-09-12 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,95 @@ +//===--- 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-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-09-12 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,95 @@ +//===--- 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] [HLSL] Add `[[hlsl::contained_type()]]` attribute (PR #108456)

2024-09-12 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/108456 >From 9906af110af550643d816b1ed729c19e16027288 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Tue, 10 Sep 2024 14:38:19 -0700 Subject: [PATCH 1/4] [HLSL] Add `[[hlsl::contained_type()]]` resource type attribu

[clang] [Clang] Add wraps attribute (for granular integer overflow handling) (PR #86618)

2024-09-12 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt updated https://github.com/llvm/llvm-project/pull/86618 >From 6fb8f6841795c44471a326a9d096a226cea9f4a8 Mon Sep 17 00:00:00 2001 From: Justin Stitt Date: Tue, 5 Mar 2024 03:14:49 + Subject: [PATCH] implement wraps attribute Signed-off-by: Justin Stitt --- cl

[clang] [HLSL] Add `[[hlsl::raw_buffer]]` attribute (PR #107954)

2024-09-12 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/107954 >From 1c66d2767ca20f42b6edaae834cc186be7d23712 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Mon, 9 Sep 2024 19:39:02 -0700 Subject: [PATCH 1/7] [HLSL] Add `[[hlsl::row_access]]` attribute This PR introduces

[clang] [HLSL] Add `[[hlsl::raw_buffer]]` attribute (PR #107954)

2024-09-12 Thread Helena Kotas via cfe-commits
https://github.com/hekota ready_for_review https://github.com/llvm/llvm-project/pull/107954 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Do not rely on `ctypes`' `errcheck` (PR #105490)

2024-09-12 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum edited https://github.com/llvm/llvm-project/pull/105490 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Do not rely on `ctypes`' `errcheck` (PR #105490)

2024-09-12 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum commented: @Endilll tested how exactly? All tests still pass, obviously, but I just checked and there are six lines changed here, that are not currently covered by tests: `Diagnostic.format()`, `Cursor.get_definition()`, `Cursor.get_usr()`, `Type.get_result()`, `

[clang] [libclang/python] Do not rely on `ctypes`' `errcheck` (PR #105490)

2024-09-12 Thread Jannick Kremer via cfe-commits
@@ -3524,16 +3564,20 @@ def getCompileCommands(self, filename): Get an iterable object providing all the CompileCommands available to build filename. Returns None if filename is not found in the database. """ -return conf.lib.clang_CompilationDat

[clang] [Clang] prevent recovery call expression from proceeding with explicit attributes and undeclared templates (PR #107786)

2024-09-12 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/107786 >From b50e49be3765c31b1c555384c41e1f528d529a88 Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Mon, 9 Sep 2024 02:30:35 +0300 Subject: [PATCH] [Clang] prevent recovery call expression from proceeding with e

[clang] [RFC][C++20][Modules] Fix crash when function and lambda inside loaded from different modules (PR #104512)

2024-09-12 Thread Arthur Eubanks via cfe-commits
Valentin Clement =?utf-8?b?KOODkOODrOODsw=?=,Kyungwoo Lee ,Dmitry Polukhin ,Dmitry Polukhin Message-ID: In-Reply-To: aeubanks wrote: here's something reduced, let me know if you need the command to create the pch file as well ``` https://github.com/llvm/llvm-project/pull/104512 _

[clang] [libclang/python] Do not rely on `ctypes`' `errcheck` (PR #105490)

2024-09-12 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > Should I add tests for all of these first, and then merge that into this PR? That would be nice! https://github.com/llvm/llvm-project/pull/105490 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

[clang] Clang2 (PR #105453)

2024-09-12 Thread Kyungwoo Lee via cfe-commits
https://github.com/kyulee-com updated https://github.com/llvm/llvm-project/pull/105453 >From 966922b9921669d48eb750c36ce3c9b792ba8161 Mon Sep 17 00:00:00 2001 From: Kyungwoo Lee Date: Fri, 26 Apr 2024 12:58:54 -0700 Subject: [PATCH 1/5] [CGData] Clang Optinos --- clang/include/clang/Driver/Op

[clang] Reland: [clang] Diagnose dangling issues for the "Container" case. #107213 (PR #108344)

2024-09-12 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 commented: We seem to be good at detecting new false positives but this is natural due to the visible compiler diagnositc. Unfortunately, same is not true for new false-negatives. More tests in our test-suite is the only way to detect those and we should be extensively

[clang] Reland: [clang] Diagnose dangling issues for the "Container" case. #107213 (PR #108344)

2024-09-12 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/108344 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reland: [clang] Diagnose dangling issues for the "Container" case. #107213 (PR #108344)

2024-09-12 Thread Utkarsh Saxena via cfe-commits
@@ -347,6 +361,30 @@ static bool shouldTrackFirstArgument(const FunctionDecl *FD) { return false; } +// Returns true if we should perform the GSL analysis on the first argument for +// the given constructor. +static bool +shouldTrackFirstArgumentForConstructor(const CXXCons

[clang] Reland: [clang] Diagnose dangling issues for the "Container" case. #107213 (PR #108344)

2024-09-12 Thread Utkarsh Saxena via cfe-commits
@@ -633,4 +633,12 @@ std::optional test4(int a) { return std::make_optional(nullptr); // fine } +template +struct [[gsl::Owner]] StatusOr { + const T &value() [[clang::lifetimebound]]; +}; usx95 wrote: This is a nice test case for coverage of interactions

[clang] Reland: [clang] Diagnose dangling issues for the "Container" case. #107213 (PR #108344)

2024-09-12 Thread Utkarsh Saxena via cfe-commits
@@ -347,6 +361,30 @@ static bool shouldTrackFirstArgument(const FunctionDecl *FD) { return false; } +// Returns true if we should perform the GSL analysis on the first argument for +// the given constructor. +static bool +shouldTrackFirstArgumentForConstructor(const CXXCons

[clang] Reland: [clang] Diagnose dangling issues for the "Container" case. #107213 (PR #108344)

2024-09-12 Thread Utkarsh Saxena via cfe-commits
@@ -347,6 +361,30 @@ static bool shouldTrackFirstArgument(const FunctionDecl *FD) { return false; } +// Returns true if we should perform the GSL analysis on the first argument for +// the given constructor. +static bool +shouldTrackFirstArgumentForConstructor(const CXXCons

[clang] Reland: [clang] Diagnose dangling issues for the "Container" case. #107213 (PR #108344)

2024-09-12 Thread Utkarsh Saxena via cfe-commits
@@ -633,4 +633,12 @@ std::optional test4(int a) { return std::make_optional(nullptr); // fine } +template +struct [[gsl::Owner]] StatusOr { + const T &value() [[clang::lifetimebound]]; +}; usx95 wrote: Some ideas: https://godbolt.org/z/Y6nPM9j1b Feel free

[clang] [CGData] Clang Options (PR #90304)

2024-09-12 Thread Jan Svoboda via cfe-commits
@@ -2753,6 +2753,33 @@ void tools::addMachineOutlinerArgs(const Driver &D, addArg(Twine("-enable-machine-outliner=never")); } } + + auto *CodeGenDataGenArg = + Args.getLastArg(options::OPT_fcodegen_data_generate, jansvoboda11 wrote: Since `fc

[clang-tools-extra] [clang-tidy] Add user-defined functions to `bugprone-unsafe-functions` check (PR #106350)

2024-09-12 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. This looks good from my side. https://github.com/llvm/llvm-project/pull/106350 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add user-defined functions to `bugprone-unsafe-functions` check (PR #106350)

2024-09-12 Thread Julian Schmidt via cfe-commits
@@ -127,57 +134,137 @@ static bool isAnnexKAvailable(std::optional &CacheVar, Preprocessor *PP, return CacheVar.value(); } +static std::vector +parseCheckedFunctions(StringRef Option, ClangTidyContext *Context) { + const std::vector Functions = + utils::options::parse

[clang-tools-extra] [clang-tidy] Add user-defined functions to `bugprone-unsafe-functions` check (PR #106350)

2024-09-12 Thread Julian Schmidt via cfe-commits
@@ -127,57 +134,137 @@ static bool isAnnexKAvailable(std::optional &CacheVar, Preprocessor *PP, return CacheVar.value(); } +static std::vector +parseCheckedFunctions(StringRef Option, ClangTidyContext *Context) { + const std::vector Functions = + utils::options::parse

[clang-tools-extra] [clang-tidy] Add user-defined functions to `bugprone-unsafe-functions` check (PR #106350)

2024-09-12 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/106350 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang] Implement CWG2398 provisional TTP matching to class templates (PR #94981)

2024-09-12 Thread Alexander Kornienko via cfe-commits
alexfh wrote: Here's a reduced test case: https://gcc.godbolt.org/z/jxer3W39W As usual, it's hard to say if the code got invalid during automatic reduction, but it at least compiles well with clang before this commit. https://github.com/llvm/llvm-project/pull/94981

[clang-tools-extra] [clang-tidy] Add `std::span` to default `bugprone-dangling-handle.HandleClasses` (PR #107711)

2024-09-12 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. FYI: this is a partial fix of #75685 https://github.com/llvm/llvm-project/pull/107711 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-09-12 Thread Joshua Batista via cfe-commits
@@ -817,8 +821,12 @@ static void DiagnoseHLSLRegisterAttribute(Sema &S, SourceLocation &ArgLoc, S.Diag(TheDecl->getLocation(), diag::warn_hlsl_user_defined_type_missing_member) << regTypeNum; - -return; +// Space argument cannot be specifie

[clang] [DebugInfo] Correct the line attribution for IF branches (PR #108300)

2024-09-12 Thread David Blaikie via cfe-commits
@@ -0,0 +1,45 @@ +// RUN: %clang_cc1 -debug-info-kind=limited -gno-column-info -triple=x86_64-pc-linux -emit-llvm %s -o - | FileCheck %s + +// The important thing is that the compare and the conditional branch have +// locs with the same scope (the lexical block for the 'if'). B

[clang] [DebugInfo] Correct the line attribution for IF branches (PR #108300)

2024-09-12 Thread David Blaikie via cfe-commits
@@ -0,0 +1,45 @@ +// RUN: %clang_cc1 -debug-info-kind=limited -gno-column-info -triple=x86_64-pc-linux -emit-llvm %s -o - | FileCheck %s + +// The important thing is that the compare and the conditional branch have +// locs with the same scope (the lexical block for the 'if'). B

[clang] [CGData] Clang Options (PR #90304)

2024-09-12 Thread Kyungwoo Lee via cfe-commits
https://github.com/kyulee-com updated https://github.com/llvm/llvm-project/pull/90304 >From 966922b9921669d48eb750c36ce3c9b792ba8161 Mon Sep 17 00:00:00 2001 From: Kyungwoo Lee Date: Fri, 26 Apr 2024 12:58:54 -0700 Subject: [PATCH 1/6] [CGData] Clang Optinos --- clang/include/clang/Driver/Opt

[clang] [CGData] Clang Options (PR #90304)

2024-09-12 Thread Kyungwoo Lee via cfe-commits
https://github.com/kyulee-com updated https://github.com/llvm/llvm-project/pull/90304 >From 966922b9921669d48eb750c36ce3c9b792ba8161 Mon Sep 17 00:00:00 2001 From: Kyungwoo Lee Date: Fri, 26 Apr 2024 12:58:54 -0700 Subject: [PATCH 1/6] [CGData] Clang Optinos --- clang/include/clang/Driver/Opt

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-09-12 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/106782 >From 99408f31a8946df7ef9efa223d0dba2ab876fcd0 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Fri, 30 Aug 2024 12:08:37 -0700 Subject: [PATCH 1/4] add diag and testing for space and global constants ---

[clang] [DebugInfo] Correct the line attribution for IF branches (PR #108300)

2024-09-12 Thread Paul T Robinson via cfe-commits
@@ -0,0 +1,45 @@ +// RUN: %clang_cc1 -debug-info-kind=limited -gno-column-info -triple=x86_64-pc-linux -emit-llvm %s -o - | FileCheck %s + +// The important thing is that the compare and the conditional branch have +// locs with the same scope (the lexical block for the 'if'). B

[clang] [clang-tools-extra] [clang] Implement CWG2398 provisional TTP matching to class templates (PR #94981)

2024-09-12 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Thanks for the repro! I am taking a look. https://github.com/llvm/llvm-project/pull/94981 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [llvm] [llvm] add support for mustache templating language (PR #105893)

2024-09-12 Thread Paul Kirth via cfe-commits
@@ -0,0 +1,276 @@ +//===-- Mustache.cpp --===// +// +// 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: Ap

[clang] [clang-tools-extra] Fix OOM in FormatDiagnostic (PR #108187)

2024-09-12 Thread Vakhurin Sergei via cfe-commits
https://github.com/igelbox updated https://github.com/llvm/llvm-project/pull/108187 >From aee4cf70dedaa3c8b7b6508238e01f92d60c631c Mon Sep 17 00:00:00 2001 From: Sergei Date: Tue, 10 Sep 2024 16:19:05 + Subject: [PATCH 1/3] fix quick OOM in FormatDiagnostic --- .../ClangTidyDiagnosticCons

[clang] [clang-tools-extra] Fix OOM in FormatDiagnostic (PR #108187)

2024-09-12 Thread Vakhurin Sergei via cfe-commits
https://github.com/igelbox edited https://github.com/llvm/llvm-project/pull/108187 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] Fix OOM in FormatDiagnostic (PR #108187)

2024-09-12 Thread Vakhurin Sergei via cfe-commits
https://github.com/igelbox edited https://github.com/llvm/llvm-project/pull/108187 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] Fix OOM in FormatDiagnostic (PR #108187)

2024-09-12 Thread Vakhurin Sergei via cfe-commits
@@ -0,0 +1,41 @@ +// RUN: %clang_cc1 -fallow-pch-with-compiler-errors -std=c++20 -x c++-header -emit-pch %s -o %t -verify +// RUN: %clang_cc1 -fallow-pch-with-compiler-errors -std=c++20 -include-pch %t %s -verify igelbox wrote: In the `main` branch it didn't fa

[clang] [clang-tools-extra] Fix OOM in FormatDiagnostic (PR #108187)

2024-09-12 Thread Vakhurin Sergei via cfe-commits
igelbox wrote: Whew, managed to add both tests. https://github.com/llvm/llvm-project/pull/108187 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Propagate elide safe context through [[clang::coro_must_await]] (PR #108474)

2024-09-12 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 created https://github.com/llvm/llvm-project/pull/108474 None >From a4736c1effa479692157dbe735fa873b233f98bd Mon Sep 17 00:00:00 2001 From: Yuxuan Chen Date: Thu, 12 Sep 2024 17:13:57 -0700 Subject: [PATCH] [Clang] Propagate elide safe context through [[clang

[clang] [llvm] [RISCV] Add Syntacore SCR7 processor definition (PR #108406)

2024-09-12 Thread Yingwei Zheng via cfe-commits
@@ -502,3 +502,28 @@ // RUN: %clang --target=riscv64 -### -c %s 2>&1 -mtune=syntacore-scr5-rv64 | FileCheck -check-prefix=MTUNE-SYNTACORE-SCR5-RV64 %s // MTUNE-SYNTACORE-SCR5-RV64: "-tune-cpu" "syntacore-scr5-rv64" + +// RUN: %clang --target=riscv64 -### -c %s 2>&1 -mcpu=synt

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-09-12 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp edited https://github.com/llvm/llvm-project/pull/106782 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-09-12 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp approved this pull request. LGTM - I think one of the test cases may be redundant (or in the wrong file). https://github.com/llvm/llvm-project/pull/106782 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-09-12 Thread Damyan Pepper via cfe-commits
@@ -1,5 +1,24 @@ // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - -fsyntax-only %s -verify +// valid +cbuffer cbuf { +RWBuffer r : register(u0, space0); +} + +cbuffer cbuf2 { +struct x { +// expected-error@+1 {{'register' attribute only ap

[clang] [clang-tools-extra] [clangd] Collect comments from function definitions into the index (PR #67802)

2024-09-12 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 edited https://github.com/llvm/llvm-project/pull/67802 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clangd] Collect comments from function definitions into the index (PR #67802)

2024-09-12 Thread Nathan Ridge via cfe-commits
@@ -635,17 +635,20 @@ bool SymbolCollector::handleDeclOccurrence( return true; const Symbol *BasicSymbol = Symbols.find(ID); - if (isPreferredDeclaration(*OriginalDecl, Roles)) + bool SkipDocCheckInDef = false; + if (isPreferredDeclaration(*OriginalDecl, Roles)) {

[clang] [clang-tools-extra] [clangd] Collect comments from function definitions into the index (PR #67802)

2024-09-12 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 requested changes to this pull request. Thanks, the test cases look good. https://github.com/llvm/llvm-project/pull/67802 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

[clang] [AST] Iterate redecls starting from the canonical one in getRawCommentsForAnyRedecl() (PR #108475)

2024-09-12 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 created https://github.com/llvm/llvm-project/pull/108475 The intent of the `CommentlessRedeclChains` cache is that if new redecls have been parsed since the last time getRawCommentsForAnyRedecl() was called, only the new redecls are checked for comments. Howe

[clang] [AST] Iterate redecls starting from the canonical one in getRawCommentsForAnyRedecl() (PR #108475)

2024-09-12 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Nathan Ridge (HighCommander4) Changes The intent of the `CommentlessRedeclChains` cache is that if new redecls have been parsed since the last time getRawCommentsForAnyRedecl() was called, only the new redecls are checked for comments. H

[clang] [clang-tools-extra] [clangd] Collect comments from function definitions into the index (PR #67802)

2024-09-12 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: Meanwhile, I thought of a fix for https://github.com/llvm/llvm-project/issues/108145 and submitted it as https://github.com/llvm/llvm-project/pull/108475. If that's accepted, you should be able to drop the `ASTContext.cpp` changes from this patch. https://github.com/llv

[clang] [clang][TableGen] Change ASTProperties Emitter to use const RecordKeeper (PR #108274)

2024-09-12 Thread Rahul Joshi via cfe-commits
https://github.com/jurahul closed https://github.com/llvm/llvm-project/pull/108274 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 3c9db3a - [clang][TableGen] Change ASTProperties Emitter to use const RecordKeeper (#108274)

2024-09-12 Thread via cfe-commits
Author: Rahul Joshi Date: 2024-09-12T18:37:41-07:00 New Revision: 3c9db3a627811f656cc569fe3b8bdb54ba8192bc URL: https://github.com/llvm/llvm-project/commit/3c9db3a627811f656cc569fe3b8bdb54ba8192bc DIFF: https://github.com/llvm/llvm-project/commit/3c9db3a627811f656cc569fe3b8bdb54ba8192bc.diff L

[clang] [llvm] [RISCV] Implement Clang Builtins for XCValu Extension in CV32E40P (PR #100684)

2024-09-12 Thread via cfe-commits
https://github.com/realqhc updated https://github.com/llvm/llvm-project/pull/100684 >From d2169cacc2851db4d57865e26781b93d814ebe80 Mon Sep 17 00:00:00 2001 From: Qihan Cai Date: Fri, 26 Jul 2024 12:26:16 +1000 Subject: [PATCH 1/5] [RISCV] Implement Clang Builtins for XCValu Extension in CV32E4

[clang] [clang][TableGen] Change TypeNodesEmitter to use const RecordKeeper (PR #108476)

2024-09-12 Thread Rahul Joshi via cfe-commits
https://github.com/jurahul created https://github.com/llvm/llvm-project/pull/108476 Change TypeNodesEmitter to use const RecordKeeper. >From 8ac46e76011d91b23bfe2b7fe6aa4f14391ff8e6 Mon Sep 17 00:00:00 2001 From: Rahul Joshi Date: Thu, 12 Sep 2024 18:42:31 -0700 Subject: [PATCH] [clang][TableG

[clang] [clang][TableGen] Change TypeNodesEmitter to use const RecordKeeper (PR #108476)

2024-09-12 Thread Rahul Joshi via cfe-commits
https://github.com/jurahul edited https://github.com/llvm/llvm-project/pull/108476 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Implement Clang Builtins for XCValu Extension in CV32E40P (PR #100684)

2024-09-12 Thread Craig Topper via cfe-commits
@@ -5,122 +5,428 @@ #include #include -// CHECK-LABEL: @test_alu_slet -// CHECK: @llvm.riscv.cv.alu.slet +// CHECK-LABEL: @test_alu_slet( +// CHECK-NEXT: entry: +// CHECK-NEXT:[[A_ADDR_I:%.*]] = alloca i32, align 4 +// CHECK-NEXT:[[B_ADDR_I:%.*]] = alloca i32, align

[clang] [clang][TableGen] Change SACheckersEmitter to use const RecordKeeper (PR #108477)

2024-09-12 Thread Rahul Joshi via cfe-commits
https://github.com/jurahul created https://github.com/llvm/llvm-project/pull/108477 Change SACheckersEmitter to use const RecordKeeper. >From fd8c24e54a55144d0b8c64a203648e427e0504f9 Mon Sep 17 00:00:00 2001 From: Rahul Joshi Date: Thu, 12 Sep 2024 18:46:56 -0700 Subject: [PATCH] [clang][Tabl

[clang] [clang][TableGen] Change SACheckersEmitter to use const RecordKeeper (PR #108477)

2024-09-12 Thread Rahul Joshi via cfe-commits
https://github.com/jurahul edited https://github.com/llvm/llvm-project/pull/108477 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Implement Clang Builtins for XCValu Extension in CV32E40P (PR #100684)

2024-09-12 Thread Craig Topper via cfe-commits
@@ -22150,18 +22150,13 @@ Value *CodeGenFunction::EmitRISCVBuiltinExpr(unsigned BuiltinID, case RISCV::BI__builtin_riscv_cv_alu_extbz: ID = Intrinsic::riscv_cv_alu_extbz; break; - case RISCV::BI__builtin_riscv_cv_alu_exths: -ID = Intrinsic::riscv_cv_alu_exths; -

[clang] [clang][TableGen] Change SyntaxEmitter to use const RecordKeeper (PR #108478)

2024-09-12 Thread Rahul Joshi via cfe-commits
https://github.com/jurahul created https://github.com/llvm/llvm-project/pull/108478 Change SyntaxEmitter to use const RecordKeeper. >From d6c867550f90d27db4324e555b303715ee118319 Mon Sep 17 00:00:00 2001 From: Rahul Joshi Date: Thu, 12 Sep 2024 18:51:44 -0700 Subject: [PATCH] [clang][TableGe

[clang] [clang][TableGen] Change SyntaxEmitter to use const RecordKeeper (PR #108478)

2024-09-12 Thread Rahul Joshi via cfe-commits
https://github.com/jurahul edited https://github.com/llvm/llvm-project/pull/108478 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Fix assertion in `tryDiagnoseOverloadedCast` (PR #108021)

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

[clang] [clang][Sema] Fix assertion in `tryDiagnoseOverloadedCast` (PR #108021)

2024-09-12 Thread Shafik Yaghmour via cfe-commits
@@ -446,7 +446,12 @@ static bool tryDiagnoseOverloadedCast(Sema &S, CastType CT, : InitializationKind::CreateCast(/*type range?*/ range); InitializationSequence sequence(S, entity, initKind, src); - assert(sequence.Failed() && "initialization succeeded on second try?");

[clang] [CGData] Clang Options (PR #90304)

2024-09-12 Thread Kyungwoo Lee via cfe-commits
kyulee-com wrote: > Can we add some documentation to > https://github.com/llvm/llvm-project/blob/main/clang/docs/UsersManual.rst? > This could also be a separate PR. > > LGTM, but I want to give others a chance to review. Added some documentation, and simplify the flag use by removing the dir

[clang] [CGData] Clang Options (PR #90304)

2024-09-12 Thread Kyungwoo Lee via cfe-commits
@@ -1894,6 +1894,18 @@ def fprofile_selected_function_group : Visibility<[ClangOption, CC1Option]>, MetaVarName<"">, HelpText<"Partition functions into N groups using -fprofile-function-groups and select only functions in group i to be instrumented. The valid range is 0 to

[clang] [CGData] Clang Options (PR #90304)

2024-09-12 Thread Kyungwoo Lee via cfe-commits
@@ -2753,6 +2753,33 @@ void tools::addMachineOutlinerArgs(const Driver &D, addArg(Twine("-enable-machine-outliner=never")); } } + + auto *CodeGenDataGenArg = + Args.getLastArg(options::OPT_fcodegen_data_generate, kyulee-com wrote: Thanks for

[clang] [clang][Sema] Fix assertion in `tryDiagnoseOverloadedCast` (PR #108021)

2024-09-12 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Thank you for the fix. Is this from a bug report, if so it should be mentioned in the summary. The summary itself could be a big clearer, maybe a small code example could help. I think this also needs a release note. https://github.com/llvm/llvm-project/p

[clang] Add code completion for C++20 keywords. (PR #107982)

2024-09-12 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: What about `module`, `import` and `export`? https://github.com/llvm/llvm-project/pull/107982 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] dee058f - [RISCV] Emit predefined macro __riscv_cmodel_large for large code model (#108131)

2024-09-12 Thread via cfe-commits
Author: Jim Lin Date: 2024-09-13T10:37:48+08:00 New Revision: dee058f9e3ae95b8f4b95034b65c3d7408060c8e URL: https://github.com/llvm/llvm-project/commit/dee058f9e3ae95b8f4b95034b65c3d7408060c8e DIFF: https://github.com/llvm/llvm-project/commit/dee058f9e3ae95b8f4b95034b65c3d7408060c8e.diff LOG:

<    1   2   3   4   5   6   >