[clang] [clang] Emit @llvm.assume before streaming_compatible functions when the streaming mode is known (PR #121917)

2025-01-16 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: The two issues are sort of tied together: if the intrinsic isn't IntrNoMem, I suspect the assumption cache stops cooperating. But anyway, I guess the question is really whether we want these constructs represented explicitly in IR, to try to leverage the AssumptionCache, o

[clang] [Clang][counted_by] Refactor __builtin_dynamic_object_size on FAMs (PR #122198)

2025-01-15 Thread Eli Friedman via cfe-commits
@@ -1060,236 +1061,358 @@ CodeGenFunction::evaluateOrEmitBuiltinObjectSize(const Expr *E, unsigned Type, return ConstantInt::get(ResType, ObjectSize, /*isSigned=*/true); } -const FieldDecl *CodeGenFunction::FindFlexibleArrayMemberFieldAndOffset( -ASTContext &Ctx, const

[clang] [Clang][counted_by] Refactor __builtin_dynamic_object_size on FAMs (PR #122198)

2025-01-15 Thread Eli Friedman via cfe-commits
@@ -1060,236 +1061,358 @@ CodeGenFunction::evaluateOrEmitBuiltinObjectSize(const Expr *E, unsigned Type, return ConstantInt::get(ResType, ObjectSize, /*isSigned=*/true); } -const FieldDecl *CodeGenFunction::FindFlexibleArrayMemberFieldAndOffset( -ASTContext &Ctx, const

[clang] [llvm] [IR] Don't set strictfp on irrelevant calls (PR #122735)

2025-01-15 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic edited https://github.com/llvm/llvm-project/pull/122735 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [IR] Don't set strictfp on irrelevant calls (PR #122735)

2025-01-15 Thread Eli Friedman via cfe-commits
@@ -86,6 +86,35 @@ IRBuilderBase::createCallHelper(Function *Callee, ArrayRef Ops, return CI; } +CallInst *IRBuilderBase::CreateCall(FunctionType *FTy, Value *Callee, +ArrayRef Args, +ArrayRef OpBundles

[clang] [llvm] [IR] Don't set strictfp on irrelevant calls (PR #122735)

2025-01-15 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic commented: LGTM with one minor comment https://github.com/llvm/llvm-project/pull/122735 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang] Add API to query more information about base classes. (PR #120300)

2025-01-14 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: The 32-bit Arm failures are fixed by 7aec7caca30f800811b76ba94291645494788a4f . The other failures appear to be unrelated. https://github.com/llvm/llvm-project/pull/120300 ___ cfe-commits mailing list cfe-commits@lists.llvm.org h

[clang] 7aec7ca - Add explicit triple to test_type.py.

2025-01-14 Thread Eli Friedman via cfe-commits
Author: Eli Friedman Date: 2025-01-14T14:49:45-08:00 New Revision: 7aec7caca30f800811b76ba94291645494788a4f URL: https://github.com/llvm/llvm-project/commit/7aec7caca30f800811b76ba94291645494788a4f DIFF: https://github.com/llvm/llvm-project/commit/7aec7caca30f800811b76ba94291645494788a4f.diff

[clang] [llvm] [clang] Implement pragma clang section on COFF targets (PR #112714)

2025-01-14 Thread Eli Friedman via cfe-commits
@@ -1,4 +1,5 @@ ;RUN: llc -mtriple=armv7-eabi %s -o - | FileCheck %s +;RUN: llc -mtriple=armv7-msvc %s -o - | FileCheck %s efriedma-quic wrote: That's fine. But the CHECK lines in the new test don't look right (`nobits` etc. are ELF-specific). https://github.

[clang] [llvm] [IR] Don't set strictfp on irrelevant calls (PR #122735)

2025-01-14 Thread Eli Friedman via cfe-commits
@@ -66,6 +66,12 @@ bool IntrinsicInst::mayLowerToFunctionCall(Intrinsic::ID IID) { } } +bool IntrinsicInst::canAccessFPEnvironment(LLVMContext &C, Intrinsic::ID IID) { + AttributeList Attrs = Intrinsic::getAttributes(C, IID); + MemoryEffects ME = Attrs.getMemoryEffects();

[clang] [clang] Implement gcc_struct attribute on Itanium targets (PR #71148)

2025-01-13 Thread Eli Friedman via cfe-commits
@@ -997,6 +997,9 @@ def warn_npot_ms_struct : Warning< "data types with sizes that aren't a power of two">, DefaultError, InGroup; +def err_itanium_layout_unimplemented : Error< + "Itanium-compatible layout for the Microsoft C++ ABI is not yet supported">; ---

[clang] [clang] Implement gcc_struct attribute on Itanium targets (PR #71148)

2025-01-13 Thread Eli Friedman via cfe-commits
@@ -0,0 +1,18 @@ +// RUN: %clang_cc1 -emit-llvm-only -triple x86_64-pc-linux-gnu %s +// RUN: %clang_cc1 -emit-llvm-only -triple x86_64-pc-linux-gnu -fms-layout-compatibility=microsoft %s +// RUN: %clang_cc1 -emit-llvm-only -triple x86_64-pc-windows-gnu %s +// RUN: %clang_cc1 -emi

[clang] [llvm] [IR] Don't set strictfp on irrelevant calls (PR #122735)

2025-01-13 Thread Eli Friedman via cfe-commits
@@ -66,6 +66,17 @@ bool IntrinsicInst::mayLowerToFunctionCall(Intrinsic::ID IID) { } } +bool IntrinsicInst::canAccessFPEnvironment(Intrinsic::ID IID) { + switch (IID) { +#define DAG_INSTRUCTION(NAME, NARG, ROUND_MODE, INTRINSIC, DAGN) \ +case Intrinsic::INTR

[clang] [compiler-rt] [llvm] [ASan] Add metadata to renamed instructions so ASan doesn't use the i… (PR #119387)

2025-01-10 Thread Eli Friedman via cfe-commits
@@ -137,6 +137,10 @@ llvm::AllocaInst *CodeGenFunction::CreateTempAlloca(llvm::Type *Ty, Alloca = new llvm::AllocaInst(Ty, CGM.getDataLayout().getAllocaAddrSpace(), ArraySize, Name, AllocaInsertPt->getIterator()); + if (Alloca->getName

[clang] [llvm] [mlir] [IR][ModRef] Introduce `errno` memory location (PR #120783)

2025-01-10 Thread Eli Friedman via cfe-commits
@@ -82,7 +82,7 @@ define void @test_store(ptr %p) { @G = external global ptr define i8 @test_store_capture(ptr %p) { -; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: read, inaccessiblemem: none) +; FNATTRS: Functio

[clang] [llvm] [mlir] [IR][ModRef] Introduce `errno` memory location (PR #120783)

2025-01-10 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic edited https://github.com/llvm/llvm-project/pull/120783 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [IR][ModRef] Introduce `errno` memory location (PR #120783)

2025-01-10 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic commented: This seems like roughly what I expected from the proposal. https://github.com/llvm/llvm-project/pull/120783 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

[clang] [libclang] Add API to query more information about base classes. (PR #120300)

2025-01-10 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: Addressed review comments https://github.com/llvm/llvm-project/pull/120300 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang] Add API to query more information about base classes. (PR #120300)

2025-01-10 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic updated https://github.com/llvm/llvm-project/pull/120300 >From 12ad982b984a4e533db4220332f6edbf4b4903a2 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Tue, 10 Dec 2024 15:23:55 -0800 Subject: [PATCH] [cindex] Add API to query more information about base clas

[clang] [libclang] Add API to query more information about base classes. (PR #120300)

2025-01-10 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic updated https://github.com/llvm/llvm-project/pull/120300 >From ff0f4b551de077ee07331ed30410b102abb06c09 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Tue, 10 Dec 2024 15:23:55 -0800 Subject: [PATCH] [cindex] Add API to query more information about base clas

[clang] [libclang] Add API to query more information about base classes. (PR #120300)

2025-01-10 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic updated https://github.com/llvm/llvm-project/pull/120300 >From 0d4bcf69c57457ba79af9069ae60c6de8ee45498 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Tue, 10 Dec 2024 15:23:55 -0800 Subject: [PATCH] [cindex] Add API to query more information about base clas

[clang] [libclang] Allow using PrintingPolicy with types (PR #122386)

2025-01-10 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic closed https://github.com/llvm/llvm-project/pull/122386 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add -fwrapv-pointer flag (PR #122486)

2025-01-10 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: I'm tempted to say we should just treat -fwrapv/-fwrapv-pointer/-fno-strict-overflow as aliases for each other. I don't think anyone using -fwrapv is going to be happy that we're turning on overflow optimizations. https://github.com/llvm/llvm-project/pull/122486

[clang] [libclang] Allow using PrintingPolicy with types (PR #122386)

2025-01-10 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic updated https://github.com/llvm/llvm-project/pull/122386 >From 2f6e9acc324802854132ff1b48693a47a8466fa4 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Tue, 17 Dec 2024 17:46:09 -0800 Subject: [PATCH] [libclang] Allow using PrintingPolicy with types This allo

[clang] [libclang] Add API to query more information about base classes. (PR #120300)

2025-01-10 Thread Eli Friedman via cfe-commits
@@ -3771,6 +3771,12 @@ CINDEX_LINKAGE enum CXRefQualifierKind clang_Type_getCXXRefQualifier(CXType T); */ CINDEX_LINKAGE unsigned clang_isVirtualBase(CXCursor); +/** + * Returns the offset in bits of a CX_CXXBaseSpecifier relative to the parent + * class. + */ +CINDEX_LINKAG

[clang] [AArch64][Clang] Add support for __arm_agnostic("sme_za_state") (PR #121788)

2025-01-10 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/121788 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang] Allow using PrintingPolicy with types (PR #122386)

2025-01-09 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic updated https://github.com/llvm/llvm-project/pull/122386 >From 0557238b725ecf3554f91ef264d710ff841fd1e1 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Tue, 17 Dec 2024 17:46:09 -0800 Subject: [PATCH] [libclang] Allow using PrintingPolicy with types This allo

[clang] [libclang] Allow using PrintingPolicy with types (PR #122386)

2025-01-09 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic created https://github.com/llvm/llvm-project/pull/122386 This allows controlling pretty-printing of types the same way it works with cursors. >From a96fbe38f697f77c12c712f5573c2158072a8d2f Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Tue, 17 Dec 2024 17:4

[clang] [libclang] Add API to query more information about base classes. (PR #120300)

2025-01-09 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic updated https://github.com/llvm/llvm-project/pull/120300 >From 448537876f4377686847120a923dd9d443f7d556 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Tue, 10 Dec 2024 15:23:55 -0800 Subject: [PATCH] [cindex] Add API to query more information about base clas

[clang] [libclang/python] Add python bindings for PrintingPolicy (PR #120494)

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

[clang] [libclang/python] Add python bindings for PrintingPolicy (PR #120494)

2025-01-09 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: Oh, looks like that fixed it, thanks. https://github.com/llvm/llvm-project/pull/120494 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [llvm] [ASan] Add metadata to renamed instructions so ASan doesn't use the i… (PR #119387)

2025-01-09 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic edited https://github.com/llvm/llvm-project/pull/119387 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [llvm] [ASan] Add metadata to renamed instructions so ASan doesn't use the i… (PR #119387)

2025-01-09 Thread Eli Friedman via cfe-commits
@@ -137,6 +137,10 @@ llvm::AllocaInst *CodeGenFunction::CreateTempAlloca(llvm::Type *Ty, Alloca = new llvm::AllocaInst(Ty, CGM.getDataLayout().getAllocaAddrSpace(), ArraySize, Name, AllocaInsertPt->getIterator()); + if (Alloca->getName

[clang] [clang-tools-extra] Remove `StringLiteral` in favor of `StringRef` (PR #122366)

2025-01-09 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: For reference, when it was added, the important thing about StringLiteral was that it had a constexpr constructor. The StringRef constructor became constexpr with 57effbdadc0b382db4ef86addcfd03a64c9eda0a, a few years after StringLiteral was added. https://github.com/llvm

[clang] Remove the `CustomEntry` escape hatch from builtin TableGen (PR #120861)

2025-01-08 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/120861 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [Clang] Adjust pointer-overflow sanitizer for N3322 (PR #120719)

2025-01-08 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic approved this pull request. LGTM I don't see any reason to mess with the runtime bits: we try to keep them stable where we can. https://github.com/llvm/llvm-project/pull/120719 ___ cfe-commits mailing list cfe-commits

[clang] Allow packing fields into tail padding of record fields (PR #122197)

2025-01-08 Thread Eli Friedman via cfe-commits
@@ -803,10 +804,16 @@ bool ConstStructBuilder::Build(const InitListExpr *ILE, bool AllowOverwrite) { if (!AppendField(Field, Layout.getFieldOffset(FieldNo), EltInit, AllowOverwrite)) return false; - // After emitting a non-empty field

[clang] Allow packing fields into tail padding of record fields (PR #122197)

2025-01-08 Thread Eli Friedman via cfe-commits
@@ -389,14 +389,28 @@ void CGRecordLowering::accumulateFields(bool isNonVirtualBaseType) { // Empty fields have no storage. ++Field; } else { - // Use base subobject layout for the potentially-overlapping field, - // as it is done in RecordLayoutBuild

[clang] Allow packing fields into tail padding of record fields (PR #122197)

2025-01-08 Thread Eli Friedman via cfe-commits
@@ -389,14 +389,28 @@ void CGRecordLowering::accumulateFields(bool isNonVirtualBaseType) { // Empty fields have no storage. ++Field; } else { - // Use base subobject layout for the potentially-overlapping field, - // as it is done in RecordLayoutBuild

[clang] [compiler-rt] [llvm] [SystemZ] Add support for half (fp16) (PR #109164)

2025-01-08 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: I think you need to do some target-specific stuff to get the builtins library to build... see, for example, https://reviews.llvm.org/D42958 . https://github.com/llvm/llvm-project/pull/109164 ___ cfe-commits mailing list cfe-commit

[clang] [libclang/python] Add python bindings for PrintingPolicy (PR #120494)

2025-01-08 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: Still failing the same way. Should I go ahead and merge anyway, or is there someone who can look into this? https://github.com/llvm/llvm-project/pull/120494 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llv

[clang] [libclang/python] Add python bindings for PrintingPolicy (PR #120494)

2025-01-08 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic updated https://github.com/llvm/llvm-project/pull/120494 >From 13a9c0b88afae7a5f48a66e86357f7284fdace95 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Tue, 17 Dec 2024 15:25:00 -0800 Subject: [PATCH] [libclang/python] Add python bindings for PrintingPolicy T

[clang] [compiler-rt] [llvm] [ASan] Add metadata to renamed instructions so ASan doesn't use the i… (PR #119387)

2025-01-08 Thread Eli Friedman via cfe-commits
@@ -137,6 +137,10 @@ llvm::AllocaInst *CodeGenFunction::CreateTempAlloca(llvm::Type *Ty, Alloca = new llvm::AllocaInst(Ty, CGM.getDataLayout().getAllocaAddrSpace(), ArraySize, Name, AllocaInsertPt->getIterator()); + if (Alloca->getName

[clang] [clang] Restrict use of scalar types in vector builtins (PR #119423)

2025-01-08 Thread Eli Friedman via cfe-commits
@@ -14604,57 +14611,63 @@ bool Sema::PrepareBuiltinElementwiseMathOneArgCall(CallExpr *TheCall) { } bool Sema::BuiltinElementwiseMath(CallExpr *TheCall, bool FPOnly) { - QualType Res; - if (BuiltinVectorMath(TheCall, Res, FPOnly)) -return true; - TheCall->setType(Res);

[clang] [clang] Restrict use of scalar types in vector builtins (PR #119423)

2025-01-08 Thread Eli Friedman via cfe-commits
@@ -14585,11 +14585,18 @@ void Sema::CheckAddressOfPackedMember(Expr *rhs) { _2, _3, _4)); } +static ExprResult UsualUnaryConversionsNoPromoteInt(Sema &S, Expr *E) { + // Don't promote integer types + if (QualType Ty = E->getType(); S.getASTContext().is

[clang] [compiler-rt] [llvm] [SystemZ] Add support for half (fp16) (PR #109164)

2025-01-08 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: I think you're looking for -DLLVM_RUNTIME_TARGETS ? https://github.com/llvm/llvm-project/pull/109164 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Emit @llvm.assume before streaming_compatible functions when the streaming mode is known (PR #121917)

2025-01-08 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: > However what we want to achieve with this is to make the state of the > streaming mode known to potentially inlineable called functions, allowing for > further inlining and identification/removal of dead code It seems like we're in agreement that the llvm.assume doesn't

[clang] [clang] Emit @llvm.assume when we know the streaming mode of the function (PR #121917)

2025-01-07 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: I really don't see why we'd want to implement the optimization this way; can't we just add an instcombine for calls to `llvm.aarch64.sme.in.streaming.mode`? https://github.com/llvm/llvm-project/pull/121917 ___ cfe-commits mailing

[clang] [libclang/python] Add python bindings for PrintingPolicy (PR #120494)

2025-01-06 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: @DeinAlptraum any idea why the Python tests are failing? https://github.com/llvm/llvm-project/pull/120494 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix crashes when passing VLA to va_arg (PR #119563)

2025-01-06 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/119563 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Restrict use of scalar types in vector builtins (PR #119423)

2025-01-06 Thread Eli Friedman via cfe-commits
@@ -14585,11 +14585,18 @@ void Sema::CheckAddressOfPackedMember(Expr *rhs) { _2, _3, _4)); } +static ExprResult UsualUnaryConversionsNoPromoteInt(Sema &S, Expr *E) { + // Don't promote integer types + if (QualType Ty = E->getType(); S.getASTContext().is

[clang] [libclang] Add API to query more information about base classes. (PR #120300)

2025-01-06 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: I think the relevant code that prevents visiting template instantiations is CursorVisitor::VisitClassTemplateSpecializationDecl. It intentionally skips implicit template instantiations, I guess because of the origin of the API, which was focused around code written by the

[clang] [libclang/python] Add python bindings for PrintingPolicy (PR #120494)

2025-01-06 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic updated https://github.com/llvm/llvm-project/pull/120494 >From 13a9c0b88afae7a5f48a66e86357f7284fdace95 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Tue, 17 Dec 2024 15:25:00 -0800 Subject: [PATCH] [libclang/python] Add python bindings for PrintingPolicy T

[clang] [libclang/python] Add python binding for clang_Cursor_isAnonymousRecordDecl (PR #120483)

2025-01-06 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic closed https://github.com/llvm/llvm-project/pull/120483 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Return larger CXX records in memory (PR #120670)

2024-12-20 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: Missing regression test in clang/test/CodeGen. We probably want a release note for this (clang/docs/ReleaseNotes.rst). (If you're interested, there's another x86-64 ABI bug which nobody got around to fixing: #76017.) https://github.com/llvm/llvm-project/pull/120670 __

[clang] [AArch64] Fix argument passing for SVE tuples (PR #118961)

2024-12-20 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic approved this pull request. LGTM I somehow thought you could use arm_sve_vector_bits with tuples, but I guess not. https://github.com/llvm/llvm-project/pull/118961 ___ cfe-commits mailing list cfe-commits@lists.llvm.o

[clang] [libclang/python] Add python bindings for PrintingPolicy (PR #120494)

2024-12-19 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic updated https://github.com/llvm/llvm-project/pull/120494 >From 13a9c0b88afae7a5f48a66e86357f7284fdace95 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Tue, 17 Dec 2024 15:25:00 -0800 Subject: [PATCH] [libclang/python] Add python bindings for PrintingPolicy T

[clang] [libclang/python] Add python binding for clang_Cursor_isAnonymousRecordDecl (PR #120483)

2024-12-19 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic updated https://github.com/llvm/llvm-project/pull/120483 >From ba71a3ddba2ab2f816c6285614aa04ae2614e672 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Wed, 18 Dec 2024 13:55:40 -0800 Subject: [PATCH] [cindex] Add python binding for clang_Cursor_isAnonymousRe

[clang] [libclang] Add API to query more information about base classes. (PR #120300)

2024-12-19 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic updated https://github.com/llvm/llvm-project/pull/120300 >From 448537876f4377686847120a923dd9d443f7d556 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Tue, 10 Dec 2024 15:23:55 -0800 Subject: [PATCH] [cindex] Add API to query more information about base clas

[clang] [libclang] Add API to query more information about base classes. (PR #120300)

2024-12-19 Thread Eli Friedman via cfe-commits
@@ -2663,6 +2671,21 @@ def visitor(field, children): conf.lib.clang_Type_visitFields(self, fields_visit_callback(visitor), fields) return iter(fields) +def get_bases(self): +"""Return an iterator for accessing the base classes of this type.""" + +

[clang] [libclang/python] Add python binding for clang_Cursor_isAnonymousRecordDecl (PR #120483)

2024-12-19 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic updated https://github.com/llvm/llvm-project/pull/120483 >From 226718966fdbd517f288ce6e4de11cde0aa634cc Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Wed, 18 Dec 2024 13:55:40 -0800 Subject: [PATCH] [cindex] Add python binding for clang_Cursor_isAnonymousRe

[clang] [libclang/python] Add python binding for clang_Cursor_isAnonymousRecordDecl (PR #120483)

2024-12-19 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic updated https://github.com/llvm/llvm-project/pull/120483 >From 4a525f61f9b67fcd887ed64a8c80521f7a21016d Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Wed, 18 Dec 2024 13:55:40 -0800 Subject: [PATCH] [cindex] Add python binding for clang_Cursor_isAnonymousRe

[clang] [libclang/python] Add python binding for clang_Cursor_isAnonymousRecordDecl (PR #120483)

2024-12-19 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic edited https://github.com/llvm/llvm-project/pull/120483 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Add python bindings for PrintingPolicy (PR #120494)

2024-12-19 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic edited https://github.com/llvm/llvm-project/pull/120494 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Add python bindings for PrintingPolicy (PR #120494)

2024-12-19 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic updated https://github.com/llvm/llvm-project/pull/120494 >From 4de2bf3b617538fbc299d5f84d8a8e17d3ff5072 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Tue, 17 Dec 2024 15:25:00 -0800 Subject: [PATCH] [libclang/python] Add python bindings for PrintingPolicy T

[clang] Patch series to reapply #118734 and substantially improve it (PR #120534)

2024-12-19 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic edited https://github.com/llvm/llvm-project/pull/120534 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Patch series to reapply #118734 and substantially improve it (PR #120534)

2024-12-19 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic edited https://github.com/llvm/llvm-project/pull/120534 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Patch series to reapply #118734 and substantially improve it (PR #120534)

2024-12-19 Thread Eli Friedman via cfe-commits
@@ -100,10 +244,17 @@ class Context { /// Return the identifier name for the specified builtin, /// e.g. "__builtin_abs". - llvm::StringRef getName(unsigned ID) const { return getRecord(ID).Name; } + std::string getName(unsigned ID) const; efriedma-quic

[clang] Patch series to reapply #118734 and substantially improve it (PR #120534)

2024-12-19 Thread Eli Friedman via cfe-commits
@@ -100,10 +244,17 @@ class Context { /// Return the identifier name for the specified builtin, /// e.g. "__builtin_abs". - llvm::StringRef getName(unsigned ID) const { return getRecord(ID).Name; } + std::string getName(unsigned ID) const; + + /// Return the identifier

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

2024-12-18 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/114217 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Add python bindings for PrintingPolicy (PR #120494)

2024-12-18 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic updated https://github.com/llvm/llvm-project/pull/120494 >From ec604efdae3e05bf14ade994cbc7d0f1acebd1c6 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Tue, 17 Dec 2024 15:25:00 -0800 Subject: [PATCH] [libclang/python] Add python bindings for PrintingPolicy -

[clang] [libclang/python] Add python bindings for PrintingPolicy (PR #120494)

2024-12-18 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic created https://github.com/llvm/llvm-project/pull/120494 None >From 8f2e784333ed7cdd746dd408b18c2f12297378fe Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Tue, 17 Dec 2024 15:25:00 -0800 Subject: [PATCH] [libclang/python] Add python bindings for PrintingPol

[clang] [CIR] floating-point, pointer, and function types (PR #120484)

2024-12-18 Thread Eli Friedman via cfe-commits
@@ -129,4 +130,224 @@ def PrimitiveInt : AnyTypeOf<[UInt8, UInt16, UInt32, UInt64, SInt8, SInt16, SInt32, SInt64], "primitive int", "::cir::IntType">; +//===--===// +// FloatType +//===

[clang] [libclang/python] Add python binding for clang_Cursor_isAnonymousRecordDecl (PR #120483)

2024-12-18 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic edited https://github.com/llvm/llvm-project/pull/120483 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang] Add API to query more information about base classes. (PR #120300)

2024-12-18 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic edited https://github.com/llvm/llvm-project/pull/120300 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [cindex] Add python binding for clang_Cursor_isAnonymousRecordDecl (PR #120483)

2024-12-18 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic created https://github.com/llvm/llvm-project/pull/120483 None >From 16e84acd0e86bf2653d4b3fa132bcf661a34e62f Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Wed, 18 Dec 2024 13:55:40 -0800 Subject: [PATCH] [cindex] Add python binding for clang_Cursor_isAnony

[clang] [clang] Restrict use of scalar types in vector builtins (PR #119423)

2024-12-18 Thread Eli Friedman via cfe-commits
@@ -14585,11 +14585,18 @@ void Sema::CheckAddressOfPackedMember(Expr *rhs) { _2, _3, _4)); } +static ExprResult UsualUnaryConversionsNoPromoteInt(Sema &S, Expr *E) { + // Don't promote integer types + if (QualType Ty = E->getType(); S.getASTContext().is

[clang] [clang] Restrict use of scalar types in vector builtins (PR #119423)

2024-12-18 Thread Eli Friedman via cfe-commits
@@ -68,15 +66,18 @@ void test_builtin_elementwise_add_sat(float f1, float f2, double d1, double d2, long long int i2, si8 vi1, si8 vi2, unsigned u1, unsigned u2, u4 vu1, u4 vu2,

[clang] [clang] Restrict use of scalar types in vector builtins (PR #119423)

2024-12-18 Thread Eli Friedman via cfe-commits
@@ -14604,57 +14611,63 @@ bool Sema::PrepareBuiltinElementwiseMathOneArgCall(CallExpr *TheCall) { } bool Sema::BuiltinElementwiseMath(CallExpr *TheCall, bool FPOnly) { - QualType Res; - if (BuiltinVectorMath(TheCall, Res, FPOnly)) -return true; - TheCall->setType(Res);

[clang] [Clang] Re-write codegen for atomic_test_and_set and atomic_clear (PR #120449)

2024-12-18 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/120449 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Re-write codegen for atomic_test_and_set and atomic_clear (PR #120449)

2024-12-18 Thread Eli Friedman via cfe-commits
@@ -1977,15 +1977,15 @@ def AtomicNandFetch : AtomicBuiltin { let Prototype = "void(...)"; } -def AtomicTestAndSet : Builtin { +def AtomicTestAndSet : AtomicBuiltin { let Spellings = ["__atomic_test_and_set"]; - let Attributes = [NoThrow]; + let Attributes = [NoThrow, C

[clang] [Clang] Re-write codegen for atomic_test_and_set and atomic_clear (PR #120449)

2024-12-18 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic edited https://github.com/llvm/llvm-project/pull/120449 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [cindex] Add API to query more information about base classes. (PR #120300)

2024-12-17 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic created https://github.com/llvm/llvm-project/pull/120300 The first API is clang_visitCXXBaseClasses: this allows visiting the base classes without going through the generic child visitor (which is awkward, and doesn't work for template instantiations). The sec

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

2024-12-16 Thread Eli Friedman via cfe-commits
@@ -5272,8 +5272,11 @@ bool Sema::BuiltinAssumeAligned(CallExpr *TheCall) { { ExprResult FirstArgResult = DefaultFunctionArrayLvalueConversion(FirstArg); -if (checkBuiltinArgument(*this, TheCall, 0)) efriedma-quic wrote: Took another look at

[clang] [AArch64] Fix argument passing for SVE tuples (PR #118961)

2024-12-16 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: Please add a test for a struct containing an SVE tuple. https://github.com/llvm/llvm-project/pull/118961 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix crashes when passing VLA to va_arg (PR #119563)

2024-12-13 Thread Eli Friedman via cfe-commits
@@ -20,4 +20,7 @@ void vla(int n, ...) __builtin_va_list ap; void *p; p = __builtin_va_arg(ap, typeof (int (*)[++n])); // CHECK: add nsw i32 {{.*}}, 1 + // Don't crash on some undefined behaviors. + p = __builtin_va_arg(ap, typeof (int [++n])); // expected-warning{{sec

[clang] [clang] Fix crashes when passing VLA to va_arg (PR #119563)

2024-12-13 Thread Eli Friedman via cfe-commits
@@ -16538,6 +16538,13 @@ ExprResult Sema::BuildVAArgExpr(SourceLocation BuiltinLoc, << TInfo->getTypeLoc().getSourceRange(); } +if (TInfo->getType()->isVariableArrayType()) { efriedma-quic wrote: This should check for any array type; the issu

[clang] [clang] Fix crashes when passing VLA to va_arg (PR #119563)

2024-12-13 Thread Eli Friedman via cfe-commits
@@ -6121,6 +6121,8 @@ RValue CodeGenFunction::EmitVAArg(VAArgExpr *VE, Address &VAListAddr, VAListAddr = VE->isMicrosoftABI() ? EmitMSVAListRef(VE->getSubExpr()) : EmitVAListRef(VE->getSubExpr()); QualType Ty = VE->getType(); + if (Ty->

[clang] [Clang][Xtensa] Add Xtensa target. (PR #118008)

2024-12-13 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic edited https://github.com/llvm/llvm-project/pull/118008 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Xtensa] Add Xtensa target. (PR #118008)

2024-12-13 Thread Eli Friedman via cfe-commits
@@ -0,0 +1,112 @@ +//===--- Xtensa.h - Declare Xtensa target feature support ---*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE

[clang] [Clang][Xtensa] Add Xtensa target. (PR #118008)

2024-12-13 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic approved this pull request. LGTM with one very minor comment https://github.com/llvm/llvm-project/pull/118008 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[clang] [clang] Fix sub-integer __builtin_elementwise_(add|sub)_sat (PR #119423)

2024-12-13 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: If people aren't using the edge cases, they won't notice if we start error'ing out. If they are, it's pretty easy to adapt the code to build with both old and new compilers. A quick GitHub search shows exactly one user of the builtins outside of clang itself, and that co

[clang] [clang] Generate appropriate assume in presence of libc's memcpy (PR #119704)

2024-12-13 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: On the clang side, we've intentionally ignored the nonnull marking on memcpy and friends for a long time; we made a decision a few years back the optimization wasn't worthwhile compared to the security risk. The updated patch doesn't do anything useful; we can prove the po

[clang] [clang] Recover necessary AddrSpaceCast (PR #119246)

2024-12-13 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: The function in question is part of the Itanium C++ ABI; the ABI itself doesn't say anything about address-spaces, so by default we assume everything related to the C++ ABI is in the flat address-space. If we start messing with that, we'll need to write a specification so

[clang] [clang] Fix crashes when passing VLA to va_arg (PR #119563)

2024-12-11 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: C standard rules for va_arg: "[...] if *type* is not compatible with the type of the actual next argument [...], the behavior is undefined [...]". A struct is never compatible with an array, so yes , it's undefined. (See 6.2.7 for what constitutes a "compatible type".)

[clang] [Clang][Xtensa] Add Xtensa target. (PR #118008)

2024-12-11 Thread Eli Friedman via cfe-commits
@@ -0,0 +1,62 @@ +//===--- Xtensa.cpp - Implement Xtensa target feature support -===// +// +// The LLVM Compiler Infrastructure +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.

[clang] [Clang][AArch64] Allow FP8 Neon vector types to be used by __builtin_shufflevector (PR #119031)

2024-12-11 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: My concern here is there's a tradeoff: there's less complexity constructing the type, maybe, but as a result you've scattered checks all over the code for a type that's basically the same as a VectorType. At first glance, this doesn't seem like the right tradeoff. https:

[clang] [clang] Fix sub-integer __builtin_elementwise_(add|sub)_sat (PR #119423)

2024-12-11 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: Even with this fix, the behavior with mixed types still seems really confusing, especially if you mix signed/unsigned inputs. Can we address that somehow? https://github.com/llvm/llvm-project/pull/119423 ___ cfe-commits mailing l

[clang] [clang] Fix crashes when passing VLA to va_arg (PR #119563)

2024-12-11 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: Please add a testcase to clang/test/CodeGen/ . Put it in an existing file if there's already some related test. (See also https://llvm.org/docs/Contributing.html#how-to-submit-a-patch ) I don't think EmitAggregateCopy is the right place to call EmitVariablyModifiedType:

[clang] [Clang][Xtensa] Add Xtensa target. (PR #118008)

2024-12-10 Thread Eli Friedman via cfe-commits
@@ -0,0 +1,141 @@ +//===--- Xtensa.h - Declare Xtensa target feature support ---*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE

  1   2   3   4   5   6   7   8   9   10   >