[clang] [clang][bytecode] Diagnose comparing pointers to fields... (PR #137159)

2025-04-24 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/137159 >From a489e3957eeb23fc38758c9a6670a3abd082321d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 24 Apr 2025 13:19:25 +0200 Subject: [PATCH] [clang][bytecode] Diagnose comparing pointers t

[clang] [clang][CompundLiteralExpr] Don't defer evaluation for CLEs (PR #137163)

2025-04-24 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: kadir çetinkaya (kadircet) Changes Previously we would defer evaluation of CLEs until LValue to RValue conversions, which would result in creating values within wrong scope and triggering use-after-frees. This patch instead eagerly evaluat

[clang] [clang] Do not share ownership of `HeaderSearchOptions` (PR #132984)

2025-04-24 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. The changes LGTM, so if we don't hear back from the folks we've pinged in the next few days, I'd say this is safe to land. https://github.com/llvm/llvm-project/pull/132984 ___ cfe-commits mai

[clang] [Clang] Consider preferred_type in bitfield warnings (#116760) (PR #116785)

2025-04-24 Thread Martin Storsjö via cfe-commits
mstorsjo wrote: This change makes Clang produce warnings when building Clang itself; warnings looking like this: ``` /home/martin/code/llvm-project/clang/include/clang/Basic/LangOptions.def:352:1: warning: bit-field 'FPEvalMethod' is not wide enough to store all enumerators of preferred type '

[clang] Thread Safety Analysis: Support reentrant capabilities (PR #137133)

2025-04-24 Thread Aaron Ballman via cfe-commits
@@ -3990,6 +3990,13 @@ def LocksExcluded : InheritableAttr { let Documentation = [Undocumented]; } +def ReentrantCapability : InheritableAttr { + let Spellings = [Clang<"reentrant_capability">]; + let Subjects = SubjectList<[Record, TypedefName]>; + let Documentation = [U

[clang] [clang-repl] : Fix clang-repl crash with --cuda flag (PR #136404)

2025-04-24 Thread Anutosh Bhat via cfe-commits
https://github.com/anutosh491 updated https://github.com/llvm/llvm-project/pull/136404 >From 87ca1f6992d1413d1d2b2e0d230b4f41e1979fef Mon Sep 17 00:00:00 2001 From: anutosh491 Date: Fri, 18 Apr 2025 18:45:00 +0530 Subject: [PATCH 1/2] Fix cuda flag with clang-repl --- clang/include/clang/Inte

[clang] [clang-repl] : Fix clang-repl crash with --cuda flag (PR #136404)

2025-04-24 Thread Anutosh Bhat via cfe-commits
https://github.com/anutosh491 updated https://github.com/llvm/llvm-project/pull/136404 >From 6c64e64c4a3b56f50808cae244b29da1231525f1 Mon Sep 17 00:00:00 2001 From: anutosh491 Date: Fri, 18 Apr 2025 18:45:00 +0530 Subject: [PATCH] Fix cuda flag with clang-repl --- clang/include/clang/Interpre

[clang] [clang-repl] : Fix clang-repl crash with --cuda flag (PR #136404)

2025-04-24 Thread Anutosh Bhat via cfe-commits
anutosh491 wrote: Making a note of the major changes below ! https://github.com/llvm/llvm-project/pull/136404 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][SPIR-V] Addrspace of opencl_global should always be 1 (PR #136753)

2025-04-24 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx approved this pull request. LGTM, thanks! FWIW, perhaps it'd be worthwhile (as a follow-up, not here) to simply make the DefIsGen AS map correct/valid, and replace the dummy bits? https://github.com/llvm/llvm-project/pull/136753 ___

[clang-tools-extra] [clang-tidy] Add check 'bugprone-invalid-enum-default-initialization' (PR #136823)

2025-04-24 Thread via cfe-commits
=?utf-8?q?Bal=C3=A1zs_K=C3=A9ri?= Message-ID: In-Reply-To: @@ -3,7 +3,7 @@ bugprone-invalid-enum-default-initialization -Detect default initialization (to 0) of variables with `enum` type where +Detect default initialization (to

[clang-tools-extra] [clang-tidy] Add check 'bugprone-invalid-enum-default-initialization' (PR #136823)

2025-04-24 Thread via cfe-commits
=?utf-8?q?Balázs_Kéri?= Message-ID: In-Reply-To: @@ -125,6 +125,12 @@ New checks Finds potentially erroneous calls to ``reset`` method on smart pointers when the pointee type also has a ``reset`` method. +- New :doc:`bugprone-invalid-enum-default-initialization + ` che

[clang] [CIR] Upstream TernaryOp (PR #137184)

2025-04-24 Thread Erich Keane via cfe-commits
@@ -609,8 +609,8 @@ def ConditionOp : CIR_Op<"condition", [ //===--===// def YieldOp : CIR_Op<"yield", [ReturnLike, Terminator, - ParentOneOf<["IfOp", "ScopeOp", "WhileOp", -

[clang] [Clang][CodeGen] Add metadata for load from reference (PR #98746)

2025-04-24 Thread Yingwei Zheng via cfe-commits
@@ -2799,9 +2799,30 @@ CodeGenFunction::EmitLoadOfReference(LValue RefLVal, llvm::LoadInst *Load = Builder.CreateLoad(RefLVal.getAddress(), RefLVal.isVolatile()); CGM.DecorateInstructionWithTBAA(Load, RefLVal.getTBAAInfo()); - return makeNaturalAddressForPointer(Load

[clang] [CIR] Upstream TernaryOp (PR #137184)

2025-04-24 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: Not the best one to do the full review here, but had 2 comments. https://github.com/llvm/llvm-project/pull/137184 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/li

[clang] [Clang][CodeGen] Add metadata for load from reference (PR #98746)

2025-04-24 Thread Yingwei Zheng via cfe-commits
@@ -1,8 +1,8 @@ // RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -o - %s -O2 | FileCheck %s -// Make sure the call to b() doesn't get optimized out. +// Make sure the call to b() is eliminated. extern struct x {char& x,y;}y; int b(); int a() { if (!&y.x) b();

[clang] [CIR] Upstream TernaryOp (PR #137184)

2025-04-24 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/137184 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream TernaryOp (PR #137184)

2025-04-24 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Morris Hafner (mmha) Changes This patch adds TernaryOp to CIR plus a pass that flattens the operator in FlattenCFG. This is the first PR out of (probably) 3 wrt. TernaryOp. I split the patches up to make reviewing them easier. As such, t

[clang-tools-extra] [clang-tidy] Add check bugprone-misleading-setter-of-reference (PR #132242)

2025-04-24 Thread Donát Nagy via cfe-commits
@@ -0,0 +1,58 @@ +//===--- MisleadingSetterOfReferenceCheck.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] [CIR] Upstream TernaryOp (PR #137184)

2025-04-24 Thread Morris Hafner via cfe-commits
https://github.com/mmha created https://github.com/llvm/llvm-project/pull/137184 This patch adds TernaryOp to CIR plus a pass that flattens the operator in FlattenCFG. This is the first PR out of (probably) 3 wrt. TernaryOp. I split the patches up to make reviewing them easier. As such, this P

[clang] d859cb6 - [OpenACC] Fix variable dereference found by static analysis

2025-04-24 Thread via cfe-commits
Author: erichkeane Date: 2025-04-24T07:43:16-07:00 New Revision: d859cb68836191cfa469d0c951134b53ee31298e URL: https://github.com/llvm/llvm-project/commit/d859cb68836191cfa469d0c951134b53ee31298e DIFF: https://github.com/llvm/llvm-project/commit/d859cb68836191cfa469d0c951134b53ee31298e.diff LO

[clang] [analyzer] Workaround for unintended slowdown (scope increase) (PR #136720)

2025-04-24 Thread Balazs Benics via cfe-commits
steakhal wrote: Do you have data about the analysis times per file, and per analysis entry point? Compared against the current llvm main, and also if this workaround would restore the original running times before https://github.com/llvm/llvm-project/commit/bb27d5e5c6b194a1440b8ac4e5ace68d0ee2

[libclc] [libclc] Support the generic address space (PR #137183)

2025-04-24 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm commented: Even as a compiler implementation detail, libclc should not need to consider the address space mapping. There is a clang bug if there is different mangling. The itanium mangling should be coming from the source type / original address space, not whatever I

[libclc] [libclc] Support the generic address space (PR #137183)

2025-04-24 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm edited https://github.com/llvm/llvm-project/pull/137183 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [SROA] Vector promote some memsets (PR #133301)

2025-04-24 Thread via cfe-commits
macurtis-amd wrote: @nikic ping https://github.com/llvm/llvm-project/pull/133301 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-refactor] Add Matcher Edit refactoring rule (PR #123782)

2025-04-24 Thread Сергеев Игнатий via cfe-commits
IgnatSergeev wrote: @bartlettroscoe, > So is this really transforming the AST? Well yeah, you are right, it replaces it with text, but what i ment, is that it supports replacements with EditGenerators, which are really expressive (a few words about them https://clang.llvm.org/docs/ClangTrans

[clang] [analyzer] Workaround for unintended slowdown (scope increase) (PR #136720)

2025-04-24 Thread Donát Nagy via cfe-commits
@@ -2523,6 +2523,20 @@ bool ExprEngine::replayWithoutInlining(ExplodedNode *N, return true; } +/// Return the innermost location context which is inlined at `Node`, unless +/// it's the top-level (entry point) location context. +static const LocationContext *getInlinedLocati

[clang] [clang] fix unresolved dependent template specialization mangling (PR #135111)

2025-04-24 Thread Matheus Izvekov via cfe-commits
@@ -399,3 +399,20 @@ namespace type_qualifier { // CHECK: @_ZN14type_qualifier1gIPiEEvDTcmcvv_ELi1EE template void g(int); } + +namespace unresolved_template_specialization_type { + template struct enable_if {}; + struct Foo { +static const int value = true; + }; +

[clang] [C] Warn on uninitialized const objects (PR #137166)

2025-04-24 Thread Erich Keane via cfe-commits
@@ -8197,6 +8197,16 @@ def err_address_space_qualified_new : Error< def err_address_space_qualified_delete : Error< "'delete' cannot delete objects of type %0 in address space '%1'">; +def note_default_init_const_member : Note< + "member %0 declared 'const' here">; +def war

[clang] [llvm] [mlir] [TableGen] Only store direct superclasses in Record (PR #123072)

2025-04-24 Thread Jay Foad via cfe-commits
https://github.com/jayfoad updated https://github.com/llvm/llvm-project/pull/123072 >From f12511a0fd30c47ea08e6c126cae558215758183 Mon Sep 17 00:00:00 2001 From: Jay Foad Date: Wed, 15 Jan 2025 13:34:41 + Subject: [PATCH 01/16] Change API of getSuperClasses --- llvm/include/llvm/TableGen/

[clang] [clang][bytecode] Emit diagnostics from GetGlobalUnchecked (PR #137203)

2025-04-24 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/137203 If the global is uninitialized. >From 87377cd713004492ca9c989e1e7de806ba972ebf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 24 Apr 2025 17:46:49 +0200 Subject: [PATCH] [clang][byteco

[clang] Fix a crash in constant evaluation of ExtVectorElementExprs (PR #136771)

2025-04-24 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak closed https://github.com/llvm/llvm-project/pull/136771 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] feaa5aa - Fix a crash in constant evaluation of ExtVectorElementExprs (#136771)

2025-04-24 Thread via cfe-commits
Author: Akira Hatanaka Date: 2025-04-24T08:47:29-07:00 New Revision: feaa5aa840dcda69bd4133536142be882f696114 URL: https://github.com/llvm/llvm-project/commit/feaa5aa840dcda69bd4133536142be882f696114 DIFF: https://github.com/llvm/llvm-project/commit/feaa5aa840dcda69bd4133536142be882f696114.diff

[clang] [clang] Implement address sanitizer on AIX (1/n) (PR #129925)

2025-04-24 Thread Jake Egan via cfe-commits
https://github.com/jakeegan updated https://github.com/llvm/llvm-project/pull/129925 >From 072f4eca3825729d69d423d774c8a3298cb624a8 Mon Sep 17 00:00:00 2001 From: Jake Egan Date: Wed, 5 Mar 2025 01:57:38 -0500 Subject: [PATCH 1/2] [clang] Implement address sanitizer on AIX (1/3) The PR include

[clang] [clang][bytecode] Emit diagnostics from GetGlobalUnchecked (PR #137203)

2025-04-24 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Timm Baeder (tbaederr) Changes If the global is uninitialized. --- Full diff: https://github.com/llvm/llvm-project/pull/137203.diff 2 Files Affected: - (modified) clang/lib/AST/ByteCode/Interp.h (+1-1) - (modified) clang/test/AST/ByteC

[clang] [analyzer] Workaround for unintended slowdown (scope increase) (PR #136720)

2025-04-24 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/136720 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Workaround for unintended slowdown (scope increase) (PR #136720)

2025-04-24 Thread Donát Nagy via cfe-commits
NagyDonat wrote: @balazs-benics-sonarsource Unfortunately our current CI (which runs the static analyzer via CodeChecker) cannot provide file-level or entrypoint-level timing information, but I do have full analysis runtime measurements (which I'll edit into the table in my previous comment).

[clang] default clause replaced by otherwise clause for metadirective in OpenMP 5.2 (PR #128640)

2025-04-24 Thread Alexey Bataev via cfe-commits
@@ -1660,6 +1660,10 @@ def err_omp_expected_colon : Error<"missing ':' in %0">; def err_omp_missing_comma : Error< "missing ',' after %0">; def err_omp_expected_context_selector : Error<"expected valid context selector in %0">; +def err_omp_unknown_clause +: Error<"expe

[clang] default clause replaced by otherwise clause for metadirective in OpenMP 5.2 (PR #128640)

2025-04-24 Thread Alexey Bataev via cfe-commits
@@ -2785,6 +2797,13 @@ StmtResult Parser::ParseOpenMPDeclarativeOrExecutableDirective( return Directive; } } + if (CKind == OMPC_otherwise) { +// Check for 'otherwise' keyword. +if (Tok.is(tok::identifier) && +Tok.getIde

[clang] [clang-tools-extra] [flang] [lldb] [llvm] [mlir] [openmp] [polly] [Documentation] Always use SVG for dot-generated doxygen images. (PR #136843)

2025-04-24 Thread Aaron Ballman via cfe-commits
@@ -48,14 +48,6 @@ if (LLVM_ENABLE_DOXYGEN) set(bolt_doxygen_qhp_cust_filter_attrs "") endif() - option(LLVM_DOXYGEN_SVG AaronBallman wrote: Awesome, thanks! https://github.com/llvm/llvm-project/pull/136843

[clang] [CIR] Cleanup support for C functions (PR #136854)

2025-04-24 Thread Iris Shi via cfe-commits
@@ -13,20 +13,76 @@ #include "CIRGenCall.h" #include "CIRGenFunction.h" +#include "CIRGenFunctionInfo.h" #include "clang/CIR/MissingFeatures.h" using namespace clang; using namespace clang::CIRGen; -CIRGenFunctionInfo *CIRGenFunctionInfo::create(CanQualType resultType)

[clang] [Clang][CodeGen] Emit fake uses before musttail calls (PR #136867)

2025-04-24 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/136867 >From 90c09c8326077a1ba6797519bbefd014f32b5beb Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Wed, 23 Apr 2025 14:24:50 +0100 Subject: [PATCH 1/3] [Clang] Emit Fake Uses before musttail calls Fixes the issu

[clang] [clang][CompundLiteralExpr] Don't defer evaluation for CLEs (PR #137163)

2025-04-24 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet updated https://github.com/llvm/llvm-project/pull/137163 From 99fa9a1f5fb74401c790871e6eb1ce473d048d74 Mon Sep 17 00:00:00 2001 From: Kadir Cetinkaya Date: Thu, 24 Apr 2025 11:12:00 +0200 Subject: [PATCH] [clang][CompundLiteralExpr] Don't defer evaluation for CLEs P

[clang] [clang][CompundLiteralExpr] Don't defer evaluation for CLEs (PR #137163)

2025-04-24 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet edited https://github.com/llvm/llvm-project/pull/137163 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CompundLiteralExpr] Don't defer evaluation for CLEs (PR #137163)

2025-04-24 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet created https://github.com/llvm/llvm-project/pull/137163 Previously we would defer evaluation of CLEs until LValue to RValue conversions, which would result in creating values within wrong scope and triggering use-after-frees. This patch instead eagerly evaluates CLE

[clang] [clang] Fix a use-after-free in expression evaluation (PR #118480)

2025-04-24 Thread kadir çetinkaya via cfe-commits
kadircet wrote: Put together a new fix based on the discussions here in https://github.com/llvm/llvm-project/pull/137163, PTAL. @AaronBallman I am afraid this might no longer fix the crashes you're seeing internally though, as the new fix is focused on handling of `CompoundLiteralExpr`s, wher

[clang] [llvm] [RISCV] Add support for Ziccamoc (PR #136694)

2025-04-24 Thread via cfe-commits
https://github.com/T-Tie updated https://github.com/llvm/llvm-project/pull/136694 >From e98beadf0009fa05339b964780e4dfe7c444fdd9 Mon Sep 17 00:00:00 2001 From: Tie Date: Tue, 22 Apr 2025 12:25:32 + Subject: [PATCH 1/2] Add Support for Ziccamoc --- clang/test/Preprocessor/riscv-target-feat

[clang] [C] Warn on uninitialized const objects (PR #137166)

2025-04-24 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/137166 >From bb184fc38d13126f244615425cfefe7368ca71b8 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Wed, 23 Apr 2025 13:40:44 -0400 Subject: [PATCH 1/6] Add -Wdefault-const-init --- clang/docs/ReleaseNotes.

[clang] [clang-repl] : Fix clang-repl crash with --cuda flag (PR #136404)

2025-04-24 Thread Anutosh Bhat via cfe-commits
https://github.com/anutosh491 updated https://github.com/llvm/llvm-project/pull/136404 >From 1f7205615f8d11c1b58e2a2760f85663f97767c5 Mon Sep 17 00:00:00 2001 From: anutosh491 Date: Fri, 18 Apr 2025 18:45:00 +0530 Subject: [PATCH 1/4] Fix cuda flag with clang-repl --- clang/include/clang/Inte

[clang] [clang][CompundLiteralExpr] Don't defer evaluation for CLEs (PR #137163)

2025-04-24 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff HEAD~1 HEAD --extensions cpp,h -- clang/test/AST/static-compound-literals.cpp clang/i

[clang] [clang] Fix a use-after-free in expression evaluation (PR #118480)

2025-04-24 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Thanks! You're right, it may not address the issue we were seeing. Some of our were also ending up with: ``` ==3187048==WARNING: MemorySanitizer: use-of-uninitialized-value #0 0x1f73c115 in clang::APValue::operator=(clang::APValue&&) (/netbatch/donb2642835_00/runDir/

[clang] [llvm] [RISCV] Allow `Zicsr`/`Zifencei` to duplicate with `g` (PR #136842)

2025-04-24 Thread Alex Bradbury via cfe-commits
asb wrote: > If you're planning on backporting this, should the release notes be added in > a separate commit? I'm wondering if you'll end up with issues trying to > cherry-pick it otherwise I think we'd typically land a change in the most logical way for the main branch and then handle unpic

[clang] [clang-repl] : Fix clang-repl crash with --cuda flag (PR #136404)

2025-04-24 Thread Anutosh Bhat via cfe-commits
https://github.com/anutosh491 edited https://github.com/llvm/llvm-project/pull/136404 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-repl] : Fix clang-repl crash with --cuda flag (PR #136404)

2025-04-24 Thread Anutosh Bhat via cfe-commits
https://github.com/anutosh491 edited https://github.com/llvm/llvm-project/pull/136404 ___ 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 check 'bugprone-invalid-enum-default-initialization' (PR #136823)

2025-04-24 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/136823 From 4ce7497bb0dc89de3b9f139177c295291e7d3e9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Thu, 17 Apr 2025 17:36:03 +0200 Subject: [PATCH 1/2] [clang-tidy] Add check 'bugprone-inva

[clang] [clang] fix unresolved dependent template specialization mangling (PR #135111)

2025-04-24 Thread Orlando Cazalet-Hyams via cfe-commits
@@ -399,3 +399,20 @@ namespace type_qualifier { // CHECK: @_ZN14type_qualifier1gIPiEEvDTcmcvv_ELi1EE template void g(int); } + +namespace unresolved_template_specialization_type { + template struct enable_if {}; + struct Foo { +static const int value = true; + }; +

[clang] [clang] Do not share ownership of `HeaderSearchOptions` (PR #132984)

2025-04-24 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. As for the Static Analyzer, if the tests pass, we should be good. Unique_ptr > shared_ptr for sure! https://github.com/llvm/llvm-project/pull/132984 ___ cfe-commits mailing list cfe-commits@lists.

[libclc] [libclc] Remove (vload|vstore)_half helpers (PR #137181)

2025-04-24 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-amdgpu Author: Fraser Cormack (frasercrmck) Changes These were only being used when compiling with versions of clang older than clang 6. As such they were essentially unsuppored and untested. This somewhat simplifies the codebase, producing few

[clang] [clang-repl] : Fix clang-repl crash with --cuda flag (PR #136404)

2025-04-24 Thread Vassil Vassilev via cfe-commits
@@ -28,20 +28,21 @@ IncrementalCUDADeviceParser::IncrementalCUDADeviceParser( std::unique_ptr DeviceInstance, CompilerInstance &HostInstance, llvm::IntrusiveRefCntPtr FS, -llvm::Error &Err, const std::list &PTUs) vgvassilev wrote: Why removing

[clang] [clang-repl] : Fix clang-repl crash with --cuda flag (PR #136404)

2025-04-24 Thread Vassil Vassilev via cfe-commits
@@ -172,6 +154,19 @@ llvm::Error IncrementalCUDADeviceParser::GenerateFatbinary() { FatbinContent.append(PTXCode.begin(), PTXCode.end()); + auto &PTU = PTUs.back(); vgvassilev wrote: ```suggestion const PartialTranslationUnit &PTU = PTUs.back(); ``` h

[clang] [llvm] [clang][OpenMP][SPIR-V] Fix AS of globals and set the default AS to 4 (PR #135251)

2025-04-24 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex edited https://github.com/llvm/llvm-project/pull/135251 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][SPIR-V] Fix OpenCL addrspace mapping when using non-zero default AS (PR #137187)

2025-04-24 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex ready_for_review https://github.com/llvm/llvm-project/pull/137187 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 72cc868 - [Clang][NFC] Move temp variable back into the source (#137095)

2025-04-24 Thread via cfe-commits
Author: Shafik Yaghmour Date: 2025-04-24T08:15:25-07:00 New Revision: 72cc868c65b0641f23d1fb0518a8503c73ecdb5a URL: https://github.com/llvm/llvm-project/commit/72cc868c65b0641f23d1fb0518a8503c73ecdb5a DIFF: https://github.com/llvm/llvm-project/commit/72cc868c65b0641f23d1fb0518a8503c73ecdb5a.dif

[clang] [clang-repl] : Fix clang-repl crash with --cuda flag (PR #136404)

2025-04-24 Thread Anutosh Bhat via cfe-commits
@@ -760,8 +787,10 @@ std::unique_ptr Interpreter::GenModule() { return nullptr; } -CodeGenerator *Interpreter::getCodeGen() const { - FrontendAction *WrappedAct = Act->getWrapped(); +CodeGenerator *Interpreter::getCodeGen(IncrementalAction *Action) const { + if (!Action) +

[clang] [Clang][NFC] Move temp variable back into the source (PR #137095)

2025-04-24 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik closed https://github.com/llvm/llvm-project/pull/137095 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][SPIR-V] Fix OpenCL addrspace mapping when using non-zero default AS (PR #137187)

2025-04-24 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Nick Sarnie (sarnex) Changes Based on feedback from https://github.com/llvm/llvm-project/pull/136753, remove the dummy values for OpenCL and make them match the zero default AS map. --- Full diff: https://github.com/llvm/llvm-project/pull

[clang] [analyzer] Workaround for unintended slowdown (scope increase) (PR #136720)

2025-04-24 Thread Gábor Horváth via cfe-commits
@@ -2523,6 +2523,20 @@ bool ExprEngine::replayWithoutInlining(ExplodedNode *N, return true; } +/// Return the innermost location context which is inlined at `Node`, unless +/// it's the top-level (entry point) location context. +static const LocationContext *getInlinedLocati

[clang] [analyzer] Workaround for unintended slowdown (scope increase) (PR #136720)

2025-04-24 Thread Gábor Horváth via cfe-commits
@@ -414,6 +414,20 @@ ANALYZER_OPTION( "any target.", true) +ANALYZER_OPTION( +bool, LegacyInliningPrevention, "legacy-inlining-prevention", +"If enabled, the analyzer puts functions on a \"do not inline this\" list " +"if it finds an execution path within t

[clang] [analyzer] Workaround for unintended slowdown (scope increase) (PR #136720)

2025-04-24 Thread Gábor Horváth via cfe-commits
@@ -2856,8 +2873,29 @@ void ExprEngine::processBranch( // conflicts with the widen-loop analysis option (which is off by // default). If we intend to support and stabilize the loop widening, // we must ensure that it 'plays nicely' with this logic. - if (

[clang] [analyzer] Workaround for unintended slowdown (scope increase) (PR #136720)

2025-04-24 Thread Gábor Horváth via cfe-commits
@@ -2570,21 +2584,24 @@ void ExprEngine::processCFGBlockEntrance(const BlockEdge &L, const ExplodedNode *Sink = nodeBuilder.generateSink(Pred->getState(), Pred, &tag); -// Check if we stopped at the top level function or not. -// Root node shoul

[clang] [clang-repl] : Fix clang-repl crash with --cuda flag (PR #136404)

2025-04-24 Thread Anutosh Bhat via cfe-commits
https://github.com/anutosh491 updated https://github.com/llvm/llvm-project/pull/136404 >From 6c64e64c4a3b56f50808cae244b29da1231525f1 Mon Sep 17 00:00:00 2001 From: anutosh491 Date: Fri, 18 Apr 2025 18:45:00 +0530 Subject: [PATCH 1/3] Fix cuda flag with clang-repl --- clang/include/clang/Inte

[clang] [analyzer] Workaround for unintended slowdown (scope increase) (PR #136720)

2025-04-24 Thread Donát Nagy via cfe-commits
@@ -414,6 +414,20 @@ ANALYZER_OPTION( "any target.", true) +ANALYZER_OPTION( +bool, LegacyInliningPrevention, "legacy-inlining-prevention", +"If enabled, the analyzer puts functions on a \"do not inline this\" list " +"if it finds an execution path within t

[clang] [clang-repl] : Fix clang-repl crash with --cuda flag (PR #136404)

2025-04-24 Thread Anutosh Bhat via cfe-commits
https://github.com/anutosh491 edited https://github.com/llvm/llvm-project/pull/136404 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-repl] : Fix clang-repl crash with --cuda flag (PR #136404)

2025-04-24 Thread Anutosh Bhat via cfe-commits
@@ -50,25 +50,6 @@ IncrementalCUDADeviceParser::Parse(llvm::StringRef Input) { if (!PTU) return PTU.takeError(); - auto PTX = GeneratePTX(); anutosh491 wrote: Yes absolutely ! Sorry for overlooking this. Made the change. https://github.com/llvm/llvm-

[clang] [analyzer] Workaround for unintended slowdown (scope increase) (PR #136720)

2025-04-24 Thread Donát Nagy via cfe-commits
@@ -2570,21 +2584,24 @@ void ExprEngine::processCFGBlockEntrance(const BlockEdge &L, const ExplodedNode *Sink = nodeBuilder.generateSink(Pred->getState(), Pred, &tag); -// Check if we stopped at the top level function or not. -// Root node shoul

[clang] [CIR] Cleanup support for C functions (PR #136854)

2025-04-24 Thread Iris Shi via cfe-commits
https://github.com/el-ev updated https://github.com/llvm/llvm-project/pull/136854 >From fd1d37ebf0f1c4a23f573444f30730b0f65630bf Mon Sep 17 00:00:00 2001 From: Iris Shi <0...@owo.li> Date: Wed, 23 Apr 2025 20:23:09 +0800 Subject: [PATCH 1/2] [CIR] Cleanup support for C functions --- clang/lib/

[clang] [clang-tools-extra] [flang] [lldb] [llvm] [mlir] [openmp] [polly] [Documentation] Always use SVG for dot-generated doxygen images. (PR #136843)

2025-04-24 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: I think the changes LG, but please wait for our CMake experts (@petrhosek and @Ericson2314) to review before landing. https://github.com/llvm/llvm-project/pull/136843 ___ cfe-commits mailing list cfe-commits@

[clang] [clang] Do not share ownership of `HeaderSearchOptions` (PR #132984)

2025-04-24 Thread Aaron Ballman via cfe-commits
@@ -569,7 +569,7 @@ CrossTranslationUnitContext::ASTLoader::loadFromDump(StringRef ASTDumpPath) { return ASTUnit::LoadFromASTFile( ASTDumpPath, CI.getPCHContainerOperations()->getRawReader(), ASTUnit::LoadEverything, Diags, CI.getFileSystemOpts(), - CI.getHe

[clang] [analyzer] Workaround for unintended slowdown (scope increase) (PR #136720)

2025-04-24 Thread Donát Nagy via cfe-commits
@@ -0,0 +1,198 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -verify=expected,default %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -analyzer-config legacy-inlining-prevention=false -verify=expected,disabled %s + +int get

[clang] [llvm] [clang][OpenMP][SPIR-V] Fix AS of globals and set the default AS to 4 (PR #135251)

2025-04-24 Thread Alexander Kornienko via cfe-commits
alexfh wrote: > I'm going to separate out the CUDA SPIRV regression fix as I need to fix some > problems with this PR, will add you as a reviewer. Do you have a timeline? It would be nice to get this fixed soon. https://github.com/llvm/llvm-project/pull/135251 _

[clang] [CIR] Cleanup support for C functions (PR #136854)

2025-04-24 Thread Iris Shi via cfe-commits
https://github.com/el-ev updated https://github.com/llvm/llvm-project/pull/136854 >From fd1d37ebf0f1c4a23f573444f30730b0f65630bf Mon Sep 17 00:00:00 2001 From: Iris Shi <0...@owo.li> Date: Wed, 23 Apr 2025 20:23:09 +0800 Subject: [PATCH 1/2] [CIR] Cleanup support for C functions --- clang/lib/

[clang] [CIR] Cleanup support for C functions (PR #136854)

2025-04-24 Thread Iris Shi via cfe-commits
@@ -233,6 +233,19 @@ int f8(int *p) { // OGCG: %[[P2:.*]] = load ptr, ptr %[[P_PTR]], align 8 // OGCG: %[[STAR_P:.*]] = load i32, ptr %[[P2]], align 4 + +void f9() {} el-ev wrote: I'm actually unsure what kind of new tests would be appropriate. Do you ha

[clang] [clang][bytecode] Diagnose comparing pointers to fields... (PR #137159)

2025-04-24 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/137159 ... with different access specifiers. >From a4c3afca1ef1d029aea8c70d83195100e48b39e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 24 Apr 2025 13:19:25 +0200 Subject: [PATCH] [clang][

[clang] [clang][CompundLiteralExpr] Don't defer evaluation for CLEs (PR #137163)

2025-04-24 Thread kadir çetinkaya via cfe-commits
kadircet wrote: Followup for https://github.com/llvm/llvm-project/pull/118480 https://github.com/llvm/llvm-project/pull/137163 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C] Warn on uninitialized const objects (PR #137166)

2025-04-24 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff HEAD~1 HEAD --extensions cl,c,cpp -- clang/test/Sema/warn-default-const-init.c clang/

[clang] [clang-repl] : Fix clang-repl crash with --cuda flag (PR #136404)

2025-04-24 Thread Anutosh Bhat via cfe-commits
https://github.com/anutosh491 updated https://github.com/llvm/llvm-project/pull/136404 >From 1f7205615f8d11c1b58e2a2760f85663f97767c5 Mon Sep 17 00:00:00 2001 From: anutosh491 Date: Fri, 18 Apr 2025 18:45:00 +0530 Subject: [PATCH 1/2] Fix cuda flag with clang-repl --- clang/include/clang/Inte

[clang] [clang][bytecode] Diagnose comparing pointers to fields... (PR #137159)

2025-04-24 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Timm Baeder (tbaederr) Changes ... with different access specifiers. --- Full diff: https://github.com/llvm/llvm-project/pull/137159.diff 4 Files Affected: - (modified) clang/lib/AST/ByteCode/Interp.h (+13) - (modified) clang/lib/AST/B

[clang] [clang][analyzer][NFC] Add a helper for conjuring symbols at call events (PR #137182)

2025-04-24 Thread Fangyi Zhou via cfe-commits
https://github.com/fangyi-zhou ready_for_review https://github.com/llvm/llvm-project/pull/137182 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang][OpenMP][SPIR-V] Fix AS of globals and set the default AS to 4 (PR #135251)

2025-04-24 Thread Nick Sarnie via cfe-commits
sarnex wrote: Thanks for the feedback, I'll work to address it. https://github.com/llvm/llvm-project/pull/135251 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 52a9649 - [clang][SPIR-V] Addrspace of opencl_global should always be 1 (#136753)

2025-04-24 Thread via cfe-commits
Author: Nick Sarnie Date: 2025-04-24T14:20:13Z New Revision: 52a96491e1e4e0d033e39fad87f49ccd871df41d URL: https://github.com/llvm/llvm-project/commit/52a96491e1e4e0d033e39fad87f49ccd871df41d DIFF: https://github.com/llvm/llvm-project/commit/52a96491e1e4e0d033e39fad87f49ccd871df41d.diff LOG: [

[clang] [llvm] [clang][OpenMP][SPIR-V] Fix AS of globals and set the default AS to 4 (PR #135251)

2025-04-24 Thread Nick Sarnie via cfe-commits
sarnex wrote: @alexfh The regression is fixed in https://github.com/llvm/llvm-project/commit/52a96491e1e4e0d033e39fad87f49ccd871df41d https://github.com/llvm/llvm-project/pull/135251 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://list

[clang] [clang][SPIR-V] Addrspace of opencl_global should always be 1 (PR #136753)

2025-04-24 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex closed https://github.com/llvm/llvm-project/pull/136753 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][SPIR-V] Addrspace of opencl_global should always be 1 (PR #136753)

2025-04-24 Thread Nick Sarnie via cfe-commits
sarnex wrote: Thanks for the review, and will do @AlexVlx! https://github.com/llvm/llvm-project/pull/136753 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C] Warn on uninitialized const objects (PR #137166)

2025-04-24 Thread Aaron Ballman via cfe-commits
@@ -8197,6 +8197,16 @@ def err_address_space_qualified_new : Error< def err_address_space_qualified_delete : Error< "'delete' cannot delete objects of type %0 in address space '%1'">; +def note_default_init_const_member : Note< + "member %0 declared 'const' here">; +def war

[clang] [C] Warn on uninitialized const objects (PR #137166)

2025-04-24 Thread Erich Keane via cfe-commits
@@ -6496,6 +6496,17 @@ static bool canPerformArrayCopy(const InitializedEntity &Entity) { return false; } +static const FieldDecl *GetConstField(const RecordDecl *RD) { erichkeane wrote: Ah, I see! Would love an assert to that effect. https://github.com/

[clang] [C] Warn on uninitialized const objects (PR #137166)

2025-04-24 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. 1 spelling nit, 1 request for an assert, else LGTM. https://github.com/llvm/llvm-project/pull/137166 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

[clang] [clang][analyzer][NFC] Add a helper for conjuring symbols at call events (PR #137182)

2025-04-24 Thread Fangyi Zhou via cfe-commits
https://github.com/fangyi-zhou created https://github.com/llvm/llvm-project/pull/137182 Per suggestion in https://github.com/llvm/llvm-project/pull/128251#discussion_r2055916229, adding a new helper function in `SValBuilder` to conjure a symbol when given a `CallEvent`. Tested manually (with

[clang] [clang][analyzer][NFC] Add a helper for conjuring symbols at call events (PR #137182)

2025-04-24 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-static-analyzer-1 Author: Fangyi Zhou (fangyi-zhou) Changes Per suggestion in https://github.com/llvm/llvm-project/pull/128251#discussion_r2055916229, adding a new helper function in `SValBuilder` to conjure a symbol when given a `CallEvent`. Te

[clang] [C] Warn on uninitialized const objects (PR #137166)

2025-04-24 Thread Erich Keane via cfe-commits
@@ -8197,6 +8197,16 @@ def err_address_space_qualified_new : Error< def err_address_space_qualified_delete : Error< "'delete' cannot delete objects of type %0 in address space '%1'">; +def note_default_init_const_member : Note< + "member %0 declared 'const' here">; +def war

[clang] Thread Safety Analysis: Support reentrant capabilities (PR #137133)

2025-04-24 Thread Aaron Ballman via cfe-commits
@@ -139,22 +141,41 @@ class FactEntry : public CapabilityExpr { bool declared() const { return Source == Declared; } bool managed() const { return Source == Managed; } - virtual void - handleRemovalFromIntersection(const FactSet &FSet, FactManager &FactMan, -

[clang] [llvm] [clang][OpenMP][SPIR-V] Fix AS of globals and set the default AS to 4 (PR #135251)

2025-04-24 Thread Nick Sarnie via cfe-commits
@@ -1217,11 +1217,13 @@ void CGOpenMPRuntimeGPU::emitParallelCall(CodeGenFunction &CGF, CGBuilderTy &Bld = CGF.Builder; llvm::Value *NumThreadsVal = NumThreads; llvm::Function *WFn = WrapperFunctionsMap[OutlinedFn]; +llvm::FunctionCallee RuntimeFn = OMPBuilder.

  1   2   3   4   5   6   >