Sema: honour dllexport in itanium more faithfully

Although the itanium environment uses the itanium layout for C++, treat the
dllexport semantics more similarly to the MSVC specification.  This preserves
the existing behaviour for the use of the itanium ABI on non-windows-itanium
environments.  Export the inline definitions too.

llvm-svn: 284288
This commit is contained in:
Saleem Abdulrasool 2016-10-14 22:25:46 +00:00
parent 69fa84a6e9
commit 8bbc3158c3
2 changed files with 11 additions and 1 deletions

View File

@ -5546,7 +5546,8 @@ void Sema::checkClassLevelDLLAttribute(CXXRecordDecl *Class) {
if (MD->isInlined()) {
// MinGW does not import or export inline methods.
if (!Context.getTargetInfo().getCXXABI().isMicrosoft())
if (!Context.getTargetInfo().getCXXABI().isMicrosoft() &&
!Context.getTargetInfo().getTriple().isWindowsItaniumEnvironment())
continue;
// MSVC versions before 2015 don't export the move assignment operators

View File

@ -0,0 +1,9 @@
// RUN: %clang_cc1 -emit-llvm -triple i686-windows-itanium -fdeclspec %s -o - | FileCheck %s
struct __declspec(dllexport) s {
void f() {}
};
// CHECK: define {{.*}} dllexport {{.*}} @_ZN1saSERKS_
// CHECK: define {{.*}} dllexport {{.*}} @_ZN1s1fEv