[clang] [llvm] [Pipelines] Do not run CoroSplit and CoroCleanup in LTO pre-link pipeline (PR #90310)

2024-05-14 Thread Reid Kleckner via cfe-commits
rnk wrote: To be clear, you can repro the issue with the test case you have, just add `-fsanitize=address` to flags to repro. https://github.com/llvm/llvm-project/pull/90310 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[clang] [llvm] demangle function names in trace files (PR #87626)

2024-08-02 Thread Reid Kleckner via cfe-commits
rnk wrote: Are we sure we want this behavior? Demangling is really expensive. A user noticed a significant (10%) compile time regression from this change. We could skip the demangling and do it offline. It's also worth pointing out that we have to redo this work every time we optimize the same

[clang] [llvm] demangle function names in trace files (PR #87626)

2024-08-06 Thread Reid Kleckner via cfe-commits
rnk wrote: I think I'll leave this change in and file an issue about it. A 10% compile time regression with `-ftime-trace` isn't great, but it doesn't feel revert-worthy. https://github.com/llvm/llvm-project/pull/87626 ___ cfe-commits mailing list cf

[clang] cd37594 - Fix unused lambda capture warning, NFC

2022-02-23 Thread Reid Kleckner via cfe-commits
Author: Reid Kleckner Date: 2022-02-23T14:01:01-08:00 New Revision: cd37594c0374f287318d47818cc6d55496d3e9c0 URL: https://github.com/llvm/llvm-project/commit/cd37594c0374f287318d47818cc6d55496d3e9c0 DIFF: https://github.com/llvm/llvm-project/commit/cd37594c0374f287318d47818cc6d55496d3e9c0.diff

[clang] 1d1b089 - Fix more unused lambda capture warnings, NFC

2022-02-23 Thread Reid Kleckner via cfe-commits
Author: Reid Kleckner Date: 2022-02-23T14:07:04-08:00 New Revision: 1d1b089c5d503e2fc8697887411730105f66c774 URL: https://github.com/llvm/llvm-project/commit/1d1b089c5d503e2fc8697887411730105f66c774 DIFF: https://github.com/llvm/llvm-project/commit/1d1b089c5d503e2fc8697887411730105f66c774.diff

Re: [clang] 1d1b089 - Fix more unused lambda capture warnings, NFC

2022-02-28 Thread Reid Kleckner via cfe-commits
never > type erased/put in a std::function or equivalent). Avoids assert/non-assert > unused issues, having to maintain/update the list when the code changes and > makes a capture live/dead/etc. > > On Wed, Feb 23, 2022 at 2:09 PM Reid Kleckner via cfe-commits < > cfe-commits@lists.llvm.o

[clang] 6d78c38 - Move Sema's key function around and add more comments

2021-04-26 Thread Reid Kleckner via cfe-commits
Author: Reid Kleckner Date: 2021-04-26T18:32:50-07:00 New Revision: 6d78c38986fa0974ea0b37e66f8cb89b256f4e0d URL: https://github.com/llvm/llvm-project/commit/6d78c38986fa0974ea0b37e66f8cb89b256f4e0d DIFF: https://github.com/llvm/llvm-project/commit/6d78c38986fa0974ea0b37e66f8cb89b256f4e0d.diff

[clang] c4adc49 - [SEH] Fix regression with SEH in noexpect functions

2021-05-07 Thread Reid Kleckner via cfe-commits
Author: Olivier Goffart Date: 2021-05-07T13:27:59-07:00 New Revision: c4adc49a1c988e6ea8a340b6245525ef5599812c URL: https://github.com/llvm/llvm-project/commit/c4adc49a1c988e6ea8a340b6245525ef5599812c DIFF: https://github.com/llvm/llvm-project/commit/c4adc49a1c988e6ea8a340b6245525ef5599812c.dif

[clang] ad55d5c - Simplify vectorcall argument classification of HVAs, NFC

2021-01-07 Thread Reid Kleckner via cfe-commits
Author: Reid Kleckner Date: 2021-01-07T11:14:18-08:00 New Revision: ad55d5c3f32f6598f8ac30b68f4961d82cdb1fed URL: https://github.com/llvm/llvm-project/commit/ad55d5c3f32f6598f8ac30b68f4961d82cdb1fed DIFF: https://github.com/llvm/llvm-project/commit/ad55d5c3f32f6598f8ac30b68f4961d82cdb1fed.diff

[clang] 6f69f2e - Consider ASan messages interesting for creduce

2021-01-19 Thread Reid Kleckner via cfe-commits
Author: Reid Kleckner Date: 2021-01-19T11:15:02-08:00 New Revision: 6f69f2ed61ae805df496fc86ef22e7685573d556 URL: https://github.com/llvm/llvm-project/commit/6f69f2ed61ae805df496fc86ef22e7685573d556 DIFF: https://github.com/llvm/llvm-project/commit/6f69f2ed61ae805df496fc86ef22e7685573d556.diff

[clang] e678656 - Add bounds checking assertions to APValue, NFC

2021-01-19 Thread Reid Kleckner via cfe-commits
Author: Reid Kleckner Date: 2021-01-19T11:15:02-08:00 New Revision: e678656625a3e2b6a5f2849f4a6f7612ceeaed07 URL: https://github.com/llvm/llvm-project/commit/e678656625a3e2b6a5f2849f4a6f7612ceeaed07 DIFF: https://github.com/llvm/llvm-project/commit/e678656625a3e2b6a5f2849f4a6f7612ceeaed07.diff

[clang] 955dc34 - Fix TargetRegistry shlib build, clang edition

2021-10-08 Thread Reid Kleckner via cfe-commits
Author: Reid Kleckner Date: 2021-10-08T15:43:56-07:00 New Revision: 955dc3449acd64c0505a3823aa93a6af38b00782 URL: https://github.com/llvm/llvm-project/commit/955dc3449acd64c0505a3823aa93a6af38b00782 DIFF: https://github.com/llvm/llvm-project/commit/955dc3449acd64c0505a3823aa93a6af38b00782.diff

[clang] e42ce42 - [dllexport] Instantiate default ctor default args

2021-08-23 Thread Reid Kleckner via cfe-commits
Author: Reid Kleckner Date: 2021-08-23T15:56:29-07:00 New Revision: e42ce422a97876e5ecd1c845b12ec65f96f8a293 URL: https://github.com/llvm/llvm-project/commit/e42ce422a97876e5ecd1c845b12ec65f96f8a293 DIFF: https://github.com/llvm/llvm-project/commit/e42ce422a97876e5ecd1c845b12ec65f96f8a293.diff

[clang] db3d029 - Effectively revert 33c3d8a916c / D33782

2021-08-25 Thread Reid Kleckner via cfe-commits
Author: Reid Kleckner Date: 2021-08-25T14:41:26-07:00 New Revision: db3d029fbe09925ea42a3279b1abb244fa547cff URL: https://github.com/llvm/llvm-project/commit/db3d029fbe09925ea42a3279b1abb244fa547cff DIFF: https://github.com/llvm/llvm-project/commit/db3d029fbe09925ea42a3279b1abb244fa547cff.diff

[clang] Deprecate -fheinous-gnu-extensions; introduce a new warning flag (PR #105821)

2024-08-23 Thread Reid Kleckner via cfe-commits
https://github.com/rnk approved this pull request. Thanks for doing this! https://github.com/llvm/llvm-project/pull/105821 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [MS ABI]: Support preserve_none in MS ABI (PR #96487)

2024-06-25 Thread Reid Kleckner via cfe-commits
https://github.com/rnk commented: Thanks for looking at this, let's make this an error instead of a crash in the future. https://github.com/llvm/llvm-project/pull/96487 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[clang] [MS ABI]: Support preserve_none in MS ABI (PR #96487)

2024-06-25 Thread Reid Kleckner via cfe-commits
https://github.com/rnk edited https://github.com/llvm/llvm-project/pull/96487 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [MS ABI]: Support preserve_none in MS ABI (PR #96487)

2024-06-25 Thread Reid Kleckner via cfe-commits
@@ -2986,6 +2989,9 @@ void MicrosoftCXXNameMangler::mangleCallingConvention(CallingConv CC) { case CC_Swift: Out << 'S'; break; case CC_SwiftAsync: Out << 'W'; break; case CC_PreserveMost: Out << 'U'; break; +case CC_PreserveNone: + Out << 'V'; ---

[clang] [MS ABI]: Support preserve_none in MS ABI (PR #96487)

2024-06-25 Thread Reid Kleckner via cfe-commits
@@ -2986,6 +2989,9 @@ void MicrosoftCXXNameMangler::mangleCallingConvention(CallingConv CC) { case CC_Swift: Out << 'S'; break; rnk wrote: The default case here should be a proper compiler error, not an unreachable, since there's no good way to prevent arb

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-06-25 Thread Reid Kleckner via cfe-commits
rnk wrote: IIUC, this effectively removes all empty records from LLVM struct types. This makes the IR less "pretty", but these subobjects are notionally empty and consist of only padding bytes (i8 and i8 arrays) at the end of the day. I think that's acceptable. + @rjmccall , does that sound go

[clang] [MS ABI]: Support preserve_none in MS ABI (PR #96487)

2024-06-26 Thread Reid Kleckner via cfe-commits
https://github.com/rnk approved this pull request. Thanks! https://github.com/llvm/llvm-project/pull/96487 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add explicit visibility symbol macros (PR #108276)

2024-10-09 Thread Reid Kleckner via cfe-commits
@@ -0,0 +1,67 @@ +//===-- clang/Support/Compiler.h - Compiler abstraction support -*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [clang] Fix segmentation fault caused by stack overflow on deeply nested expressions (PR #111701)

2024-10-11 Thread Reid Kleckner via cfe-commits
@@ -0,0 +1,1013 @@ +// RUN: %clang_cc1 %s -emit-llvm -o - -Wstack-exhausted -verify + +class AClass { +public: + AClass() {} + AClass &foo() { return *this; } +}; + +void test_bar() { + AClass a; + // expected-warning@* {{stack nearly exhausted; compilation time may suffer, a

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

2024-10-21 Thread Reid Kleckner via cfe-commits
rnk wrote: I would stick with `fms-compatibility` being the setting here rather than plumbing the driver mode through. Over the years, many build systems have been adapted to work with `clang[++]` and `cl` without going through clang-cl. https://github.com/llvm/llvm-project/pull/105738 ___

[clang] [MSVC] work-around for compile time issue 102513 (PR #110986)

2024-10-03 Thread Reid Kleckner via cfe-commits
https://github.com/rnk commented: Thanks! https://github.com/llvm/llvm-project/pull/110986 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [MSVC] work-around for compile time issue 102513 (PR #110986)

2024-10-03 Thread Reid Kleckner via cfe-commits
@@ -1430,6 +1434,10 @@ bool Interpret(InterpState &S, APValue &Result) { } } } +// https://github.com/llvm/llvm-project/issues/102513 +#if defined(_MSC_VER) rnk wrote: Please make the ifdef conditions match, or define your own macro like DEOPTIMIZE_SWIT

[clang] [MSVC] work-around for compile time issue 102513 (PR #110986)

2024-10-03 Thread Reid Kleckner via cfe-commits
https://github.com/rnk edited https://github.com/llvm/llvm-project/pull/110986 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Win/X86] Make _m_prefetch[w] builtins to avoid winnt.h conflicts (PR #115099)

2024-11-05 Thread Reid Kleckner via cfe-commits
https://github.com/rnk updated https://github.com/llvm/llvm-project/pull/115099 >From e1331b2c00db0cdff09345b36fd484f2269ee1cc Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Tue, 5 Nov 2024 16:05:53 -0800 Subject: [PATCH 1/2] [Win/X86] Make _m_prefetch[w] builtins to avoid winnt.h conflicts

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

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

[clang] [Win/X86] Make _m_prefetch[w] builtins to avoid winnt.h conflicts (PR #115099)

2024-11-08 Thread Reid Kleckner via cfe-commits
rnk wrote: We can adjust the rules around language linkage if we like, but the main reason we implement builtins this way is to support the MSVC intrinsic model, which is to declare extern "C" functions and mark them with `#pragma intrinsic(NAME)` like so: ``` extern "C" void _m_prefetchw(vola

[clang] [llvm] [ARM] Fix musttail calls (PR #109943)

2024-09-25 Thread Reid Kleckner via cfe-commits
@@ -12658,10 +12658,10 @@ This instruction requires several arguments: the return value of the callee is returned to the caller's caller, even if a void return type is in use. - Both markers imply that the callee does not access allocas from the caller. - The `

[clang] [llvm] [ARM] Fix musttail calls (PR #109943)

2024-09-25 Thread Reid Kleckner via cfe-commits
https://github.com/rnk commented: Thanks for prioritizing this! I have triaged many internal issues about this. https://github.com/llvm/llvm-project/pull/109943 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

[clang] [llvm] [ARM] Fix musttail calls (PR #109943)

2024-09-25 Thread Reid Kleckner via cfe-commits
https://github.com/rnk edited https://github.com/llvm/llvm-project/pull/109943 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-09-26 Thread Reid Kleckner via cfe-commits
@@ -5706,6 +5707,27 @@ void ASTWriter::WriteDeclAndTypes(ASTContext &Context) { Stream.EmitRecord(DELAYED_NAMESPACE_LEXICAL_VISIBLE_RECORD, DelayedNamespaceRecord); + if (!FunctionToLambdasMap.empty()) { +// TODO: on disk hash table for function

[clang] [C++20][Modules] Fix non-determinism in serialized AST (PR #110131)

2024-09-26 Thread Reid Kleckner via cfe-commits
@@ -5713,8 +5713,7 @@ void ASTWriter::WriteDeclAndTypes(ASTContext &Context) { // efficent becuase it allows lazy deserialization. RecordData FunctionToLambdasMapRecord; for (const auto &Pair : FunctionToLambdasMap) { rnk wrote: This is now an iter

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

2024-09-26 Thread Reid Kleckner via cfe-commits
@@ -5706,6 +5707,27 @@ void ASTWriter::WriteDeclAndTypes(ASTContext &Context) { Stream.EmitRecord(DELAYED_NAMESPACE_LEXICAL_VISIBLE_RECORD, DelayedNamespaceRecord); + if (!FunctionToLambdasMap.empty()) { +// TODO: on disk hash table for function

[clang] [llvm] [ARM] Fix musttail calls (PR #109943)

2024-09-26 Thread Reid Kleckner via cfe-commits
rnk wrote: By the way, the x86 backend also miscompiles test cases like this: ``` struct ByVal { int large[5]; }; void f(ByVal a, ByVal b); void g(ByVal a, ByVal b) { [[clang::musttail]] f(b, a); } ``` I have an internal issue assigned to @aeubanks tracking that. I may have reported it upstre

[clang] [llvm] [CloneFunction][DebugInfo] Avoid cloning DILocalVariables of inlined functions (PR #75385)

2024-10-01 Thread Reid Kleckner via cfe-commits
rnk wrote: > If the function-local types should not be ODR-uniqued, then dropping the > identifier field sounds correct. I can't speak to the complexities of the alternative, but I'm immediately suspicious of this direction. We have stable manglings for static locals in inline functions and s

[clang] [llvm] [CloneFunction][DebugInfo] Avoid cloning DILocalVariables of inlined functions (PR #75385)

2024-10-02 Thread Reid Kleckner via cfe-commits
rnk wrote: > Perhaps a worthwhile direction is separating DISubprograms into abstract and > definition portions, much like DWARF does, which would allow us to put these > types into the declaration and have a well defined scope hierarchy: types > that get uniqued refer to the abstract-DISubpro

[clang] Clang tooling generated visibility macros for Clang (PR #109702)

2024-10-02 Thread Reid Kleckner via cfe-commits
rnk wrote: > Is there a plan for maintaining these annotations long-term? Like, should > there be a pre-commit action to verify that all the annotations are > up-to-date? pre-commit actions are expensive, but I think we could afford to do something here. It is not hard to set up a DLL build o

[clang] [Wunsafe-buffer-usage] Address some false positives in handling array indices that are decidably correct (PR #117370)

2024-11-27 Thread Reid Kleckner via cfe-commits
@@ -439,8 +439,16 @@ AST_MATCHER(ArraySubscriptExpr, isSafeArraySubscript) { dyn_cast(Node.getBase()->IgnoreParenImpCasts()); rnk wrote: There's a FIXME above about refactoring Sema::CheckArrayAccess to avoid duplication, and I'm trying to decide if that

[clang] [Wunsafe-buffer-usage] Address some false positives in handling array indices that are decidably correct (PR #117370)

2024-11-27 Thread Reid Kleckner via cfe-commits
https://github.com/rnk edited https://github.com/llvm/llvm-project/pull/117370 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Wunsafe-buffer-usage] Address some false positives in handling array indices that are decidably correct (PR #117370)

2024-11-27 Thread Reid Kleckner via cfe-commits
https://github.com/rnk commented: I think there's a policy question here of how much trust we want to put into the type system. Clearly, we've already put some trust into it to reduce false positives, but we could decide to trust any old constant array type bounds, and that would be a good cod

[clang] [Wunsafe-buffer-usage] Address some false positives in handling array indices that are decidably correct (PR #117370)

2024-11-27 Thread Reid Kleckner via cfe-commits
@@ -463,6 +471,13 @@ AST_MATCHER(ArraySubscriptExpr, isSafeArraySubscript) { return true; rnk wrote: I think getting the integer constant expr is more general, we can remove the IntegerLiteral test here, and if all tests pass, I would consider it functio

[clang] Clang tooling generated visibility macros for Clang (PR #109702)

2024-11-27 Thread Reid Kleckner via cfe-commits
rnk wrote: I think it makes sense to focus on Saleem's use case, which, perhaps to translate it into Posix-ecosystem terms, is to create a single Clang DSO (similar to llvm-dylib or whatever we call it) that all the affiliated monorepo Clang tools use (clang-tidy, clang-rename, clang-format, c

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

2024-11-15 Thread Reid Kleckner via cfe-commits
https://github.com/rnk commented: This is an LLVM code change, not a clang code change. It's an important principle that we test LLVM at the smallest reasonable granularity. Can you replace the clang test with an IR test? I'm sure we already have existing IR carrying existing sections, we just

[clang] Add an off-by-default warning to complain about MSVC bitfield padding (PR #117428)

2024-11-26 Thread Reid Kleckner via cfe-commits
@@ -19001,9 +19001,9 @@ void Sema::ActOnFields(Scope *S, SourceLocation RecLoc, Decl *EnclosingDecl, // Verify that all the fields are okay. SmallVector RecFields; - + std::optional PreviousField; rnk wrote: It doesn't seem idiomatic to use an optional

[clang] Add an off-by-default warning to complain about MSVC bitfield padding (PR #117428)

2024-11-26 Thread Reid Kleckner via cfe-commits
@@ -19213,6 +19213,29 @@ void Sema::ActOnFields(Scope *S, SourceLocation RecLoc, Decl *EnclosingDecl, if (Record && FD->getType().isVolatileQualified()) Record->setHasVolatileMember(true); +auto IsNonDependentBitField = [](const FieldDecl *FD) { + if (!FD->

[clang] Add an off-by-default warning to complain about MSVC bitfield padding (PR #117428)

2024-11-26 Thread Reid Kleckner via cfe-commits
@@ -19213,6 +19213,29 @@ void Sema::ActOnFields(Scope *S, SourceLocation RecLoc, Decl *EnclosingDecl, if (Record && FD->getType().isVolatileQualified()) Record->setHasVolatileMember(true); +auto IsNonDependentBitField = [](const FieldDecl *FD) { + if (!FD->

[clang] Add an off-by-default warning to complain about MSVC bitfield padding (PR #117428)

2024-11-26 Thread Reid Kleckner via cfe-commits
@@ -631,6 +631,7 @@ def Packed : DiagGroup<"packed", [PackedNonPod]>; def PaddedBitField : DiagGroup<"padded-bitfield">; def Padded : DiagGroup<"padded", [PaddedBitField]>; def UnalignedAccess : DiagGroup<"unaligned-access">; +def MSBitfieldCompatibility : DiagGroup<"ms-bitfiel

[clang] Add an off-by-default warning to complain about MSVC bitfield padding (PR #117428)

2024-12-02 Thread Reid Kleckner via cfe-commits
@@ -0,0 +1,180 @@ + +// RUN: %clang_cc1 -fsyntax-only -Wms-bitfield-compatibility -verify -triple armv8 -std=c++23 %s +// RUN: %clang_cc1 -fsyntax-only -DMS_BITFIELDS -mms-bitfields -verify=msbitfields -triple armv8-apple-macos10.15 -std=c++23 %s + +// msbitfields-no-diagnostics

[clang] Add an off-by-default warning to complain about MSVC bitfield padding (PR #117428)

2024-12-02 Thread Reid Kleckner via cfe-commits
@@ -631,6 +631,9 @@ Improvements to Clang's diagnostics - Clang now diagnoses dangling references for C++20's parenthesized aggregate initialization (#101957). +- A new off-by-default warning ``-Wms-bitfield-compatibility`` has been added to alert to cases where bit-field -

[clang] Add an off-by-default warning to complain about MSVC bitfield padding (PR #117428)

2024-12-02 Thread Reid Kleckner via cfe-commits
@@ -6418,6 +6418,12 @@ def warn_signed_bitfield_enum_conversion : Warning< InGroup, DefaultIgnore; def note_change_bitfield_sign : Note< "consider making the bitfield type %select{unsigned|signed}0">; +def warn_ms_bitfield_mismatched_storage_packing : Warning< + "bit-field

[clang] [Clang] Enable -fextend-lifetimes at -Og (PR #118026)

2024-12-04 Thread Reid Kleckner via cfe-commits
@@ -1834,6 +1834,14 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, Opts.setInlining(CodeGenOptions::NormalInlining); } + // If we have specified -Og and have not explicitly set -fno-extend-lifetimes, + // then default to -fextend-li

[clang] [clang-tools-extra] [lld] [lldb] [llvm] Rework the `Option` library to reduce dynamic relocations (PR #119198)

2024-12-09 Thread Reid Kleckner via cfe-commits
@@ -53,10 +53,8 @@ class OptTable { public: /// Entry for a single option instance in the option data table. struct Info { -/// A null terminated array of prefix strings to apply to name while -/// matching. -ArrayRef Prefixes; -StringLiteral PrefixedName; +

[clang] [clang-tools-extra] [lld] [lldb] [llvm] Rework the `Option` library to reduce dynamic relocations (PR #119198)

2024-12-09 Thread Reid Kleckner via cfe-commits
@@ -80,15 +78,56 @@ class OptTable { const char *AliasArgs; const char *Values; -StringRef getName() const { - unsigned PrefixLength = Prefixes.empty() ? 0 : Prefixes[0].size(); - return PrefixedName.drop_front(PrefixLength); +bool hasNoPrefix() const

[clang] [clang-tools-extra] [lld] [lldb] [llvm] Rework the `Option` library to reduce dynamic relocations (PR #119198)

2024-12-09 Thread Reid Kleckner via cfe-commits
@@ -845,13 +845,14 @@ MemoryBufferRef LinkerDriver::convertResToCOFF(ArrayRef mbs, // Create OptTable +#define OPTTABLE_STR_TABLE_CODE rnk wrote: Is it feasible to split out all the tool driver updates, like refactor all these PREFIX definitions into the t

[clang] [clang-tools-extra] [lld] [lldb] [llvm] Rework the `Option` library to reduce dynamic relocations (PR #119198)

2024-12-09 Thread Reid Kleckner via cfe-commits
@@ -53,10 +53,8 @@ class OptTable { public: /// Entry for a single option instance in the option data table. struct Info { -/// A null terminated array of prefix strings to apply to name while -/// matching. -ArrayRef Prefixes; -StringLiteral PrefixedName; +

[clang] [Win/X86] Make _m_prefetch[w] builtins to avoid winnt.h conflicts (PR #115099)

2025-02-03 Thread Reid Kleckner via cfe-commits
https://github.com/rnk updated https://github.com/llvm/llvm-project/pull/115099 >From e5f485ad8000c296229794346fdd627b90e504d2 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Tue, 5 Nov 2024 16:05:53 -0800 Subject: [PATCH 1/7] [Win/X86] Make _m_prefetch[w] builtins to avoid winnt.h conflicts

[clang] [Win/X86] Make _m_prefetch[w] builtins to avoid winnt.h conflicts (PR #115099)

2025-02-03 Thread Reid Kleckner via cfe-commits
https://github.com/rnk closed https://github.com/llvm/llvm-project/pull/115099 ___ 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)

2025-02-03 Thread Reid Kleckner via cfe-commits
https://github.com/rnk 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)

2025-02-03 Thread Reid Kleckner via cfe-commits
https://github.com/rnk approved this pull request. Thanks for optimizing the builtins! I feel like builtins have grown significantly since adding RISC-V and ARM MVE intrinsics, and few people until now have stopped to re-evaluate how we represent these things. While I was watching these clearl

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

2025-02-03 Thread Reid Kleckner via cfe-commits
@@ -482,17 +488,42 @@ void clang::EmitClangBuiltins(const RecordKeeper &Records, raw_ostream &OS) { for (const auto *BuiltinRecord : Records.getAllDerivedDefinitions("AtomicBuiltin")) collectBuiltins(BuiltinRecord, Builtins); - unsigned NumAtomicBuiltins = Buil

[clang] [Win/X86] Make _m_prefetch[w] builtins to avoid winnt.h conflicts (PR #115099)

2025-02-03 Thread Reid Kleckner via cfe-commits
@@ -146,8 +146,13 @@ let Attributes = [Const, NoThrow, RequiredVectorWidth<256>], Features = "avx" in // current formulation is based on what was easiest to recognize from the // pre-TableGen version. -let Features = "mmx", Attributes = [NoThrow, Const] in { - def _mm_prefet

[clang] [Win/X86] Make _m_prefetch[w] builtins to avoid winnt.h conflicts (PR #115099)

2025-01-30 Thread Reid Kleckner via cfe-commits
https://github.com/rnk updated https://github.com/llvm/llvm-project/pull/115099 >From e5f485ad8000c296229794346fdd627b90e504d2 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Tue, 5 Nov 2024 16:05:53 -0800 Subject: [PATCH 1/3] [Win/X86] Make _m_prefetch[w] builtins to avoid winnt.h conflicts

[clang] [Win/X86] Make _m_prefetch[w] builtins to avoid winnt.h conflicts (PR #115099)

2025-01-30 Thread Reid Kleckner via cfe-commits
https://github.com/rnk commented: I had to rebase this over the table-gen-ification of the builtins, but I think this is still relevant. https://github.com/llvm/llvm-project/pull/115099 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://l

[clang] [Win/X86] Make _m_prefetch[w] builtins to avoid winnt.h conflicts (PR #115099)

2025-01-30 Thread Reid Kleckner via cfe-commits
@@ -31,10 +31,13 @@ // All MMX instructions will be generated via builtins. Any MMX vector // types (<1 x i64>, <2 x i32>, etc.) that aren't used by these builtins will be // expanded by the back-end. +// // FIXME: _mm_prefetch must be a built-in because it takes a compile-ti

[clang] [Win/X86] Make _m_prefetch[w] builtins to avoid winnt.h conflicts (PR #115099)

2025-01-30 Thread Reid Kleckner via cfe-commits
https://github.com/rnk edited https://github.com/llvm/llvm-project/pull/115099 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Win/X86] Make _m_prefetch[w] builtins to avoid winnt.h conflicts (PR #115099)

2025-01-30 Thread Reid Kleckner via cfe-commits
https://github.com/rnk updated https://github.com/llvm/llvm-project/pull/115099 >From e5f485ad8000c296229794346fdd627b90e504d2 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Tue, 5 Nov 2024 16:05:53 -0800 Subject: [PATCH 1/5] [Win/X86] Make _m_prefetch[w] builtins to avoid winnt.h conflicts

[clang] [Win/X86] Make _m_prefetch[w] builtins to avoid winnt.h conflicts (PR #115099)

2025-01-30 Thread Reid Kleckner via cfe-commits
@@ -2225,9 +2221,10 @@ _mm_storer_ps(float *__p, __m128 __a) ///be generated. \n ///_MM_HINT_T2: Move data using the T2 hint. The PREFETCHT2 instruction will ///be generated. -#define _mm_prefetch(a, sel) (__builtin_prefetch((const void *)(a), \ -

[clang] [Win/X86] Make _m_prefetch[w] builtins to avoid winnt.h conflicts (PR #115099)

2025-01-30 Thread Reid Kleckner via cfe-commits
https://github.com/rnk updated https://github.com/llvm/llvm-project/pull/115099 >From e5f485ad8000c296229794346fdd627b90e504d2 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Tue, 5 Nov 2024 16:05:53 -0800 Subject: [PATCH 1/6] [Win/X86] Make _m_prefetch[w] builtins to avoid winnt.h conflicts

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

2025-02-04 Thread Reid Kleckner via cfe-commits
rnk wrote: > But one specific question: would you prefer me to land as a series of commits > or a single squashed commit for the entire PR? I'm happy either way. My mild > preference is to prefer the series of commits, but open to suggestions here. I would land it as the six-patch stack in thi

[clang] [clang] UEFI ABI fixes for X86_64 (PR #124992)

2025-02-04 Thread Reid Kleckner via cfe-commits
@@ -74,7 +74,7 @@ static CCMangling getCallingConvMangling(const ASTContext &Context, if (FD->isMain() && FD->getNumParams() == 2) return CCM_WasmMainArgcArgv; - if (!Triple.isOSWindows() || !Triple.isX86()) + if (!Triple.isOSWindowsOrUEFI() || !Triple.isX86()

[clang] [clang] UEFI ABI fixes for X86_64 (PR #124992)

2025-02-04 Thread Reid Kleckner via cfe-commits
@@ -5193,12 +5193,12 @@ bool Sema::CheckCallingConvAttr(const ParsedAttr &Attrs, CallingConv &CC, CC = CC_X86RegCall; break; case ParsedAttr::AT_MSABI: -CC = Context.getTargetInfo().getTriple().isOSWindows() ? CC_C : -

[clang] [Win/X86] Make _m_prefetch[w] builtins to avoid winnt.h conflicts (PR #115099)

2025-02-04 Thread Reid Kleckner via cfe-commits
rnk wrote: > The build is still broken (e.g. > https://lab.llvm.org/buildbot/#/builders/63/builds/3861). I'll back it out. Thank you for doing that. I missed all notifications because they got lost in the storm of failures due to the mismatch between my local build and what was on github. ht

[clang] [clang][X86] Support __attribute__((model("small"/"large"))) (PR #124834)

2025-02-05 Thread Reid Kleckner via cfe-commits
@@ -2949,15 +2950,34 @@ static void handleSectionAttr(Sema &S, Decl *D, const ParsedAttr &AL) { } } +static bool isValidCodeModelAttr(Sema &S, StringRef Str) { + if (S.Context.getTargetInfo().getTriple().isLoongArch()) { +return Str == "normal" || Str == "medium" || St

[clang] [clang][X86] Support __attribute__((model("small"/"large"))) (PR #124834)

2025-01-31 Thread Reid Kleckner via cfe-commits
rnk wrote: I assume it is safe for all device side compilations to ignore this attribute. Presumably device code uses fully general patterns to access global data that could live in any shared object. Most device ISAs are virtual anyway, it's not like they're going to use PC relative addressin

[clang] [Win/X86] Make _m_prefetch[w] builtins to avoid winnt.h conflicts (PR #115099)

2025-01-30 Thread Reid Kleckner via cfe-commits
https://github.com/rnk updated https://github.com/llvm/llvm-project/pull/115099 >From e5f485ad8000c296229794346fdd627b90e504d2 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Tue, 5 Nov 2024 16:05:53 -0800 Subject: [PATCH 1/4] [Win/X86] Make _m_prefetch[w] builtins to avoid winnt.h conflicts

[clang] [Win/X86] Make _m_prefetch[w] builtins to avoid winnt.h conflicts (PR #115099)

2025-01-30 Thread Reid Kleckner via cfe-commits
@@ -146,8 +146,13 @@ let Attributes = [Const, NoThrow, RequiredVectorWidth<256>], Features = "avx" in // current formulation is based on what was easiest to recognize from the // pre-TableGen version. -let Features = "mmx", Attributes = [NoThrow, Const] in { - def _mm_prefet

[clang] [clang-tools-extra] [lld] [lldb] [llvm] Rework the `Option` library to reduce dynamic relocations (PR #119198)

2024-12-11 Thread Reid Kleckner via cfe-commits
@@ -53,10 +53,8 @@ class OptTable { public: /// Entry for a single option instance in the option data table. struct Info { -/// A null terminated array of prefix strings to apply to name while -/// matching. -ArrayRef Prefixes; -StringLiteral PrefixedName; +

[clang] [clang-tools-extra] [lld] [lldb] [llvm] Rework the `Option` library to reduce dynamic relocations (PR #119198)

2024-12-11 Thread Reid Kleckner via cfe-commits
@@ -845,13 +845,14 @@ MemoryBufferRef LinkerDriver::convertResToCOFF(ArrayRef mbs, // Create OptTable +#define OPTTABLE_STR_TABLE_CODE rnk wrote: I convinced myself this is not worth it. The changes to the `PrecomputedOptTable` are hard to abstract away. I

[clang] [clang-tools-extra] [lld] [lldb] [llvm] Rework the `Option` library to reduce dynamic relocations (PR #119198)

2024-12-11 Thread Reid Kleckner via cfe-commits
https://github.com/rnk approved this pull request. Thanks! I think this is ready to land. https://github.com/llvm/llvm-project/pull/119198 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[clang] [lld] [llvm] [Windows] Add support for emitting PGO/LTO magic strings in the Windows PE debug directory (PR #114260)

2024-11-21 Thread Reid Kleckner via cfe-commits
@@ -112,6 +112,8 @@ class MCTargetOptions { // Whether or not to use full register names on PowerPC. bool PPCUseFullRegisterNames : 1; + bool PgoInstrumentation = false; rnk wrote: Target options like this don't play well with (thin)LTO , because they do

[clang] [Wunsafe-buffer-usage] Fix false positives in handling enums (PR #117370)

2024-11-22 Thread Reid Kleckner via cfe-commits
@@ -463,6 +463,13 @@ AST_MATCHER(ArraySubscriptExpr, isSafeArraySubscript) { return true; } + // Array index wasn't an integer literal, let's see if it was an enum or + // something similar + const auto IntConst = Node.getIdx()->getIntegerConstantExpr(Finder->getAS

[clang] [Wunsafe-buffer-usage] Fix false positives in handling enums (PR #117370)

2024-11-22 Thread Reid Kleckner via cfe-commits
@@ -39,6 +39,23 @@ void constant_idx_unsafe(unsigned idx) { buffer[10] = 0; // expected-note{{used in buffer access here}} } +enum FooEnum { + A = 0, + B = 1, + C = 2, + D +}; + +void constant_enum_safe() { + int buffer[FooEnum::D] = { 0, 1, 2 }; + buffer[C] = 0;

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

2025-01-08 Thread Reid Kleckner via cfe-commits
https://github.com/rnk created https://github.com/llvm/llvm-project/pull/122197 Don't use isPotentiallyOverlapping to control behavior that allows overwriting previous field data, because the `[[no_unique_address]]` attribute is not available in any debug info, DWARF or PDB. Instead, just trust

[clang] Use range-based for to iterate over fields in record layout, NFC (PR #122029)

2025-01-08 Thread Reid Kleckner via cfe-commits
https://github.com/rnk updated https://github.com/llvm/llvm-project/pull/122029 >From 1824674744d6fba1dd74c74d54aae9b603d8b854 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Wed, 8 Jan 2025 00:24:09 + Subject: [PATCH 1/2] Use range-based for to iterate over fields in record layout, NFC

[clang] Use range-based for to iterate over fields in record layout, NFC (PR #122029)

2025-01-08 Thread Reid Kleckner via cfe-commits
https://github.com/rnk updated https://github.com/llvm/llvm-project/pull/122029 >From 1824674744d6fba1dd74c74d54aae9b603d8b854 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Wed, 8 Jan 2025 00:24:09 + Subject: [PATCH 1/3] Use range-based for to iterate over fields in record layout, NFC

[clang] [X86] Fix the implementation of __readcr[4, 8]/__writecr[4, 8] to work in 64-bit mode (PR #122238)

2025-01-09 Thread Reid Kleckner via cfe-commits
https://github.com/rnk commented: Thanks! I see we don't actually implement these intrinsics at this point, but fixing them to avoid redeclaration errors is reasonable. https://github.com/llvm/llvm-project/pull/122238 ___ cfe-commits mailing list cfe

[clang] [lldb] [llvm] [StrTable] Switch the option parser to `llvm::StringTable` (PR #123308)

2025-01-22 Thread Reid Kleckner via cfe-commits
@@ -33,25 +33,26 @@ using namespace llvm::opt; namespace { struct OptNameLess { - const char *StrTable; - ArrayRef PrefixesTable; + const StringTable *StrTable; rnk wrote: Can this be a const reference instead? Is there a reason you chose to make this a p

[clang] [lldb] [llvm] [StrTable] Switch the option parser to `llvm::StringTable` (PR #123308)

2025-01-22 Thread Reid Kleckner via cfe-commits
@@ -117,13 +121,13 @@ class OptTable { private: // A unified string table for these options. Individual strings are stored as // null terminated C-strings at offsets within this table. - const char *StrTable; + const StringTable *StrTable; rnk wrote: Can

[clang] [lldb] [llvm] [StrTable] Switch the option parser to `llvm::StringTable` (PR #123308)

2025-01-22 Thread Reid Kleckner via cfe-commits
https://github.com/rnk edited https://github.com/llvm/llvm-project/pull/123308 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lldb] [llvm] [StrTable] Switch the option parser to `llvm::StringTable` (PR #123308)

2025-01-22 Thread Reid Kleckner via cfe-commits
https://github.com/rnk commented: Thanks, I just had one question. https://github.com/llvm/llvm-project/pull/123308 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] WIP: [clang] MicrosoftCXXABI: Fix exception copy constructor LUT after loading AST (PR #114075)

2025-01-22 Thread Reid Kleckner via cfe-commits
@@ -249,6 +249,11 @@ FIELD(HasDeclaredCopyAssignmentWithConstParam, 1, MERGE_OR) /// base classes or fields have a no-return destructor FIELD(IsAnyDestructorNoReturn, 1, NO_MERGE) +/// Microsoft CXX ABI specific: +/// Whether the copy constructor is used by a `throw` expressio

[clang] WIP: [clang] MicrosoftCXXABI: Fix exception copy constructor LUT after loading AST (PR #114075)

2025-01-22 Thread Reid Kleckner via cfe-commits
https://github.com/rnk edited https://github.com/llvm/llvm-project/pull/114075 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] WIP: [clang] MicrosoftCXXABI: Fix exception copy constructor LUT after loading AST (PR #114075)

2025-01-22 Thread Reid Kleckner via cfe-commits
@@ -0,0 +1,19 @@ +// REQUIRES: system-windows, target={{.*-windows-msvc}} +// RUN: %clang_cc1 -x c++ -std=c++17 -fcxx-exceptions -fexceptions -triple=%ms_abi_triple -emit-pch -building-pch-with-obj -fmodules-codegen -o %t.pch %S/cxx-exception-copy-ctor-crash.h +// RUN: %clang_cc

[clang] WIP: [clang] MicrosoftCXXABI: Fix exception copy constructor LUT after loading AST (PR #114075)

2025-01-22 Thread Reid Kleckner via cfe-commits
@@ -2316,6 +2316,20 @@ void ASTDeclReader::VisitCXXConstructorDecl(CXXConstructorDecl *D) { } VisitCXXMethodDecl(D); + + // Microsoft CXX ABI specific: + // Restore the RecordToCopyCtor sidecar LUT entry so that `throw` expressions + // find the correct copy constructo

[clang] WIP: [clang] MicrosoftCXXABI: Fix exception copy constructor LUT after loading AST (PR #114075)

2025-01-22 Thread Reid Kleckner via cfe-commits
https://github.com/rnk commented: I think @majnemer added the lookup table originally. I think we did things this way because, while it creates obvious serialization problems, it's the most straightforwardly correct approach if you think finding copy constructors is an ambiguous operation. It'

[clang] [lldb] [llvm] [StrTable] Switch the option parser to `llvm::StringTable` (PR #123308)

2025-01-22 Thread Reid Kleckner via cfe-commits
@@ -117,13 +121,13 @@ class OptTable { private: // A unified string table for these options. Individual strings are stored as // null terminated C-strings at offsets within this table. - const char *StrTable; + const StringTable *StrTable; rnk wrote: Got

[clang] [lldb] [llvm] [StrTable] Switch the option parser to `llvm::StringTable` (PR #123308)

2025-01-22 Thread Reid Kleckner via cfe-commits
https://github.com/rnk approved this pull request. https://github.com/llvm/llvm-project/pull/123308 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

<    9   10   11   12   13   14   15   16   >