summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/MicrosoftCXXABI.cpp
diff options
context:
space:
mode:
authorTimur Iskhodzhanov <timurrrr@google.com>2013-04-17 12:54:10 +0000
committerTimur Iskhodzhanov <timurrrr@google.com>2013-04-17 12:54:10 +0000
commit8fe501dc0f8bb894392a0412b1736e826014bf58 (patch)
tree4628d2a8e037f20aa55d6b9c4793a202764fa75d /clang/lib/CodeGen/MicrosoftCXXABI.cpp
parent19a41f161b87b8827a53d8a3f3dbbf4d884ff7d6 (diff)
downloadbcm5719-llvm-8fe501dc0f8bb894392a0412b1736e826014bf58.tar.gz
bcm5719-llvm-8fe501dc0f8bb894392a0412b1736e826014bf58.zip
Set SRet flags properly in '-cxx-abi microsoft'.
Also, - abstract out the indirect/in memory/in registers decisions into the CGCXXABI - fix handling of empty struct arguments for '-cxx-abi microsoft' - add/fix tests llvm-svn: 179681
Diffstat (limited to 'clang/lib/CodeGen/MicrosoftCXXABI.cpp')
-rw-r--r--clang/lib/CodeGen/MicrosoftCXXABI.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/MicrosoftCXXABI.cpp b/clang/lib/CodeGen/MicrosoftCXXABI.cpp
index a0e4f4d3847..92bc538f207 100644
--- a/clang/lib/CodeGen/MicrosoftCXXABI.cpp
+++ b/clang/lib/CodeGen/MicrosoftCXXABI.cpp
@@ -28,6 +28,17 @@ class MicrosoftCXXABI : public CGCXXABI {
public:
MicrosoftCXXABI(CodeGenModule &CGM) : CGCXXABI(CGM) {}
+ bool isReturnTypeIndirect(const CXXRecordDecl *RD) const {
+ // Structures that are not C++03 PODs are always indirect.
+ return !RD->isPOD();
+ }
+
+ RecordArgABI getRecordArgABI(const CXXRecordDecl *RD) const {
+ if (RD->hasNonTrivialCopyConstructor())
+ return RAA_DirectInMemory;
+ return RAA_Default;
+ }
+
StringRef GetPureVirtualCallName() { return "_purecall"; }
// No known support for deleted functions in MSVC yet, so this choice is
// arbitrary.
OpenPOWER on IntegriCloud