From: Saleem Abdulrasool Date: Fri, 14 Oct 2016 22:25:46 +0000 (+0000) Subject: Sema: honour dllexport in itanium more faithfully X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=caeec1284a5947666b43715a836a00f368ccddfe;p=clang 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@284288 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index b04bad2e87..93e626f7d3 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -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 diff --git a/test/CodeGenCXX/windows-itanium-dllexport.cpp b/test/CodeGenCXX/windows-itanium-dllexport.cpp new file mode 100644 index 0000000000..934c6a2961 --- /dev/null +++ b/test/CodeGenCXX/windows-itanium-dllexport.cpp @@ -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 +