[clang] [clang] Correct FixIt ranges for unused capture warnings (PR #141148)

2025-05-24 Thread Oliver Hunt via cfe-commits
@@ -84,6 +84,21 @@ SourceLocation Sema::getLocForEndOfToken(SourceLocation Loc, unsigned Offset) { return Lexer::getLocForEndOfToken(Loc, Offset, SourceMgr, LangOpts); } +SourceRange Sema::getRangeForNextToken(SourceLocation Loc, + bool

[clang] [clang] Correct FixIt ranges for unused capture warnings (PR #141148)

2025-05-24 Thread Oliver Hunt via cfe-commits
@@ -2164,15 +2164,29 @@ ExprResult Sema::BuildLambdaExpr(SourceLocation StartLoc, SourceLocation EndLoc, bool IsLast = (I + 1) == LSI->NumExplicitCaptures; SourceRange FixItRange; if (CaptureRange.isValid()) { +auto GetTrailingEndLocat

[clang] [clang] Correct FixIt ranges for unused capture warnings (PR #141148)

2025-05-24 Thread Oliver Hunt via cfe-commits
@@ -84,6 +84,21 @@ SourceLocation Sema::getLocForEndOfToken(SourceLocation Loc, unsigned Offset) { return Lexer::getLocForEndOfToken(Loc, Offset, SourceMgr, LangOpts); } +SourceRange Sema::getRangeForNextToken(SourceLocation Loc, + bool

[libunwind] [libunwind][AArch64] Protect PC within libunwind's context. (PR #113368)

2025-05-27 Thread Oliver Hunt via cfe-commits
ojhunt wrote: Sorry for the delay, now that we've got the qualifier and various other features upstreamed, I'll be upstreaming our ptrauth hardening for the various runtime libraries in the not too distant future (I'm technically on vacation this week, but it may go up this week, otherwise it

[clang] [llvm] [NFC] Address bit-field storage sizes to ensure ideal packing (PR #139825)

2025-05-15 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/139825 >From a28452d50023ca12435e2d60933852e1b6728fe1 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Tue, 13 May 2025 19:17:27 -0700 Subject: [PATCH 1/2] [NFC] Address bit-field storage sizes to ensure ideal packing

[clang] [llvm] [NFC] Address bit-field storage sizes to ensure ideal packing (PR #139825)

2025-05-15 Thread Oliver Hunt via cfe-commits
@@ -32,8 +33,9 @@ namespace llvm { /// class BitCodeAbbrevOp { uint64_t Val; // A literal value or data for an encoding. - bool IsLiteral : 1; // Indicate whether this is a literal value or not. - unsigned Enc : 3; // The encoding to use. + LLVM_PREFERR

[clang] [llvm] [NFC] Address bit-field storage sizes to ensure ideal packing (PR #139825)

2025-05-15 Thread Oliver Hunt via cfe-commits
@@ -74,18 +74,18 @@ enum DiagnosticClass { struct StaticDiagInfoRec { uint16_t DiagID; LLVM_PREFERRED_TYPE(diag::Severity) - uint8_t DefaultSeverity : 3; + uint16_t DefaultSeverity : 3; LLVM_PREFERRED_TYPE(DiagnosticClass) - uint8_t Class : 3; + uint16_t Class : 3;

[clang] [llvm] [NFC] Address bit-field storage sizes to ensure ideal packing (PR #139825)

2025-05-15 Thread Oliver Hunt via cfe-commits
@@ -410,7 +412,7 @@ class AnalyzerOptions { // an alias to the new verbose filename option because this // closely mimics the behavior under the old option. ShouldWriteStableReportFilename || ShouldWriteVerboseReportFilename, -An

[clang] [llvm] [NFC] Address bit-field storage sizes to ensure ideal packing (PR #139825)

2025-05-15 Thread Oliver Hunt via cfe-commits
@@ -32,8 +33,9 @@ namespace llvm { /// class BitCodeAbbrevOp { uint64_t Val; // A literal value or data for an encoding. - bool IsLiteral : 1; // Indicate whether this is a literal value or not. - unsigned Enc : 3; // The encoding to use. + LLVM_PREFERR

[clang] [llvm] [NFC] Address bit-field storage sizes to ensure ideal packing (PR #139825)

2025-05-15 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/139825 >From a28452d50023ca12435e2d60933852e1b6728fe1 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Tue, 13 May 2025 19:17:27 -0700 Subject: [PATCH 1/5] [NFC] Address bit-field storage sizes to ensure ideal packing

[clang] [llvm] [NFC] Address bit-field storage sizes to ensure ideal packing (PR #139825)

2025-05-15 Thread Oliver Hunt via cfe-commits
@@ -74,20 +75,23 @@ enum DiagnosticClass { struct StaticDiagInfoRec { uint16_t DiagID; LLVM_PREFERRED_TYPE(diag::Severity) - uint8_t DefaultSeverity : 3; + uint16_t DefaultSeverity : 3; LLVM_PREFERRED_TYPE(DiagnosticClass) - uint8_t Class : 3; + uint16_t Class : 3;

[clang] [llvm] [NFC] Address bit-field storage sizes to ensure ideal packing (PR #139825)

2025-05-15 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/139825 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-se

[clang] [llvm] [NFC] Address bit-field storage sizes to ensure ideal packing (PR #139825)

2025-05-15 Thread Oliver Hunt via cfe-commits
ojhunt wrote: The format problems are existing style that I don't want to reformat in this PR: ```diff diff --git a/clang/include/clang/Basic/DiagnosticCategories.h b/clang/include/clang/Basic/DiagnosticCategories.h index 52bb7a268b41..f7b2af8d194a 100644 --- a/clang/include/clang/Basic/Diagnos

[clang] [llvm] [NFC] Address bit-field storage sizes to ensure ideal packing (PR #139825)

2025-05-16 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt closed https://github.com/llvm/llvm-project/pull/139825 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [NFC] Address bit-field storage sizes to ensure ideal packing (PR #139825)

2025-05-15 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/139825 >From a28452d50023ca12435e2d60933852e1b6728fe1 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Tue, 13 May 2025 19:17:27 -0700 Subject: [PATCH 1/4] [NFC] Address bit-field storage sizes to ensure ideal packing

[clang] [llvm] [NFC] Address bit-field storage sizes to ensure ideal packing (PR #139825)

2025-05-15 Thread Oliver Hunt via cfe-commits
@@ -996,7 +997,8 @@ class Sema; /// FailureKind - The reason why this candidate is not viable. /// Actually an OverloadFailureKind. ojhunt wrote: should I remove this comment now that there's a preferred type annotation? https://github.com/llvm/llvm-

[clang] [llvm] [NFC] Address bit-field storage sizes to ensure ideal packing (PR #139825)

2025-05-15 Thread Oliver Hunt via cfe-commits
ojhunt wrote: Sigh, my stage2 config didn't include -Wc++11-narrowing :-O https://github.com/llvm/llvm-project/pull/139825 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [NFC] Address bit-field storage sizes to ensure ideal packing (PR #139825)

2025-05-15 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/139825 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-se

[clang] [llvm] [NFC] Address bit-field storage sizes to ensure ideal packing (PR #139825)

2025-05-16 Thread Oliver Hunt via cfe-commits
ojhunt wrote: > LLVM Buildbot has detected a new failure on builder > `llvm-clang-x86_64-win-fast` running on `as-builder-3` while building > `clang,llvm` at step 6 "build-unified-tree". > > Full details are available at: > https://lab.llvm.org/buildbot/#/builders/2/builds/24094 > > Here is

[clang] [clang][PAC] add support for options parameter to __ptrauth (PR #136828)

2025-05-21 Thread Oliver Hunt via cfe-commits
@@ -3595,9 +3595,9 @@ def ObjCRequiresPropertyDefs : InheritableAttr { def PointerAuth : TypeAttr { let Spellings = [CustomKeyword<"__ptrauth">]; - let Args = [IntArgument<"Key">, - BoolArgument<"AddressDiscriminated", 1>, - IntArgument<"ExtraDiscr

[clang] [clang][PAC] add support for options parameter to __ptrauth (PR #136828)

2025-05-21 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/136828 >From 927380bdf377581e6e40507a12c374023352c613 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Wed, 30 Apr 2025 22:26:59 -0700 Subject: [PATCH 1/5] [clang][PAC] add support for options parameter to __ptrauth T

[clang] [clang][PAC] add support for options parameter to __ptrauth (PR #136828)

2025-05-21 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/136828 >From 927380bdf377581e6e40507a12c374023352c613 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Wed, 30 Apr 2025 22:26:59 -0700 Subject: [PATCH 1/4] [clang][PAC] add support for options parameter to __ptrauth T

[clang] [clang][PAC] add support for options parameter to __ptrauth (PR #136828)

2025-05-21 Thread Oliver Hunt via cfe-commits
@@ -327,6 +330,27 @@ a discriminator determined as follows: is ``ptrauth_blend_discriminator(&x, discriminator)``; see `ptrauth_blend_discriminator`_. +``ptrauth_qualifier_options`` +~ + +The options parameter to the ``__ptrauth`` qualifier is a

[clang] [clang][PAC] add support for options parameter to __ptrauth (PR #136828)

2025-05-21 Thread Oliver Hunt via cfe-commits
@@ -65,6 +65,17 @@ enum class PointerAuthenticationMode : unsigned { SignAndAuth }; +static constexpr llvm::StringLiteral PointerAuthenticationOptionStrip = "strip"; ojhunt wrote: Oh, I hadn't included the updated to stringifying the qualifier so these wer

[clang] [clang][PAC] add support for options parameter to __ptrauth (PR #136828)

2025-05-21 Thread Oliver Hunt via cfe-commits
@@ -3595,9 +3595,9 @@ def ObjCRequiresPropertyDefs : InheritableAttr { def PointerAuth : TypeAttr { let Spellings = [CustomKeyword<"__ptrauth">]; - let Args = [IntArgument<"Key">, - BoolArgument<"AddressDiscriminated", 1>, - IntArgument<"ExtraDiscr

[clang] [FixIt] Improve Source Ranges and Fix-It Hints for Unused Lambda Captures #106445 (PR #117953)

2025-05-22 Thread Oliver Hunt via cfe-commits
@@ -105,6 +105,13 @@ def note_replace_abs_function : Note<"use function '%0' instead">; def warn_pointer_abs : Warning< "taking the absolute value of %select{pointer|function|array}0 type %1 is suspicious">, InGroup; + +// Lambda capture diagnostics + +def err_invalid_l

[clang] [clang][PAC] add support for options parameter to __ptrauth (PR #136828)

2025-05-21 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/136828 >From 927380bdf377581e6e40507a12c374023352c613 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Wed, 30 Apr 2025 22:26:59 -0700 Subject: [PATCH 1/2] [clang][PAC] add support for options parameter to __ptrauth T

[clang] [clang][PAC] add support for options parameter to __ptrauth (PR #136828)

2025-05-21 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/136828 >From 927380bdf377581e6e40507a12c374023352c613 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Wed, 30 Apr 2025 22:26:59 -0700 Subject: [PATCH] [clang][PAC] add support for options parameter to __ptrauth This P

[clang] [FixIt] Improve Source Ranges and Fix-It Hints for Unused Lambda Captures #106445 (PR #117953)

2025-05-21 Thread Oliver Hunt via cfe-commits
@@ -1633,8 +1633,8 @@ static void repeatForLambdaConversionFunctionCallingConvs( CC_C,CC_X86StdCall, CC_X86FastCall, CC_X86VectorCall, DefaultFree, DefaultMember, CallOpCC}; llvm::sort(Convs); -llvm::iterator_range Range( -std::begin(Conv

[clang] [FixIt] Improve Source Ranges and Fix-It Hints for Unused Lambda Captures #106445 (PR #117953)

2025-05-21 Thread Oliver Hunt via cfe-commits
@@ -1633,8 +1633,8 @@ static void repeatForLambdaConversionFunctionCallingConvs( CC_C,CC_X86StdCall, CC_X86FastCall, CC_X86VectorCall, DefaultFree, DefaultMember, CallOpCC}; llvm::sort(Convs); -llvm::iterator_range Range( -std::begin(Conv

[clang] [clang] Correct FixIt ranges for unused capture warnings (PR #141148)

2025-05-22 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt created https://github.com/llvm/llvm-project/pull/141148 Fixes #106445 by using the lexer to find the correct range for the removal FixIts. Previously the ranges that were generated assuming no unsurprising formatting, which for the most part works. Being correct in a

[clang] [FixIt] Improve Source Ranges and Fix-It Hints for Unused Lambda Captures #106445 (PR #117953)

2025-05-22 Thread Oliver Hunt via cfe-commits
ojhunt wrote: The fix for the core issue was more complex than the easy fix/new contributor tag implied: https://github.com/llvm/llvm-project/pull/141148 https://github.com/llvm/llvm-project/pull/117953 ___ cfe-commits mailing list cfe-commits@lists

[clang] [clang][PAC] Add __builtin_get_vtable_pointer (PR #139790)

2025-06-02 Thread Oliver Hunt via cfe-commits
@@ -1825,6 +1825,37 @@ static ExprResult PointerAuthStringDiscriminator(Sema &S, CallExpr *Call) { return Call; } +static ExprResult GetVTablePointer(Sema &S, CallExpr *Call) { + if (S.checkArgCount(Call, 1)) +return ExprError(); + ExprResult ThisArg = S.DefaultFuncti

[clang] [clang] Correct FixIt ranges for unused capture warnings (PR #141148)

2025-06-02 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/141148 >From 0db205bb8f6925dd725885395f58a688000c7b8b Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Thu, 22 May 2025 02:38:26 -0700 Subject: [PATCH 1/2] [clang] Correct FixIt ranges for unused capture warnings Fixes

[clang] [clang] Correct FixIt ranges for unused capture warnings (PR #141148)

2025-06-02 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt edited https://github.com/llvm/llvm-project/pull/141148 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Correct FixIt ranges for unused capture warnings (PR #141148)

2025-06-02 Thread Oliver Hunt via cfe-commits
@@ -84,6 +84,21 @@ SourceLocation Sema::getLocForEndOfToken(SourceLocation Loc, unsigned Offset) { return Lexer::getLocForEndOfToken(Loc, Offset, SourceMgr, LangOpts); } +SourceRange Sema::getRangeForNextToken(SourceLocation Loc, + bool

[clang] [clang] Correct FixIt ranges for unused capture warnings (PR #141148)

2025-06-02 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt edited https://github.com/llvm/llvm-project/pull/141148 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Correct FixIt ranges for unused capture warnings (PR #141148)

2025-06-02 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt edited https://github.com/llvm/llvm-project/pull/141148 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Correct FixIt ranges for unused capture warnings (PR #141148)

2025-06-02 Thread Oliver Hunt via cfe-commits
@@ -972,6 +972,12 @@ class Sema final : public SemaBase { /// Calls \c Lexer::getLocForEndOfToken() SourceLocation getLocForEndOfToken(SourceLocation Loc, unsigned Offset = 0); + /// Calls \c Lexer::findNextToken() to find the next token, and if the + /// locations of bo

[clang] [clang] Correct FixIt ranges for unused capture warnings (PR #141148)

2025-06-02 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/141148 >From 0db205bb8f6925dd725885395f58a688000c7b8b Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Thu, 22 May 2025 02:38:26 -0700 Subject: [PATCH 1/3] [clang] Correct FixIt ranges for unused capture warnings Fixes

[clang] [clang] Correct FixIt ranges for unused capture warnings (PR #141148)

2025-06-02 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt edited https://github.com/llvm/llvm-project/pull/141148 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Correct FixIt ranges for unused capture warnings (PR #141148)

2025-06-02 Thread Oliver Hunt via cfe-commits
@@ -2164,15 +2164,29 @@ ExprResult Sema::BuildLambdaExpr(SourceLocation StartLoc, SourceLocation EndLoc, bool IsLast = (I + 1) == LSI->NumExplicitCaptures; SourceRange FixItRange; if (CaptureRange.isValid()) { +auto GetTrailingEndLocat

[clang] [clang] Correct FixIt ranges for unused capture warnings (PR #141148)

2025-06-02 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/141148 >From 0db205bb8f6925dd725885395f58a688000c7b8b Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Thu, 22 May 2025 02:38:26 -0700 Subject: [PATCH 1/4] [clang] Correct FixIt ranges for unused capture warnings Fixes

[clang] [clang] Correct FixIt ranges for unused capture warnings (PR #141148)

2025-06-02 Thread Oliver Hunt via cfe-commits
@@ -0,0 +1,250 @@ +// RUN: cp %s %t +// RUN: %clang_cc1 -x c++ -Wunused-lambda-capture -Wno-unused-value -std=c++1z -fixit %t +// RUN: grep -v CHECK %t | FileCheck %s + + +#define MACRO_CAPTURE(...) __VA_ARGS__ +int main() { +int a = 0, b = 0, c = 0; +auto F0 = [a, &b]()

[clang] [clang] Correct FixIt ranges for unused capture warnings (PR #141148)

2025-06-03 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/141148 >From 0db205bb8f6925dd725885395f58a688000c7b8b Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Thu, 22 May 2025 02:38:26 -0700 Subject: [PATCH 1/4] [clang] Correct FixIt ranges for unused capture warnings Fixes

[clang] [clang][CGObjC] Sign the v-table pointer in ObjC exception RTTI. (PR #135562)

2025-06-03 Thread Oliver Hunt via cfe-commits
ojhunt wrote: @cor3ntin ping :D https://github.com/llvm/llvm-project/pull/135562 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][PAC] Support trivially_relocating polymorphic objects (PR #144420)

2025-06-17 Thread Oliver Hunt via cfe-commits
@@ -4467,17 +4467,25 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID, case Builtin::BI__builtin_trivially_relocate: case Builtin::BImemmove: case Builtin::BI__builtin_memmove: { +QualType CopiedType = E->getArg(0)->getType()->getPoi

[clang] [clang][PAC] Support trivially_relocating polymorphic objects (PR #144420)

2025-06-17 Thread Oliver Hunt via cfe-commits
ojhunt wrote: > I think we should make a point of implementing this for address-discriminated > `__ptrauth` qualifiers before we release it, because changing the type trait > in a future release will be an ABI break. I had been talking to @cor3ntin and decided we could do it later as this is a

[clang] [clang][PAC] Support trivially_relocating polymorphic objects (PR #144420)

2025-06-18 Thread Oliver Hunt via cfe-commits
ojhunt wrote: > It is very common for type traits to factor into the ABI of a template > specialization, such that `my_variant` has a different layout depending on > `is_amazing_v`. That is why changing the value of a type trait generally > has to be considered an ABI break. ah right, it's no

[clang] [clang][PAC] Support trivially_relocating polymorphic objects (PR #144420)

2025-06-18 Thread Oliver Hunt via cfe-commits
ojhunt wrote: Converting to draft so I don't accidentally hit the big green commit button (that is big and green despite no approvals ?!?!) https://github.com/llvm/llvm-project/pull/144420 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:

[clang] [clang][PAC] Support trivially_relocating polymorphic objects (PR #144420)

2025-06-18 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt converted_to_draft https://github.com/llvm/llvm-project/pull/144420 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[compiler-rt] [libcxxabi] [libunwind] [runtimes][PAC] Harden unwinding when possible (#138571) (PR #143230)

2025-06-18 Thread Oliver Hunt via cfe-commits
@@ -1845,10 +1871,53 @@ class _LIBUNWIND_HIDDEN Registers_arm64 { uint64_t getSP() const { return _registers.__sp; } void setSP(uint64_t value) { _registers.__sp = value; } - uint64_t getIP() const { return _registers.__pc; } - void setIP(uint

[compiler-rt] [libcxxabi] [libunwind] [runtimes][PAC] Harden unwinding when possible (#138571) (PR #143230)

2025-06-18 Thread Oliver Hunt via cfe-commits
@@ -1845,10 +1871,53 @@ class _LIBUNWIND_HIDDEN Registers_arm64 { uint64_t getSP() const { return _registers.__sp; } void setSP(uint64_t value) { _registers.__sp = value; } - uint64_t getIP() const { return _registers.__pc; } - void setIP(uint

[compiler-rt] [libcxxabi] [libunwind] [runtimes][PAC] Harden unwinding when possible (#138571) (PR #143230)

2025-06-18 Thread Oliver Hunt via cfe-commits
@@ -93,6 +98,13 @@ class _LIBUNWIND_HIDDEN Registers_x86 { uint32_t getEDI() const { return _registers.__edi; } void setEDI(uint32_t value) { _registers.__edi = value; } + typedef uint32_t reg_t; + typedef uint32_t link_reg_t; + void loadAndAuthenticateLin

[compiler-rt] [libcxxabi] [libunwind] [runtimes][PAC] Harden unwinding when possible (#138571) (PR #143230)

2025-06-18 Thread Oliver Hunt via cfe-commits
@@ -694,7 +705,12 @@ DEFINE_LIBUNWIND_FUNCTION(__libunwind_Registers_arm64_jumpto) gcspushm x30 Lnogcs: #endif + +#if __has_feature(ptrauth_calls) + retab +#else ojhunt wrote: see earlier comment - do we want to just adopt a single flag instead of the cur

[compiler-rt] [libcxxabi] [libunwind] [runtimes][PAC] Harden unwinding when possible (#138571) (PR #143230)

2025-06-18 Thread Oliver Hunt via cfe-commits
@@ -1845,10 +1871,53 @@ class _LIBUNWIND_HIDDEN Registers_arm64 { uint64_t getSP() const { return _registers.__sp; } void setSP(uint64_t value) { _registers.__sp = value; } - uint64_t getIP() const { return _registers.__pc; } - void setIP(uint

[compiler-rt] [libcxxabi] [libunwind] [runtimes][PAC] Harden unwinding when possible (#138571) (PR #143230)

2025-06-18 Thread Oliver Hunt via cfe-commits
@@ -83,7 +83,13 @@ __llvm_profile_iterate_data(const __llvm_profile_data *Data) { /* This method is only used in value profiler mock testing. */ COMPILER_RT_VISIBILITY void * __llvm_get_function_addr(const __llvm_profile_data *Data) { - return Data->FunctionPointer; + void

[compiler-rt] [libcxxabi] [libunwind] [runtimes][PAC] Harden unwinding when possible (#138571) (PR #143230)

2025-06-18 Thread Oliver Hunt via cfe-commits
@@ -1877,6 +1946,32 @@ inline Registers_arm64::Registers_arm64(const void *registers) { memcpy(_vectorHalfRegisters, static_cast(registers) + sizeof(GPRs), sizeof(_vectorHalfRegisters)); +#if __has_feature(ptrauth_calls) ojhunt wrote: - [

[compiler-rt] [libcxxabi] [libunwind] [runtimes][PAC] Harden unwinding when possible (#138571) (PR #143230)

2025-06-18 Thread Oliver Hunt via cfe-commits
@@ -83,7 +83,13 @@ __llvm_profile_iterate_data(const __llvm_profile_data *Data) { /* This method is only used in value profiler mock testing. */ COMPILER_RT_VISIBILITY void * __llvm_get_function_addr(const __llvm_profile_data *Data) { - return Data->FunctionPointer; + void

[compiler-rt] [libcxxabi] [libunwind] [runtimes][PAC] Harden unwinding when possible (#138571) (PR #143230)

2025-06-18 Thread Oliver Hunt via cfe-commits
@@ -1877,6 +1946,32 @@ inline Registers_arm64::Registers_arm64(const void *registers) { memcpy(_vectorHalfRegisters, static_cast(registers) + sizeof(GPRs), sizeof(_vectorHalfRegisters)); +#if __has_feature(ptrauth_calls) + uint64_t pcRegister = 0; + memcp

[clang] [clang] Fix PointerAuth semantics of cpp_trivially_relocatable (PR #143969)

2025-06-16 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/143969 >From f47680310ed68a9f8e8cb15bc1cd474740072463 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Thu, 12 Jun 2025 13:17:11 -0700 Subject: [PATCH 1/7] [clang] Fix PointerAuth semantics of cpp_trivially_relocatable

[clang] [clang] Fix PointerAuth semantics of cpp_trivially_relocatable (PR #143969)

2025-06-16 Thread Oliver Hunt via cfe-commits
ojhunt wrote: > LLVM Buildbot has detected a new failure on builder > `ppc64le-flang-rhel-clang` running on `ppc64le-flang-rhel-test` while > building `clang` at step 6 "test-build-unified-tree-check-flang". > > Full details are available at: > https://lab.llvm.org/buildbot/#/builders/157/bui

[clang] [Clang] Fix typo in is_replaceable diagnostic (PR #144247)

2025-06-15 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt approved this pull request. lgtm https://github.com/llvm/llvm-project/pull/144247 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Improve diagnostics for 'placement new' with const storage argument (PR #144270)

2025-06-15 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt requested changes to this pull request. https://github.com/llvm/llvm-project/pull/144270 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Improve diagnostics for 'placement new' with const storage argument (PR #144270)

2025-06-15 Thread Oliver Hunt via cfe-commits
@@ -2753,10 +2753,18 @@ static bool resolveAllocationOverloadInterior( if (Diagnose) { // If this is an allocation of the form 'new (p) X' for some object // pointer p (or an expression that will decay to such a pointer), - // diagnose the missing inclusion

[clang] [clang][bytecode] Fix calling operator new with nothrow/align parameter (PR #144271)

2025-06-15 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt approved this pull request. Looks reasonable to me -- I spent a bunch of time trying to induce some case where this would do the wrong thing and I couldn't come up with anything as all the failure modes that would be possible outside of constexpr already fail in const

[clang] [Clang] Fix typo in is_replaceable diagnostic (PR #144247)

2025-06-15 Thread Oliver Hunt via cfe-commits
ojhunt wrote: Sure thing :D https://github.com/llvm/llvm-project/pull/144247 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix typo in is_replaceable diagnostic (PR #144247)

2025-06-15 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt closed https://github.com/llvm/llvm-project/pull/144247 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Improve diagnostics for 'placement new' with const storage argument (PR #144270)

2025-06-15 Thread Oliver Hunt via cfe-commits
@@ -2753,10 +2753,18 @@ static bool resolveAllocationOverloadInterior( if (Diagnose) { // If this is an allocation of the form 'new (p) X' for some object // pointer p (or an expression that will decay to such a pointer), - // diagnose the missing inclusion

[clang] [clang] Fix PointerAuth semantics of cpp_trivially_relocatable (PR #143969)

2025-06-16 Thread Oliver Hunt via cfe-commits
@@ -629,25 +629,46 @@ class ASTContext : public RefCountedBase { void setRelocationInfoForCXXRecord(const CXXRecordDecl *, CXXRecordDeclRelocationInfo); - /// Examines a given type, and returns whether the T itself + /// Examines a give

[clang] [clang] Fix PointerAuth semantics of cpp_trivially_relocatable (PR #143969)

2025-06-16 Thread Oliver Hunt via cfe-commits
@@ -629,25 +629,46 @@ class ASTContext : public RefCountedBase { void setRelocationInfoForCXXRecord(const CXXRecordDecl *, CXXRecordDeclRelocationInfo); - /// Examines a given type, and returns whether the T itself + /// Examines a give

[clang] [clang] Fix PointerAuth semantics of cpp_trivially_relocatable (PR #143969)

2025-06-16 Thread Oliver Hunt via cfe-commits
@@ -629,25 +629,46 @@ class ASTContext : public RefCountedBase { void setRelocationInfoForCXXRecord(const CXXRecordDecl *, CXXRecordDeclRelocationInfo); - /// Examines a given type, and returns whether the T itself + /// Examines a give

[compiler-rt] [libcxxabi] [libunwind] [runtimes][PAC] Harden unwinding when possible (#138571) (PR #143230)

2025-06-18 Thread Oliver Hunt via cfe-commits
@@ -30,6 +30,46 @@ EXCEPTION_DISPOSITION _GCC_specific_handler(PEXCEPTION_RECORD, void *, PCONTEXT, _Unwind_Personality_Fn); #endif +#if __has_include() +#include +#endif + +#if defined(__APPLE__) && __has_feature(ptrauth_qualifier

[clang] [Clang] Fix replaceability/relocatability computation (PR #145655)

2025-06-25 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt approved this pull request. r=me https://github.com/llvm/llvm-project/pull/145655 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix PointerAuth semantics of cpp_trivially_relocatable (PR #143969)

2025-06-16 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt closed https://github.com/llvm/llvm-project/pull/143969 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][PAC] Support trivially_relocating polymorphic objects (PR #144420)

2025-06-16 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt created https://github.com/llvm/llvm-project/pull/144420 Adds support for trivial relocation of polymorphic objects with address discriminated vtable pointers. This is implemented as a post-memmove fixup pass over the impacted objects. We do this by traversing the ob

[clang] [clang][PAC] Support trivially_relocating polymorphic objects (PR #144420)

2025-06-16 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/144420 >From b43a7e9295dfdbe0a11fb7dff669b82d8ed0630c Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Mon, 16 Jun 2025 20:48:57 +0300 Subject: [PATCH 1/2] [clang][PAC] Support trivially_relocating polymorphic objects

[clang] [clang][PAC] Support trivially_relocating polymorphic objects (PR #144420)

2025-06-16 Thread Oliver Hunt via cfe-commits
@@ -1727,6 +1727,11 @@ ASTContext::PointerAuthContent ASTContext::findPointerAuthContent(QualType T) { T = T.getCanonicalType(); if (T.hasAddressDiscriminatedPointerAuth()) return PointerAuthContent::AddressDiscriminatedData; + + T = getBaseElementType(T).getCanonical

[clang] [clang][PAC] Support trivially_relocating polymorphic objects (PR #144420)

2025-06-16 Thread Oliver Hunt via cfe-commits
@@ -420,6 +420,222 @@ void CodeGenFunction::EmitPointerAuthCopy(PointerAuthQualifier Qual, QualType T, Builder.CreateStore(Value, DestAddress); } +static const ConstantArrayType *tryGetTypeAsConstantArrayType(QualType T) { + if (!T->isConstantArrayType()) +return nullp

[clang] [ubsan] Remove -fsanitizer=vptr from -fsanitizer=undefined (PR #121115)

2025-06-06 Thread Oliver Hunt via cfe-commits
ojhunt wrote: This obviously cases https://github.com/llvm/llvm-project/issues/143065 @AaronBallman @erichkeane @zygoloid commented in the RFC - this change regresses the checks in ubsan for default compilation modes in order to make the use of sanitize=undefined easier in non-default scenario

[clang] [clang][NFC] Remove dead PassTypeToPlacementDelete field (PR #143448)

2025-06-09 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt created https://github.com/llvm/llvm-project/pull/143448 The CallDeleteDuringNew::PassTypeToPlacementDelete field became unneeded during the many refactorings of P2719 but I didn't actually remove it. >From c1fa0ea448210ab10e71bd7b2f4dc4d575056b39 Mon Sep 17 00:00:00

[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-06-09 Thread Oliver Hunt via cfe-commits
@@ -1434,10 +1446,13 @@ namespace { QualType ArgType; }; -unsigned NumPlacementArgs : 31; -LLVM_PREFERRED_TYPE(bool) +unsigned NumPlacementArgs : 30; +LLVM_PREFERRED_TYPE(AlignedAllocationMode) unsigned PassAlignmentToPlacementDelete : 1; +LL

[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-06-09 Thread Oliver Hunt via cfe-commits
@@ -1434,10 +1446,13 @@ namespace { QualType ArgType; }; -unsigned NumPlacementArgs : 31; -LLVM_PREFERRED_TYPE(bool) +unsigned NumPlacementArgs : 30; +LLVM_PREFERRED_TYPE(AlignedAllocationMode) unsigned PassAlignmentToPlacementDelete : 1; +LL

[clang] [clang][NFC] Remove dead PassTypeToPlacementDelete field (PR #143448)

2025-06-09 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt closed https://github.com/llvm/llvm-project/pull/143448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][NFC] Remove dead PassTypeToPlacementDelete field (PR #143448)

2025-06-09 Thread Oliver Hunt via cfe-commits
ojhunt wrote: > Thank you for the fix! sorry for the delay, just completely forgot about it https://github.com/llvm/llvm-project/pull/143448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

[clang] [clang][ptrauth] Add support for querying the ptrauth schema of a type (PR #138482)

2025-06-05 Thread Oliver Hunt via cfe-commits
@@ -3981,7 +3981,9 @@ class Parser : public CodeCompletionHandler { ExprResult ParseArrayTypeTrait(); ExprResult ParseExpressionTrait(); + ExprResult ParseBuiltinUnaryExprOrTypeTrait(UnaryExprOrTypeTrait ExprKind); ojhunt wrote: @cor3ntin @AaronBallman

[clang] [clang][ptrauth] Add support for querying the ptrauth schema of a type (PR #138482)

2025-06-05 Thread Oliver Hunt via cfe-commits
@@ -9619,6 +9620,65 @@ ObjCInterfaceDecl *ASTContext::getObjCProtocolDecl() const { return ObjCProtocolClassDecl; } +std::optional +ASTContext::getExplicitOrImplicitPointerAuth(QualType T) { + auto ExplicitQualifier = T.getPointerAuth(); + if (ExplicitQualifier.isPresent(

[clang] [clang][ptrauth] Add support for querying the ptrauth schema of a type (PR #138482)

2025-06-05 Thread Oliver Hunt via cfe-commits
@@ -9619,6 +9620,65 @@ ObjCInterfaceDecl *ASTContext::getObjCProtocolDecl() const { return ObjCProtocolClassDecl; } +std::optional +ASTContext::getExplicitOrImplicitPointerAuth(QualType T) { + auto ExplicitQualifier = T.getPointerAuth(); + if (ExplicitQualifier.isPresent(

[clang] [clang][ptrauth] Add support for querying the ptrauth schema of a type (PR #138482)

2025-06-05 Thread Oliver Hunt via cfe-commits
@@ -3981,7 +3981,9 @@ class Parser : public CodeCompletionHandler { ExprResult ParseArrayTypeTrait(); ExprResult ParseExpressionTrait(); + ExprResult ParseBuiltinUnaryExprOrTypeTrait(UnaryExprOrTypeTrait ExprKind); ojhunt wrote: ... if something like `Pa

[clang] [clang][ptrauth] Add support for querying the ptrauth schema of a type (PR #138482)

2025-06-05 Thread Oliver Hunt via cfe-commits
@@ -9619,6 +9620,65 @@ ObjCInterfaceDecl *ASTContext::getObjCProtocolDecl() const { return ObjCProtocolClassDecl; } +std::optional +ASTContext::getExplicitOrImplicitPointerAuth(QualType T) { + auto ExplicitQualifier = T.getPointerAuth(); ojhunt wrote: god

[clang] [clang][ptrauth] Add support for querying the ptrauth schema of a type (PR #138482)

2025-06-05 Thread Oliver Hunt via cfe-commits
@@ -9619,6 +9620,65 @@ ObjCInterfaceDecl *ASTContext::getObjCProtocolDecl() const { return ObjCProtocolClassDecl; } +std::optional +ASTContext::getExplicitOrImplicitPointerAuth(QualType T) { + auto ExplicitQualifier = T.getPointerAuth(); ojhunt wrote: - [

[clang] [clang][ptrauth] Add support for querying the ptrauth schema of a type (PR #138482)

2025-06-05 Thread Oliver Hunt via cfe-commits
@@ -605,6 +605,11 @@ KEYWORD(__private_extern__ , KEYALL) KEYWORD(__module_private__ , KEYALL) UNARY_EXPR_OR_TYPE_TRAIT(__builtin_ptrauth_type_discriminator, PtrAuthTypeDiscriminator, KEYALL) +UNARY_EXPR_OR_TYPE_TRAIT(__builtin_ptrauth_has_authentication, P

[clang] [PAuth] Use different discriminators for __int128_t / __uint128_t / _BitInt(n) (PR #140276)

2025-06-05 Thread Oliver Hunt via cfe-commits
@@ -1883,6 +1883,9 @@ void Clang::AddAArch64TargetArgs(const ArgList &Args, Args.addOptInFlag( CmdArgs, options::OPT_fptrauth_function_pointer_type_discrimination, options::OPT_fno_ptrauth_function_pointer_type_discrimination); + Args.addOptInFlag( --

[clang] [clang][PAC] add support for options parameter to __ptrauth (PR #136828)

2025-06-06 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/136828 >From 927380bdf377581e6e40507a12c374023352c613 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Wed, 30 Apr 2025 22:26:59 -0700 Subject: [PATCH 1/6] [clang][PAC] add support for options parameter to __ptrauth T

[clang] [Clang] Improve diagnostics for 'placement new' with const storage argument (PR #144270)

2025-06-23 Thread Oliver Hunt via cfe-commits
ojhunt wrote: @vbvictor super sorry, I'm feeling quite sick so can't really read the PR today, will probably not get to it until tomorrow https://github.com/llvm/llvm-project/pull/144270 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://

[clang] [clang] Fix PointerAuth semantics of cpp_trivially_relocatable (PR #143969)

2025-06-15 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/143969 >From f47680310ed68a9f8e8cb15bc1cd474740072463 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Thu, 12 Jun 2025 13:17:11 -0700 Subject: [PATCH 1/6] [clang] Fix PointerAuth semantics of cpp_trivially_relocatable

[clang] [clang] Fix PointerAuth semantics of cpp_trivially_relocatable (PR #143969)

2025-06-15 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/143969 >From f47680310ed68a9f8e8cb15bc1cd474740072463 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Thu, 12 Jun 2025 13:17:11 -0700 Subject: [PATCH 1/5] [clang] Fix PointerAuth semantics of cpp_trivially_relocatable

[clang] [clang] Fix PointerAuth semantics of cpp_trivially_relocatable (PR #143969)

2025-06-14 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/143969 >From f47680310ed68a9f8e8cb15bc1cd474740072463 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Thu, 12 Jun 2025 13:17:11 -0700 Subject: [PATCH 1/3] [clang] Fix PointerAuth semantics of cpp_trivially_relocatable

[clang] [clang] Fix PointerAuth semantics of cpp_trivially_relocatable (PR #143969)

2025-06-15 Thread Oliver Hunt via cfe-commits
ojhunt wrote: Very glad I didn't just assume my local build was sufficient and waited for the bots :D https://github.com/llvm/llvm-project/pull/143969 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

[clang] [clang] Fix PointerAuth semantics of cpp_trivially_relocatable (PR #143969)

2025-06-15 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/143969 >From f47680310ed68a9f8e8cb15bc1cd474740072463 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Thu, 12 Jun 2025 13:17:11 -0700 Subject: [PATCH 1/4] [clang] Fix PointerAuth semantics of cpp_trivially_relocatable

<    1   2   3   4   5   6   >