Author: compnerd Date: Fri Oct 14 17:25:46 2016 New Revision: 284288 URL: http://llvm.org/viewvc/llvm-project?rev=284288&view=rev Log: 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. Added: cfe/trunk/test/CodeGenCXX/windows-itanium-dllexport.cpp Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=284288&r1=284287&r2=284288&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original) +++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Fri Oct 14 17:25:46 2016 @@ -5546,7 +5546,8 @@ void Sema::checkClassLevelDLLAttribute(C 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 Added: cfe/trunk/test/CodeGenCXX/windows-itanium-dllexport.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/windows-itanium-dllexport.cpp?rev=284288&view=auto ============================================================================== --- cfe/trunk/test/CodeGenCXX/windows-itanium-dllexport.cpp (added) +++ cfe/trunk/test/CodeGenCXX/windows-itanium-dllexport.cpp Fri Oct 14 17:25:46 2016 @@ -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 + _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits