summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/MicrosoftCXXABI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/MicrosoftCXXABI.cpp')
-rw-r--r--clang/lib/CodeGen/MicrosoftCXXABI.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/MicrosoftCXXABI.cpp b/clang/lib/CodeGen/MicrosoftCXXABI.cpp
index 875591d0df9..3433c8ca30c 100644
--- a/clang/lib/CodeGen/MicrosoftCXXABI.cpp
+++ b/clang/lib/CodeGen/MicrosoftCXXABI.cpp
@@ -45,8 +45,14 @@ public:
}
RecordArgABI getRecordArgABI(const CXXRecordDecl *RD) const {
- if (RD->hasNonTrivialCopyConstructor() || RD->hasNonTrivialDestructor())
- return RAA_DirectInMemory;
+ if (RD->hasNonTrivialCopyConstructor() || RD->hasNonTrivialDestructor()) {
+ llvm::Triple::ArchType Arch = CGM.getTarget().getTriple().getArch();
+ if (Arch == llvm::Triple::x86)
+ return RAA_DirectInMemory;
+ // On x64, pass non-trivial records indirectly.
+ // FIXME: Test other Windows architectures.
+ return RAA_Indirect;
+ }
return RAA_Default;
}
OpenPOWER on IntegriCloud