[clang] [clang] Lower _BitInt(129+) to a different type in LLVM IR (PR #91364)

2024-05-29 Thread Eli Friedman via cfe-commits
@@ -436,9 +436,9 @@ class ScalarExprEmitter if (Value *Result = ConstantEmitter(CGF).tryEmitConstantExpr(E)) { if (E->isGLValue()) -return CGF.Builder.CreateLoad(Address( -Result, CGF.ConvertTypeForMem(E->getType()), -CGF.getContext().

[clang] [clang] Lower _BitInt(129+) to a different type in LLVM IR (PR #91364)

2024-05-29 Thread Eli Friedman via cfe-commits
@@ -761,6 +761,10 @@ bool ConstStructBuilder::Build(const InitListExpr *ILE, bool AllowOverwrite) { if (Field->hasAttr()) AllowOverwrite = true; } else { + llvm::Type *LoadType = CGM.getTypes().convertTypeForLoadStore( efriedma-quic wrot

[clang] [llvm] [clang] Add tanf16 builtin and support for tan constrained intrinsic (PR #93314)

2024-05-29 Thread Paul Kirth via cfe-commits
ilovepi wrote: Hi, we're seeing a codegen issue building Fuchsia after this patch. I'm looking now, but so far I'm not sure why this is happening. Would you mind taking a look? Error: ``` FAILED: obj/src/graphics/lib/compute/spinel/ext/transform_stack/transform_stack.transform_stack.c.o ..

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

2024-05-29 Thread Justin Stitt via cfe-commits
JustinStitt wrote: Hi, gentle ping. @efriedma-quic, do you still have concerns with the current implementation (as an attribute attached to typedefs)? After limiting `wraps` to C and adding warnings to let users know when the attribute may be stripped, I think it's in a good spot. ```c type

[clang] [llvm] [clang] Add tanf16 builtin and support for tan constrained intrinsic (PR #93314)

2024-05-29 Thread Farzon Lotfi via cfe-commits
farzonl wrote: > Hi, we're seeing a codegen issue building Fuchsia after this patch. I'm > looking now, but so far I'm not sure why this is happening. Would you mind > taking a look? > > Error: > fatal error: error in backend: Cannot select: intrinsic %llvm.tan > PLEASE submit a bug report to

[clang] [llvm] Revert "[clang] Add tanf16 builtin and support for tan constrained intrinsic (#93314)" (PR #93721)

2024-05-29 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl created https://github.com/llvm/llvm-project/pull/93721 This reverts commit b15a0a37404f36bcd9c7995de8cd16f9cb5ac8af. This should undo PR: https://github.com/llvm/llvm-project/pull/93314 will need to re-open https://github.com/llvm/llvm-project/issues/91421 wait for

[clang] [llvm] Revert "[clang] Add tanf16 builtin and support for tan constrained intrinsic (#93314)" (PR #93721)

2024-05-29 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Farzon Lotfi (farzonl) Changes This reverts commit b15a0a37404f36bcd9c7995de8cd16f9cb5ac8af. This should undo PR: https://github.com/llvm/llvm-project/pull/93314 will need to re-open https://github.com/llvm/llvm-project/issues/91421 wait

[clang] [llvm] Revert "[clang] Add tanf16 builtin and support for tan constrained intrinsic (#93314)" (PR #93721)

2024-05-29 Thread Farzon Lotfi via cfe-commits
farzonl wrote: FYI @ilovepi @bogner to unblock other I am going to merge this reversion now without approvals. https://github.com/llvm/llvm-project/pull/93721 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailm

[clang] [llvm] Revert "[clang] Add tanf16 builtin and support for tan constrained intrinsic (#93314)" (PR #93721)

2024-05-29 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl closed https://github.com/llvm/llvm-project/pull/93721 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 7348bb2 - Revert "[clang] Add tanf16 builtin and support for tan constrained intrinsic (#93314)" (#93721)

2024-05-29 Thread via cfe-commits
Author: Farzon Lotfi Date: 2024-05-29T15:32:38-04:00 New Revision: 7348bb23abdf59e503c815037ce9835f5dd15df2 URL: https://github.com/llvm/llvm-project/commit/7348bb23abdf59e503c815037ce9835f5dd15df2 DIFF: https://github.com/llvm/llvm-project/commit/7348bb23abdf59e503c815037ce9835f5dd15df2.diff

[clang] [clang-format] add an option to insert a space only for non-code block empty braces, not for empty parentheses (PR #93634)

2024-05-29 Thread Björn Schäpers via cfe-commits
@@ -14027,6 +14027,11 @@ TEST_F(FormatTest, LayoutCxx11BraceInitializers) { SpaceBetweenBraces.SpacesInParens = FormatStyle::SIPO_Custom; SpaceBetweenBraces.SpacesInParensOptions.InEmptyParentheses = true; verifyFormat("vector< int > x{ };", SpaceBetweenBraces); + SpaceB

[clang] [clang-format] add an option to insert a space only for non-code block empty braces, not for empty parentheses (PR #93634)

2024-05-29 Thread Björn Schäpers via cfe-commits
@@ -4682,18 +4693,20 @@ struct FormatStyle { SpacesInParensCustom() HazardyKnusperkeks wrote: Maybe set the default of the webkit style, according to the webkit style guide? https://github.com/llvm/llvm-project/pull/93634 _

[clang] [clang-format] add an option to insert a space only for non-code block empty braces, not for empty parentheses (PR #93634)

2024-05-29 Thread Björn Schäpers via cfe-commits
@@ -14027,6 +14027,11 @@ TEST_F(FormatTest, LayoutCxx11BraceInitializers) { SpaceBetweenBraces.SpacesInParens = FormatStyle::SIPO_Custom; SpaceBetweenBraces.SpacesInParensOptions.InEmptyParentheses = true; verifyFormat("vector< int > x{ };", SpaceBetweenBraces); + SpaceB

[clang] [clang-format] Insert a space between a keyword and a literal (PR #93632)

2024-05-29 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/93632 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang] Add tanf16 builtin and support for tan constrained intrinsic (PR #93314)

2024-05-29 Thread Farzon Lotfi via cfe-commits
farzonl wrote: @ilovepi, How many platforms do you build Fuchsia for? It will be important to know which backends needs support before we try to re-land this. https://github.com/llvm/llvm-project/pull/93314 ___ cfe-commits mailing list cfe-commits@l

[clang-tools-extra] [clang-tidy] Check number of arguments to size/length in readability-container-size-empty (PR #93724)

2024-05-29 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL created https://github.com/llvm/llvm-project/pull/93724 Verify that size/length methods are called with no arguments. Closes #88203 >From 0e8c1ceb616d797298db720069e2eea937a9078e Mon Sep 17 00:00:00 2001 From: Piotr Zegar Date: Wed, 29 May 2024 19:39:22 + Subje

[clang-tools-extra] [clang-tidy] Check number of arguments to size/length in readability-container-size-empty (PR #93724)

2024-05-29 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tidy Author: Piotr Zegar (PiotrZSL) Changes Verify that size/length methods are called with no arguments. Closes #88203 --- Full diff: https://github.com/llvm/llvm-project/pull/93724.diff 3 Files Affected: - (modified) clang-tools-extra/clang

[clang-tools-extra] [clang-tidy] Check number of arguments to size/length in readability-container-size-empty (PR #93724)

2024-05-29 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: I'm not 100% sure about release-notes entry. If it shouldn't say that check is restricted now to zero-argument size/length. https://github.com/llvm/llvm-project/pull/93724 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:/

[clang] [libcxx] [clang] Preserve Qualifiers and type sugar in TemplateNames (PR #93433)

2024-05-29 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov closed https://github.com/llvm/llvm-project/pull/93433 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [clang] fix printing of canonical template template parameters take 2 (PR #93448)

2024-05-29 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/93448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 9c4a716 - [clang] Preserve Qualifiers and type sugar in TemplateNames (#93433)

2024-05-29 Thread via cfe-commits
Author: Matheus Izvekov Date: 2024-05-29T17:02:15-03:00 New Revision: 9c4a716c1292096fcbdf415b63b7b0122b03310f URL: https://github.com/llvm/llvm-project/commit/9c4a716c1292096fcbdf415b63b7b0122b03310f DIFF: https://github.com/llvm/llvm-project/commit/9c4a716c1292096fcbdf415b63b7b0122b03310f.dif

[clang] cc1: Report an error for multiple actions unless separated by -main-file-name (PR #91140)

2024-05-29 Thread Fangrui Song via cfe-commits
MaskRay wrote: > > > I don't really understand the rationale for this, and it's kind of > > > annoying. Most of the compiler's flags behave in the "last one wins" > > > fashion (such as `-O2` and `-O0`) and it's always been convenient to add > > > the flag you want at the end. Why treat action

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-05-29 Thread David Blaikie via cfe-commits
@@ -1180,6 +1185,21 @@ bool CodeGenVTables::isVTableExternal(const CXXRecordDecl *RD) { TSK == TSK_ExplicitInstantiationDefinition) return false; + // Itanium C++ ABI [5.2.3]: + // Virtual tables for dynamic classes are emitted as follows: + // + // - If the cla

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-05-29 Thread David Blaikie via cfe-commits
@@ -1180,6 +1185,21 @@ bool CodeGenVTables::isVTableExternal(const CXXRecordDecl *RD) { TSK == TSK_ExplicitInstantiationDefinition) return false; + // Itanium C++ ABI [5.2.3]: + // Virtual tables for dynamic classes are emitted as follows: + // + // - If the cla

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-05-29 Thread David Blaikie via cfe-commits
@@ -1802,6 +1802,12 @@ void ItaniumCXXABI::emitVTableDefinitions(CodeGenVTables &CGVT, if (VTable->hasInitializer()) return; + // If the class is attached to a C++ named module other than the one + // we're currently compiling, the vtable should be defined there. + i

[clang] [clang] fix printing of canonical template template parameters take 2 (PR #93448)

2024-05-29 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/93448 >From 4ed34c959afa51328102ec037b418dbfc84ab063 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Mon, 27 May 2024 05:51:18 -0300 Subject: [PATCH] [clang] fix printing of canonical template template parameter

[clang] [llvm] [DebugInfo][BPF] Add 'btf:type_tag' annotation in DWARF (PR #91423)

2024-05-29 Thread David Blaikie via cfe-commits
https://github.com/dwblaikie approved this pull request. approving mostly on the basis of my own previous approval on phab https://github.com/llvm/llvm-project/pull/91423 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

[clang] [llvm] [clang] Add tanf16 builtin and support for tan constrained intrinsic (PR #93314)

2024-05-29 Thread Paul Kirth via cfe-commits
ilovepi wrote: Thanks for the prompt revert. That's a big help. > @ilovepi, How many platforms do you build Fuchsia for? It will be important > to know which backends needs support before we try to re-land this. Fuchsia builds for Aarch64, RISC-V 64, and X86_64. Our toolchain is also used in

[clang] [llvm] [BPF] Fix linking issues in static map initializers (PR #91310)

2024-05-29 Thread David Blaikie via cfe-commits
https://github.com/dwblaikie commented: Is there some test coverage that shows that unreferenced variables/functions aren't included in the output? https://github.com/llvm/llvm-project/pull/91310 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][objectsize] Generate object size calculation for sub-objects (PR #86858)

2024-05-29 Thread Bill Wendling via cfe-commits
@@ -1052,6 +1053,165 @@ CodeGenFunction::emitFlexibleArrayMemberSize(const Expr *E, unsigned Type, return Builder.CreateSelect(Cmp, Res, ConstantInt::get(ResType, 0, IsSigned)); } +namespace { + +class ObjectSizeVisitor +: public ConstStmtVisitor { + bool SkipASE; + +

[clang] [Serialization] Check for stack exhaustion when reading declarations (PR #79875)

2024-05-29 Thread Ilya Biryukov via cfe-commits
ilya-biryukov wrote: > there's a couple of tests that use `ulimit` > (`clang/test/SemaCXX/PR51712-large-array-constexpr-check-oom.cpp` and > `clang/test/PCH/leakfiles.test`) - so that technique could be used to test > this in a way that's fast enough to check in? oh, I didn't realize I can us

[clang] [Clang][objectsize] Generate object size calculation for sub-objects (PR #86858)

2024-05-29 Thread Bill Wendling via cfe-commits
@@ -1062,6 +1063,159 @@ CodeGenFunction::emitFlexibleArrayMemberSize(const Expr *E, unsigned Type, return Builder.CreateSelect(Cmp, Res, ConstantInt::get(ResType, 0, IsSigned)); } +namespace { + +class ObjectSizeVisitor +: public ConstStmtVisitor { + bool SkipASE; + +

[clang] [llvm] [OpenMP] Remove dependency on `libffi` from offloading runtime (PR #91264)

2024-05-29 Thread Joseph Huber via cfe-commits
jhuber6 wrote: ping https://github.com/llvm/llvm-project/pull/91264 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #81545)

2024-05-29 Thread David Blaikie via cfe-commits
https://github.com/dwblaikie approved this pull request. Fair enough - let's give it a go. https://github.com/llvm/llvm-project/pull/81545 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[clang] bfabc95 - [DebugInfo] Add flag to only emit referenced member functions (#87018)

2024-05-29 Thread via cfe-commits
Author: David Blaikie Date: 2024-05-29T14:09:28-07:00 New Revision: bfabc958c7c0d7ddc15f23383d9da836e8c6093f URL: https://github.com/llvm/llvm-project/commit/bfabc958c7c0d7ddc15f23383d9da836e8c6093f DIFF: https://github.com/llvm/llvm-project/commit/bfabc958c7c0d7ddc15f23383d9da836e8c6093f.diff

[clang] [DebugInfo] Add flag to only emit referenced member functions (PR #87018)

2024-05-29 Thread David Blaikie via cfe-commits
https://github.com/dwblaikie closed https://github.com/llvm/llvm-project/pull/87018 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenACC] Loop construct basic Sema and AST work (PR #93742)

2024-05-29 Thread Erich Keane via cfe-commits
https://github.com/erichkeane created https://github.com/llvm/llvm-project/pull/93742 This patch implements the 'loop' construct AST, as well as the basic appertainment rule. Additionally, it sets up the 'parent' compute construct, which is necessary for codegen/other diagnostics. A 'loop' c

[clang] [OpenACC] Loop construct basic Sema and AST work (PR #93742)

2024-05-29 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen @llvm/pr-subscribers-clang Author: Erich Keane (erichkeane) Changes This patch implements the 'loop' construct AST, as well as the basic appertainment rule. Additionally, it sets up the 'parent' compute construct, which is necessary for

[clang] aeccfee - Add option to generate additional debug info for expression dereferencing pointer to pointers. (#81545)

2024-05-29 Thread via cfe-commits
Author: William Junda Huang Date: 2024-05-29T18:04:11-04:00 New Revision: aeccfee348c717165541d8d895b9b0cdfe31415c URL: https://github.com/llvm/llvm-project/commit/aeccfee348c717165541d8d895b9b0cdfe31415c DIFF: https://github.com/llvm/llvm-project/commit/aeccfee348c717165541d8d895b9b0cdfe31415c

[clang] [llvm] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #81545)

2024-05-29 Thread William Junda Huang via cfe-commits
https://github.com/huangjd closed https://github.com/llvm/llvm-project/pull/81545 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] Add support for Qualcomm Oryon processor (PR #91022)

2024-05-29 Thread Wei Zhao via cfe-commits
@@ -0,0 +1,1659 @@ +//=- AArch64SchedOryon.td - Qualcomm Oryon CPU 001 ---*- tablegen -*-=// +// +// 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: Apache-2.0

[clang] [Clang][objectsize] Generate object size calculation for sub-objects (PR #86858)

2024-05-29 Thread Bill Wendling via cfe-commits
@@ -1062,6 +1063,159 @@ CodeGenFunction::emitFlexibleArrayMemberSize(const Expr *E, unsigned Type, return Builder.CreateSelect(Cmp, Res, ConstantInt::get(ResType, 0, IsSigned)); } +namespace { + +class ObjectSizeVisitor +: public ConstStmtVisitor { + bool SkipASE; + +

[clang] [Clang][objectsize] Generate object size calculation for sub-objects (PR #86858)

2024-05-29 Thread Bill Wendling via cfe-commits
@@ -1062,6 +1063,159 @@ CodeGenFunction::emitFlexibleArrayMemberSize(const Expr *E, unsigned Type, return Builder.CreateSelect(Cmp, Res, ConstantInt::get(ResType, 0, IsSigned)); } +namespace { + +class ObjectSizeVisitor +: public ConstStmtVisitor { + bool SkipASE; + +

[clang] [Clang][objectsize] Generate object size calculation for sub-objects (PR #86858)

2024-05-29 Thread Bill Wendling via cfe-commits
https://github.com/bwendling updated https://github.com/llvm/llvm-project/pull/86858 >From 31af119d614ef2108b5404f9c9387ec45aa1bfef Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Thu, 21 Mar 2024 15:07:31 -0700 Subject: [PATCH 1/7] [Clang][objectsize] Generate object size calculation for s

[clang] [Clang][objectsize] Generate object size calculation for sub-objects (PR #86858)

2024-05-29 Thread Bill Wendling via cfe-commits
@@ -1052,6 +1053,165 @@ CodeGenFunction::emitFlexibleArrayMemberSize(const Expr *E, unsigned Type, return Builder.CreateSelect(Cmp, Res, ConstantInt::get(ResType, 0, IsSigned)); } +namespace { + +class ObjectSizeVisitor +: public ConstStmtVisitor { + bool SkipASE; + +

[clang] [Clang][objectsize] Generate object size calculation for sub-objects (PR #86858)

2024-05-29 Thread Bill Wendling via cfe-commits
@@ -1052,6 +1053,165 @@ CodeGenFunction::emitFlexibleArrayMemberSize(const Expr *E, unsigned Type, return Builder.CreateSelect(Cmp, Res, ConstantInt::get(ResType, 0, IsSigned)); } +namespace { + +class ObjectSizeVisitor +: public ConstStmtVisitor { + bool SkipASE; + +

[clang] [Clang] Implement P3034R1 Module Declarations Shouldn’t be Macros (PR #90574)

2024-05-29 Thread via cfe-commits
@@ -1329,6 +1341,100 @@ bool Preprocessor::LexAfterModuleImport(Token &Result) { return true; } +/// Lex a token following the 'module' contextual keyword. +/// +/// [cpp.module]/p2: +/// The pp-tokens, if any, of a pp-module shall be of the form: +/// pp-module-name p

[clang] [llvm] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #81545)

2024-05-29 Thread Mehdi Amini via cfe-commits
joker-eph wrote: There is a broken test in CI: https://lab.llvm.org/buildbot/#/builders/272/builds/17864 https://github.com/llvm/llvm-project/pull/81545 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/lis

[clang] [Clang] Implement P3034R1 Module Declarations Shouldn’t be Macros (PR #90574)

2024-05-29 Thread via cfe-commits
@@ -862,6 +862,15 @@ bool Preprocessor::HandleIdentifier(Token &Identifier) { ModuleImportExpectsIdentifier = true; CurLexerCallback = CLK_LexAfterModuleImport; } + + if ((II.isModulesDeclaration() || Identifier.is(tok::kw_module)) && + !InMacroArgs && !DisableM

[clang] [Clang] Implement P3034R1 Module Declarations Shouldn’t be Macros (PR #90574)

2024-05-29 Thread via cfe-commits
https://github.com/yronglin edited https://github.com/llvm/llvm-project/pull/90574 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [asan][windows] Eliminate the static asan runtime on windows (PR #81677)

2024-05-29 Thread Charlie Barto via cfe-commits
https://github.com/barcharcraz edited https://github.com/llvm/llvm-project/pull/81677 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-repl] Set up executor implicitly to account for init PTUs (PR #84758)

2024-05-29 Thread Jake Egan via cfe-commits
Stefan =?utf-8?q?Gränitz?= , Stefan =?utf-8?q?Gränitz?= , Stefan =?utf-8?q?Gränitz?= Message-ID: In-Reply-To: jakeegan wrote: Hi, I see you fixed some tests, but there's still a couple failing on AIX: > Clang :: Interpreter/incremental-mode.cpp > Clang-Unit :: Interpreter/./ClangReplInter

[clang] [Clang][objectsize] Generate object size calculation for sub-objects (PR #86858)

2024-05-29 Thread Bill Wendling via cfe-commits
@@ -1062,6 +1063,159 @@ CodeGenFunction::emitFlexibleArrayMemberSize(const Expr *E, unsigned Type, return Builder.CreateSelect(Cmp, Res, ConstantInt::get(ResType, 0, IsSigned)); } +namespace { + +class ObjectSizeVisitor +: public ConstStmtVisitor { + bool SkipASE; + +

[clang] Use cast_or_null instead of cast (PR #93749)

2024-05-29 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak created https://github.com/llvm/llvm-project/pull/93749 `Eval->Value.get` returns a null pointer when the variable doesn't have an initializer. This fixes https://github.com/llvm/llvm-project/issues/93625. rdar://128482541 >From 4648f46f5e15d5747596347feaef85069a8

[clang] Use cast_or_null instead of cast (PR #93749)

2024-05-29 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Akira Hatanaka (ahatanak) Changes `Eval->Value.get` returns a null pointer when the variable doesn't have an initializer. This fixes https://github.com/llvm/llvm-project/issues/93625. rdar://128482541 --- Full diff: https://github.com/l

[clang] Use cast_or_null instead of cast (PR #93749)

2024-05-29 Thread Akira Hatanaka via cfe-commits
ahatanak wrote: Note that the call to `hasInit` at the beginning of function `VarDecl::getInit` returns true even when the variable doesn't have an initializer if `VarDecl::ensureEvaluatedStmt` is called before that. https://github.com/llvm/llvm-project/pull/93749 _

[clang] ea1ecb5 - Fix test - remove unnecessary/incorrect `-S`, in favor of `-emit-llvm`

2024-05-29 Thread David Blaikie via cfe-commits
Author: David Blaikie Date: 2024-05-29T23:36:43Z New Revision: ea1ecb50fa831583241fc531153bd2c072955d29 URL: https://github.com/llvm/llvm-project/commit/ea1ecb50fa831583241fc531153bd2c072955d29 DIFF: https://github.com/llvm/llvm-project/commit/ea1ecb50fa831583241fc531153bd2c072955d29.diff LOG:

[clang] [llvm] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #81545)

2024-05-29 Thread David Blaikie via cfe-commits
dwblaikie wrote: > There is a broken test in CI: > https://lab.llvm.org/buildbot/#/builders/272/builds/17864 Fixed in ea1ecb50fa831583241fc531153bd2c072955d29 https://github.com/llvm/llvm-project/pull/81545 ___ cfe-commits mailing list cfe-commits@li

[clang] Use cast_or_null instead of cast (PR #93749)

2024-05-29 Thread via cfe-commits
https://github.com/fahadnayyar approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/93749 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Default and Relaxed Availability Diagnostics (PR #92704)

2024-05-29 Thread Chris B via cfe-commits
@@ -1060,18 +1060,25 @@ static llvm::StringRef canonicalizePlatformName(llvm::StringRef Platform) { .Case("ShaderModel", "shadermodel") .Default(Platform); } -static llvm::StringRef getPrettyEnviromentName(llvm::StringRef Environment) { -return ll

[clang] [HLSL] Default and Relaxed Availability Diagnostics (PR #92704)

2024-05-29 Thread Chris B via cfe-commits
https://github.com/llvm-beanz approved this pull request. I have one suggested code simplification which will also require test updates, but in general I think this is good. https://github.com/llvm/llvm-project/pull/92704 ___ cfe-commits mailing list

[clang] Pass LangOpts from CompilerInstance to DependencyScanningWorker (PR #93753)

2024-05-29 Thread Nishith Kumar M Shah via cfe-commits
https://github.com/nishithshah2211 created https://github.com/llvm/llvm-project/pull/93753 This commit fixes https://github.com/llvm/llvm-project/issues/88896 by passing LangOpts from the CompilerInstance to DependencyScanningWorker so that the original LangOpts are preserved/respected. This ma

[clang] Pass LangOpts from CompilerInstance to DependencyScanningWorker (PR #93753)

2024-05-29 Thread via cfe-commits
github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it

[clang] Pass LangOpts from CompilerInstance to DependencyScanningWorker (PR #93753)

2024-05-29 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Nishith Kumar M Shah (nishithshah2211) Changes This commit fixes https://github.com/llvm/llvm-project/issues/88896 by passing LangOpts from the CompilerInstance to DependencyScanningWorker so that the original LangOpts are preserved/respec

[clang] Pass LangOpts from CompilerInstance to DependencyScanningWorker (PR #93753)

2024-05-29 Thread Nishith Kumar M Shah via cfe-commits
nishithshah2211 wrote: @cor3ntin @Sirraide I put up a draft PR to get some feedback and see if the changes here make sense or not. Also tagging @pogo59 since I received good feedback/pointers here: https://discourse.llvm.org/t/looking-for-help-with-accessing-langopts-from-the-actual-compiler-i

[clang] [clang] Lower _BitInt(129+) to a different type in LLVM IR (PR #91364)

2024-05-29 Thread John McCall via cfe-commits
@@ -2012,26 +2015,27 @@ llvm::Value *CodeGenFunction::EmitLoadOfScalar(Address Addr, bool Volatile, } llvm::Value *CodeGenFunction::EmitToMemory(llvm::Value *Value, QualType Ty) { - // Bool has a different representation in memory than in registers. - if (hasBooleanRepresen

[clang] [clang] Lower _BitInt(129+) to a different type in LLVM IR (PR #91364)

2024-05-29 Thread John McCall via cfe-commits
@@ -2012,26 +2015,27 @@ llvm::Value *CodeGenFunction::EmitLoadOfScalar(Address Addr, bool Volatile, } llvm::Value *CodeGenFunction::EmitToMemory(llvm::Value *Value, QualType Ty) { rjmccall wrote: ```suggestion /// Converts a scalar value from its primary IR

[clang] [clang] Lower _BitInt(129+) to a different type in LLVM IR (PR #91364)

2024-05-29 Thread John McCall via cfe-commits
@@ -2044,6 +2048,12 @@ llvm::Value *CodeGenFunction::EmitFromMemory(llvm::Value *Value, QualType Ty) { return emitBoolVecConversion(V, ValNumElems, "extractvec"); } + if (hasBooleanRepresentation(Ty) || Ty->isBitIntType()) { +llvm::Type *ResTy = ConvertType(Ty); +

[clang] [clang] Lower _BitInt(129+) to a different type in LLVM IR (PR #91364)

2024-05-29 Thread John McCall via cfe-commits
@@ -1774,6 +1784,22 @@ llvm::Constant *ConstantEmitter::emitForMemory(CodeGenModule &CGM, return Res; } + if (destType->isBitIntType()) { +if (!CGM.getTypes().LLVMTypeLayoutMatchesAST(destType, C->getType())) { + // Long _BitInt has array of bytes as in-memory

[clang] [clang] Lower _BitInt(129+) to a different type in LLVM IR (PR #91364)

2024-05-29 Thread John McCall via cfe-commits
@@ -5348,18 +5348,8 @@ Value *ScalarExprEmitter::VisitVAArgExpr(VAArgExpr *VE) { return llvm::UndefValue::get(ArgTy); } - // FIXME Volatility. - llvm::Value *Val = Builder.CreateLoad(ArgPtr); - - // If EmitVAArg promoted the type, we must truncate it. - if (ArgTy !=

[clang] [clang] Lower _BitInt(129+) to a different type in LLVM IR (PR #91364)

2024-05-29 Thread John McCall via cfe-commits
@@ -1533,9 +1533,17 @@ void CodeGenFunction::EmitReturnStmt(const ReturnStmt &S) { Builder.CreateStore(Result.getScalarVal(), ReturnValue); } else { switch (getEvaluationKind(RV->getType())) { -case TEK_Scalar: - Builder.CreateStore(EmitScalarExpr(RV), Retur

[clang] [clang] Lower _BitInt(129+) to a different type in LLVM IR (PR #91364)

2024-05-29 Thread John McCall via cfe-commits
@@ -2012,26 +2015,27 @@ llvm::Value *CodeGenFunction::EmitLoadOfScalar(Address Addr, bool Volatile, } llvm::Value *CodeGenFunction::EmitToMemory(llvm::Value *Value, QualType Ty) { - // Bool has a different representation in memory than in registers. - if (hasBooleanRepresen

[clang] [clang] Add another test case for CWG78 (PR #93708)

2024-05-29 Thread via cfe-commits
https://github.com/Sirraide approved this pull request. https://github.com/llvm/llvm-project/pull/93708 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [asan][windows] Eliminate the static asan runtime on windows (PR #81677)

2024-05-29 Thread Charlie Barto via cfe-commits
https://github.com/barcharcraz closed https://github.com/llvm/llvm-project/pull/81677 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] In C++17, callee is guaranteed to be sequenced before arguments. (PR #93623)

2024-05-29 Thread Kefu Chai via cfe-commits
https://github.com/tchaikov updated https://github.com/llvm/llvm-project/pull/93623 >From e9e03e8c07c7b8deaba7ac11a593dfb63b4c9354 Mon Sep 17 00:00:00 2001 From: martinboehme Date: Wed, 29 May 2024 07:23:35 +0800 Subject: [PATCH] [clang-tidy] Let bugprone-use-after-move ignore the moved variab

[clang-tools-extra] [clang-tidy] In C++17, callee is guaranteed to be sequenced before arguments. (PR #93623)

2024-05-29 Thread Kefu Chai via cfe-commits
tchaikov wrote: v2: - s/auto *Member/const auto *Member/ - merge into the existing ReleaseNote entry of the same check, instead of creating another one https://github.com/llvm/llvm-project/pull/93623 ___ cfe-commits mailing list cfe-commits@lists.llv

[clang] [clang-repl] Extend the C support. (PR #89804)

2024-05-29 Thread Jason Molenda via cfe-commits
jasonmolenda wrote: I set aside my current work, updated to current main sources, cherry-picked 253c28fa829cee0104c2fc59ed1a958980b5138c, built it on my macOS system, did `bin/lldb-dotest -p TestImportBuiltinFileID.py` and it crashes like before. I'm not sure what you're asking help with, I do

[clang] ce2927a - [clang] fix printing of canonical template template parameters take 2 (#93448)

2024-05-29 Thread via cfe-commits
Author: Matheus Izvekov Date: 2024-05-29T21:45:01-03:00 New Revision: ce2927a396c506cbf06ea39eff8f226fd8d46b94 URL: https://github.com/llvm/llvm-project/commit/ce2927a396c506cbf06ea39eff8f226fd8d46b94 DIFF: https://github.com/llvm/llvm-project/commit/ce2927a396c506cbf06ea39eff8f226fd8d46b94.dif

[clang] [clang] fix printing of canonical template template parameters take 2 (PR #93448)

2024-05-29 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov closed https://github.com/llvm/llvm-project/pull/93448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] add an option to insert a space only for non-code block empty braces, not for empty parentheses (PR #93634)

2024-05-29 Thread Kohei Asano via cfe-commits
@@ -6237,18 +6237,30 @@ the configuration (without a prefix: ``Auto``). true: false: x = ( int32 )y vs. x = (int32)y - * ``bool InEmptyParentheses`` Put a space in parentheses only if the parentheses are empt

[clang] [clang] CWG150: add tests and change to unreleased (PR #93758)

2024-05-29 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/93758 None >From 834696f9b0a74c5a4c0d261480be6cff71fc91f5 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Wed, 29 May 2024 22:23:01 -0300 Subject: [PATCH] [clang] CWG150: add tests and change to unreleased ---

[clang] [clang] CWG150: add tests and change to unreleased (PR #93758)

2024-05-29 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Matheus Izvekov (mizvekov) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/93758.diff 2 Files Affected: - (modified) clang/test/CXX/drs/cwg1xx.cpp (+40) - (modified) clang/www/cxx_dr_status.html (+1-1) ``di

[clang] [clang-format] add an option to insert a space only for non-code block empty braces, not for empty parentheses (PR #93634)

2024-05-29 Thread Kohei Asano via cfe-commits
@@ -6237,18 +6237,30 @@ the configuration (without a prefix: ``Auto``). true: false: x = ( int32 )y vs. x = (int32)y - * ``bool InEmptyParentheses`` Put a space in parentheses only if the parentheses are empt

[clang] [clang-format] add an option to insert a space only for non-code block empty braces, not for empty parentheses (PR #93634)

2024-05-29 Thread Kohei Asano via cfe-commits
https://github.com/khei4 edited https://github.com/llvm/llvm-project/pull/93634 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 2b1d1c5 - [NFC] Fix PPC buildbot failure https://lab.llvm.org/buildbot/#/builders/230/builds/29066

2024-05-29 Thread Chen Zheng via cfe-commits
Author: Chen Zheng Date: 2024-05-29T21:52:55-04:00 New Revision: 2b1d1c51f6e321267cc86e9db7808298c59caf0e URL: https://github.com/llvm/llvm-project/commit/2b1d1c51f6e321267cc86e9db7808298c59caf0e DIFF: https://github.com/llvm/llvm-project/commit/2b1d1c51f6e321267cc86e9db7808298c59caf0e.diff LO

[clang] [llvm] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #81545)

2024-05-29 Thread Chen Zheng via cfe-commits
chenzheng1030 wrote: PPC buildbot fails at another place with above fix: https://lab.llvm.org/buildbot/#/builders/230/builds/29066 Commit 2b1d1c51f6e321267cc86e9db7808298c59caf0e to fix the failure. https://github.com/llvm/llvm-project/pull/81545 ___

[clang] [Serialization] Check for stack exhaustion when reading declarations (PR #79875)

2024-05-29 Thread Chuanqi Xu via cfe-commits
@@ -9403,6 +9404,20 @@ DiagnosticBuilder ASTReader::Diag(SourceLocation Loc, unsigned DiagID) const { return Diags.Report(Loc, DiagID); } +void ASTReader::warnStackExhausted(SourceLocation Loc) { + // When Sema is available, avoid duplicate errors. This should be rare. ---

[clang] [Serialization] Check for stack exhaustion when reading declarations (PR #79875)

2024-05-29 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. If we don't insist on testing this in this commit, them LGTM. https://github.com/llvm/llvm-project/pull/79875 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-b

[clang] [Serialization] Check for stack exhaustion when reading declarations (PR #79875)

2024-05-29 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 edited https://github.com/llvm/llvm-project/pull/79875 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Use cast_or_null instead of cast (PR #93749)

2024-05-29 Thread Younan Zhang via cfe-commits
@@ -2408,9 +2408,11 @@ Expr *VarDecl::getInit() { return cast(S); auto *Eval = getEvaluatedStmt(); - return cast(Eval->Value.isOffset() -? Eval->Value.get(getASTContext().getExternalSource()) -: Eval->Value.get(nullptr));

[clang] [llvm] [PowerPC] Diagnose musttail instead of crash inside backend (PR #93267)

2024-05-29 Thread Chen Zheng via cfe-commits
@@ -743,6 +743,20 @@ bool Sema::checkMustTailAttr(const Stmt *St, const Attr &MTA) { CallerType.Func = CallerDecl->getType()->getAs(); } + if (Context.getTargetInfo().getTriple().isPPC()) { +if (Context.getTargetInfo().getTriple().isOSAIX()) + return Diag(St->

[clang] [llvm] [PowerPC] Diagnose musttail instead of crash inside backend (PR #93267)

2024-05-29 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 deleted https://github.com/llvm/llvm-project/pull/93267 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [X86] Support EGPR for inline assembly. (PR #92338)

2024-05-29 Thread Freddy Ye via cfe-commits
@@ -57581,6 +57581,14 @@ X86TargetLowering::getConstraintType(StringRef Constraint) const { case '2': return C_RegisterClass; } +case 'j': + switch (Constraint[1]) { + default: +break; + case 'r': + case 'R': +return

[clang] [clang-format] add an option to insert a space only for non-code block empty braces, not for empty parentheses (PR #93634)

2024-05-29 Thread Kohei Asano via cfe-commits
https://github.com/khei4 updated https://github.com/llvm/llvm-project/pull/93634 >From f9022ddba4dd26dea5d04dbcd3c256d2d42b3bad Mon Sep 17 00:00:00 2001 From: Kohei Asano Date: Wed, 29 May 2024 11:40:39 +0900 Subject: [PATCH 1/2] [clang-format] add an option to insert a space only for empty bra

[clang] [llvm] [X86] Support EGPR for inline assembly. (PR #92338)

2024-05-29 Thread Freddy Ye via cfe-commits
@@ -57660,6 +57668,19 @@ X86TargetLowering::getSingleConstraintMatchWeight( break; } break; + case 'j': +if (StringRef(Constraint).size() != 2) + break; +switch (Constraint[1]) { +default: + return CW_Invalid; +case 'r': +case 'R': +

[clang] [llvm] [X86] Support EGPR for inline assembly. (PR #92338)

2024-05-29 Thread Freddy Ye via cfe-commits
@@ -57581,6 +57581,14 @@ X86TargetLowering::getConstraintType(StringRef Constraint) const { case '2': return C_RegisterClass; } +case 'j': + switch (Constraint[1]) { + default: +break; + case 'r': + case 'R': +return

[clang] [clang-format] add an option to insert a space only for non-code block empty braces, not for empty parentheses (PR #93634)

2024-05-29 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 203232ffbd80e9f4631213a3876f14dde155a92d d75153bb6777aacf4f08c2c08eca27646bb08727 --

[clang] [clang-format] add an option to insert a space only for non-code block empty braces, not for empty parentheses (PR #93634)

2024-05-29 Thread Kohei Asano via cfe-commits
https://github.com/khei4 edited https://github.com/llvm/llvm-project/pull/93634 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] New optin.taint.TaintAlloc checker for catching unbounded memory allocation calls (PR #92420)

2024-05-29 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat approved this pull request. LGTM, thanks for the update! https://github.com/llvm/llvm-project/pull/92420 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] add an option to insert a space only for non-code block empty braces, not for empty parentheses (PR #93634)

2024-05-29 Thread Kohei Asano via cfe-commits
@@ -14027,6 +14027,11 @@ TEST_F(FormatTest, LayoutCxx11BraceInitializers) { SpaceBetweenBraces.SpacesInParens = FormatStyle::SIPO_Custom; SpaceBetweenBraces.SpacesInParensOptions.InEmptyParentheses = true; verifyFormat("vector< int > x{ };", SpaceBetweenBraces); + SpaceB

<    1   2   3   4   >