[clang] [clang] Fix loss of `dllexport` for exported template specialization (PR #93302)

2024-05-24 Thread Paul T Robinson via cfe-commits
@@ -4554,8 +4554,11 @@ llvm::Constant *CodeGenModule::GetOrCreateLLVMFunction( Entry->setLinkage(llvm::Function::ExternalLinkage); } -// Handle dropped DLL attributes. -if (D && !D->hasAttr() && !D->hasAttr() && +// Handle dropped dllimport. +if (D

[clang] [clang] Fix loss of `dllexport` for exported template specialization (PR #93302)

2024-05-24 Thread Paul T Robinson via cfe-commits
@@ -4849,9 +4852,12 @@ CodeGenModule::GetOrCreateLLVMGlobal(StringRef MangledName, llvm::Type *Ty, Entry->setLinkage(llvm::Function::ExternalLinkage); } -// Handle dropped DLL attributes. -if (D && !D->hasAttr() && !D->hasAttr() && -!shouldMapVisib

[clang] [clang][NFC] Split invalid-cpu-note tests (PR #104601)

2024-08-20 Thread Paul T Robinson via cfe-commits
pogo59 wrote: Totally worth it, thanks! https://github.com/llvm/llvm-project/pull/104601 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PS5][Driver] Link main components with -pie by default (PR #102901)

2024-08-20 Thread Paul T Robinson via cfe-commits
https://github.com/pogo59 approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/102901 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix null pointer dereference in enum debug info generation (PR #105556)

2024-08-22 Thread Paul T Robinson via cfe-commits
pogo59 wrote: The patch title and description claims more than it actually does. The assertion does not "fix" or prevent a null dereference, it's simply documenting a requirement. Please update the title and description. https://github.com/llvm/llvm-project/pull/105556

[clang] [PS5][clang][test] x86_64-scei-ps5 -> x86_64-sie-ps5 in tests (PR #105810)

2024-08-23 Thread Paul T Robinson via cfe-commits
https://github.com/pogo59 approved this pull request. I appreciate the pedantry. Internally these are equivalent, but SIE is the current company abbreviation so we should try to be consistent going forward. LGTM https://github.com/llvm/llvm-project/pull/105810 _

[clang] [Headers][X86] Add a couple of tests for MMX/SSE intrinsics (PR #105852)

2024-08-23 Thread Paul T Robinson via cfe-commits
https://github.com/pogo59 created https://github.com/llvm/llvm-project/pull/105852 Certain intrinsics map to builtins that require an immediate (literal) argument; make sure we report non-literal arguments. Also verify that shift intrinsics map to the expected builtins. These have been kickin

[clang] [clang][test] Rewrote test to work with lit internal shell syntax (PR #105902)

2024-08-26 Thread Paul T Robinson via cfe-commits
@@ -0,0 +1,22 @@ +import argparse pogo59 wrote: There is a lit substitution `%python` and I see a fair number of these in the lit tests. Some use inline python scripts, some have separate scripts, and a number of them have the python script directly in the test

[clang] [DebugInfo] Correct the line attribution for IF branches (PR #108300)

2024-09-11 Thread Paul T Robinson via cfe-commits
https://github.com/pogo59 created https://github.com/llvm/llvm-project/pull/108300 An 'if' statement introduces a scope, but in some cases the conditional branch to the then/else blocks had a debug-info attribution that did not include the scope. This led to some inefficiency in the DWARF line

[clang] [DebugInfo] Correct the line attribution for IF branches (PR #108300)

2024-09-11 Thread Paul T Robinson via cfe-commits
pogo59 wrote: This fixes the problem I describe in https://discourse.llvm.org/t/wrong-scope-in-dbg-on-a-branch-or-how-to-find-branchinst-create/81112 https://github.com/llvm/llvm-project/pull/108300 ___ cfe-commits mailing list cfe-commits@lists.llvm.

[clang] [DebugInfo] Correct the line attribution for IF branches (PR #108300)

2024-09-12 Thread Paul T Robinson via cfe-commits
@@ -0,0 +1,45 @@ +// RUN: %clang_cc1 -debug-info-kind=limited -gno-column-info -triple=x86_64-pc-linux -emit-llvm %s -o - | FileCheck %s + +// The important thing is that the compare and the conditional branch have +// locs with the same scope (the lexical block for the 'if'). B

[clang] [DebugInfo] Correct the line attribution for IF branches (PR #108300)

2024-09-12 Thread Paul T Robinson via cfe-commits
@@ -0,0 +1,45 @@ +// RUN: %clang_cc1 -debug-info-kind=limited -gno-column-info -triple=x86_64-pc-linux -emit-llvm %s -o - | FileCheck %s + +// The important thing is that the compare and the conditional branch have +// locs with the same scope (the lexical block for the 'if'). B

[clang] [DebugInfo] Correct the line attribution for IF branches (PR #108300)

2024-09-13 Thread Paul T Robinson via cfe-commits
@@ -0,0 +1,45 @@ +// RUN: %clang_cc1 -debug-info-kind=limited -gno-column-info -triple=x86_64-pc-linux -emit-llvm %s -o - | FileCheck %s + +// The important thing is that the compare and the conditional branch have +// locs with the same scope (the lexical block for the 'if'). B

[clang] [PS5][Driver] Pass default -z options to PS5 linker (PR #113162)

2024-10-22 Thread Paul T Robinson via cfe-commits
@@ -240,11 +242,32 @@ void tools::PS5cpu::Linker::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back( Args.MakeArgString("--sysroot=" + TC.getSDKLibraryRootDir())); - // Default to PIE for non-static executables. - const bool PIE = - !Args.hasA

[clang] [PS5][Driver] Pass default -z options to PS5 linker (PR #113162)

2024-10-22 Thread Paul T Robinson via cfe-commits
@@ -240,11 +242,32 @@ void tools::PS5cpu::Linker::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back( Args.MakeArgString("--sysroot=" + TC.getSDKLibraryRootDir())); - // Default to PIE for non-static executables. - const bool PIE = - !Args.hasA

[clang] [PS5][Driver] Pass layout metrics to the linker (PR #114435)

2024-11-01 Thread Paul T Robinson via cfe-commits
https://github.com/pogo59 approved this pull request. https://github.com/llvm/llvm-project/pull/114435 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PS5][Driver] Supply libraries and CRT objects to the linker (PR #115497)

2024-11-11 Thread Paul T Robinson via cfe-commits
pogo59 wrote: FWIW, IMO the implicit-check-not idea was worth trying, but not worth keeping. Up to @jmorse though. https://github.com/llvm/llvm-project/pull/115497 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/

[clang] [PS5][Driver] Pass layout metrics to the linker (PR #114435)

2024-10-31 Thread Paul T Robinson via cfe-commits
@@ -21,6 +21,22 @@ // CHECK-NO-PIE-NOT: "-pie" // CHECK-SHARED: "--shared" +// Test the driver supplies an --image-base to the linker only for non-pie +// executables. + +// RUN: %clang --target=x86_64-sie-ps5 -static %s -### 2>&1 | FileCheck --check-prefixes=CHECK-BASE %s +/

[clang] [PS5][Driver] Pass layout metrics to the linker (PR #114435)

2024-10-31 Thread Paul T Robinson via cfe-commits
@@ -295,6 +302,9 @@ void tools::PS5cpu::Linker::ConstructJob(Compilation &C, const JobAction &JA, if (Shared) CmdArgs.push_back("--shared"); + if (!Relocatable && !Shared && !PIE) pogo59 wrote: Does this want to consider `Static` as well? Just wonderi

[clang] [llvm] [clang] Add "debug_transparent" attribute (PR #109490)

2024-09-23 Thread Paul T Robinson via cfe-commits
@@ -109,6 +110,21 @@ static bool IsArtificial(VarDecl const *VD) { cast(VD->getDeclContext())->isImplicit()); } +static bool usesDebugTransparent(const Decl *D, const CodeGenModule &CGM) { + if (!D) +return false; + + if (auto *attr = D->get

[clang] [llvm] [clang] Add "debug_transparent" attribute (PR #109490)

2024-09-23 Thread Paul T Robinson via cfe-commits
@@ -1379,6 +1379,9 @@ void DwarfUnit::applySubprogramAttributes(const DISubprogram *SP, DIE &SPDie, if (!SP->getTargetFuncName().empty()) addString(SPDie, dwarf::DW_AT_trampoline, SP->getTargetFuncName()); + if (SP->isDebugTransparent()) pogo59 wrote:

[clang] [DebugInfo] Correct the line attribution for IF branches (PR #108300)

2024-09-23 Thread Paul T Robinson via cfe-commits
https://github.com/pogo59 closed https://github.com/llvm/llvm-project/pull/108300 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [DebugInfo] Correct the line attribution for IF branches (PR #108300)

2024-09-23 Thread Paul T Robinson via cfe-commits
pogo59 wrote: Wow, better than I expected, considering that .debug_line is not one of the larger sections. https://github.com/llvm/llvm-project/pull/108300 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/

[clang] [llvm] [clang] Add "debug_transparent" attribute (PR #109490)

2024-09-23 Thread Paul T Robinson via cfe-commits
pogo59 wrote: My first thought was "why not use the nodebug attribute" but looking back at the Phab review, that question was raised and answered there. But I thought it was worth mentioning here. https://github.com/llvm/llvm-project/pull/109490 ___

[clang] [PS4, PS5][Driver] Pass `-L<...>/target/lib -L.` to linker (PR #109796)

2024-09-24 Thread Paul T Robinson via cfe-commits
@@ -46,3 +46,26 @@ // CHECK-SYSROOT: {{ld(\.exe)?}}" // CHECK-SYSROOT-SAME: "--sysroot=mysdk" + +// Test that "." is always added to library search paths. This is long-standing +// behavior, unique to PlayStation toolchains. + +// RUN: %clang --target=x64_64-sie-ps5 %s -### 2>

[clang] [PS4, PS5][Driver] Pass `-L<...>/target/lib -L.` to linker (PR #109796)

2024-09-24 Thread Paul T Robinson via cfe-commits
@@ -46,3 +46,26 @@ // CHECK-SYSROOT: {{ld(\.exe)?}}" // CHECK-SYSROOT-SAME: "--sysroot=mysdk" + +// Test that "." is always added to library search paths. This is long-standing +// behavior, unique to PlayStation toolchains. + +// RUN: %clang --target=x64_64-sie-ps5 %s -### 2>

[clang] [PS4, PS5][Driver] Pass `-L<...>/target/lib -L.` to linker (PR #109796)

2024-09-24 Thread Paul T Robinson via cfe-commits
@@ -46,3 +46,26 @@ // CHECK-SYSROOT: {{ld(\.exe)?}}" // CHECK-SYSROOT-SAME: "--sysroot=mysdk" + +// Test that "." is always added to library search paths. This is long-standing +// behavior, unique to PlayStation toolchains. + +// RUN: %clang --target=x64_64-sie-ps5 %s -### 2>

[clang] [PS4, PS5][Driver] Pass `-L<...>/target/lib -L.` to linker (PR #109796)

2024-09-24 Thread Paul T Robinson via cfe-commits
https://github.com/pogo59 approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/109796 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [DebugInfo] Correct the line attribution for IF branches (PR #108300)

2024-09-27 Thread Paul T Robinson via cfe-commits
pogo59 wrote: Filed #110313 as the followup for looking at the `for` statement. https://github.com/llvm/llvm-project/pull/108300 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2024-10-03 Thread Paul T Robinson via cfe-commits
https://github.com/pogo59 commented: It seems a little odd to have only positive forms of these flags; usually toggles would have both positive and negative forms. Maybe @MaskRay has an opinion? The release note doesn't say: Does `-fextend-lifetimes` imply `-fextend-this-pointer`? They're imp

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2024-12-03 Thread Paul T Robinson via cfe-commits
@@ -1353,6 +1353,19 @@ void CodeGenFunction::EmitLifetimeEnd(llvm::Value *Size, llvm::Value *Addr) { C->setDoesNotThrow(); } +void CodeGenFunction::EmitFakeUse(Address Addr) { + // We do not emit a fake use if we want to apply optnone to this function, + // even if we mig

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2024-12-04 Thread Paul T Robinson via cfe-commits
@@ -1353,6 +1353,19 @@ void CodeGenFunction::EmitLifetimeEnd(llvm::Value *Size, llvm::Value *Addr) { C->setDoesNotThrow(); } +void CodeGenFunction::EmitFakeUse(Address Addr) { + // We do not emit a fake use if we want to apply optnone to this function, + // even if we mig

[clang] [llvm] [clang][DebugInfo] Emit DW_AT_object_pointer on function declarations with explicit `this` (PR #122928)

2025-01-23 Thread Paul T Robinson via cfe-commits
pogo59 wrote: The C API must remain stable and backward compatible. It's the C++ APIs that we are willing to change without worrying. https://github.com/llvm/llvm-project/pull/122928 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://list

[clang] [llvm] [clang][DebugInfo] Emit DW_AT_object_pointer on function declarations with explicit `this` (PR #122928)

2025-01-23 Thread Paul T Robinson via cfe-commits
pogo59 wrote: Aha. I didn't know or had forgotten about the exception. The breakage isn't great but is allowed. https://github.com/llvm/llvm-project/pull/122928 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2025-01-24 Thread Paul T Robinson via cfe-commits
@@ -3595,15 +3595,26 @@ static llvm::StoreInst *findDominatingStoreToReturnValue(CodeGenFunction &CGF) { llvm::BasicBlock *IP = CGF.Builder.GetInsertBlock(); if (IP->empty()) return nullptr; -// Look at directly preceding instruction, skipping bitcasts and lifetim

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2025-01-24 Thread Paul T Robinson via cfe-commits
@@ -87,6 +87,10 @@ class EHScope { LLVM_PREFERRED_TYPE(bool) unsigned IsLifetimeMarker : 1; +/// Whether this cleanup is a fake use pogo59 wrote: Full-stop at the end https://github.com/llvm/llvm-project/pull/110102 __

<    1   2   3   4