[clang] [clang][CodeGen] Fix MSVC ABI for classes with non static data members of reference type (PR #90547)

2024-05-02 Thread Max Winkler via cfe-commits
@@ -1131,13 +1132,18 @@ static bool isTrivialForMSVC(const CXXRecordDecl *RD, QualType Ty, return false; if (RD->hasNonTrivialCopyAssignment()) return false; + if (RD->needsImplicitCopyAssignment() && !RD->hasSimpleCopyAssignment()) MaxEW707 wrote:

[clang] [clang][CodeGen] Fix MSVC ABI for classes with non static data members of reference type (PR #90547)

2024-05-02 Thread Max Winkler via cfe-commits
https://github.com/MaxEW707 updated https://github.com/llvm/llvm-project/pull/90547 >From f404db44d3770cdb8ac5123c16c0b04314eda698 Mon Sep 17 00:00:00 2001 From: MaxEW707 Date: Mon, 29 Apr 2024 22:09:52 -0400 Subject: [PATCH 1/4] [clang][CodeGen] Fix MS ABI for classes with non static data

[clang] [clang][CodeGen] Fix MSVC ABI for classes with non static data members of reference type (PR #90547)

2024-04-30 Thread Max Winkler via cfe-commits
MaxEW707 wrote: > Maybe we should just be testing if the copy-assignment operator is deleted? > For reference, MSVC also returns the following indirectly: > > ``` > struct Test > { > int x; > Test& operator=(const Test&) = delete; > }; > Test foo(); > Test test(Test x) > { > return

[clang] [clang][CodeGen] Fix MSVC ABI for classes with non static data members of reference type (PR #90547)

2024-04-30 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic commented: Maybe we should just be testing if the copy-assignment operator is deleted? For reference, MSVC also returns the following indirectly: ``` struct Test { int x; Test& operator=(const Test&) = delete; }; Test foo(); Test test(Test x) {

[clang] [clang][CodeGen] Fix MSVC ABI for classes with non static data members of reference type (PR #90547)

2024-04-30 Thread Eli Friedman via cfe-commits
@@ -1144,11 +1167,13 @@ bool MicrosoftCXXABI::classifyReturnType(CGFunctionInfo ) const { if (!RD) return false; - bool isTrivialForABI = RD->canPassInRegisters() && - isTrivialForMSVC(RD, FI.getReturnType(), CGM); - // MSVC always returns

[clang] [clang][CodeGen] Fix MSVC ABI for classes with non static data members of reference type (PR #90547)

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

[clang] [clang][CodeGen] Fix MSVC ABI for classes with non static data members of reference type (PR #90547)

2024-04-29 Thread Max Winkler via cfe-commits
@@ -1144,11 +1167,13 @@ bool MicrosoftCXXABI::classifyReturnType(CGFunctionInfo ) const { if (!RD) return false; - bool isTrivialForABI = RD->canPassInRegisters() && - isTrivialForMSVC(RD, FI.getReturnType(), CGM); - // MSVC always returns

[clang] [clang][CodeGen] Fix MSVC ABI for classes with non static data members of reference type (PR #90547)

2024-04-29 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Max Winkler (MaxEW707) Changes https://godbolt.org/z/verKj4cnj for reference. https://godbolt.org/z/z3W9v7o4n for reference. For global functions and static methods the MSVC ABI returns structs/classes with a reference type non

[clang] [clang][CodeGen] Fix MSVC ABI for classes with non static data members of reference type (PR #90547)

2024-04-29 Thread Max Winkler via cfe-commits
https://github.com/MaxEW707 created https://github.com/llvm/llvm-project/pull/90547 https://godbolt.org/z/verKj4cnj for reference. https://godbolt.org/z/z3W9v7o4n for reference. For global functions and static methods the MSVC ABI returns structs/classes with a reference type non static data