This revision was automatically updated to reflect the committed changes.
Closed by commit rL286419: [Sema] Use MS ABI behavior for dllexport in Itanium 
(authored by smeenai).

Changed prior to commit:
  https://reviews.llvm.org/D26471?vs=77392&id=77418#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D26471

Files:
  cfe/trunk/lib/Sema/SemaTemplate.cpp
  cfe/trunk/test/CodeGenCXX/windows-itanium-dllexport.cpp


Index: cfe/trunk/test/CodeGenCXX/windows-itanium-dllexport.cpp
===================================================================
--- cfe/trunk/test/CodeGenCXX/windows-itanium-dllexport.cpp
+++ cfe/trunk/test/CodeGenCXX/windows-itanium-dllexport.cpp
@@ -7,3 +7,19 @@
 // CHECK: define {{.*}} dllexport {{.*}} @_ZN1saSERKS_
 // CHECK: define {{.*}} dllexport {{.*}} @_ZN1s1fEv
 
+template <class T>
+class c {
+  void f() {}
+};
+
+template class __declspec(dllexport) c<int>;
+
+// CHECK: define {{.*}} dllexport {{.*}} @_ZN1cIiEaSERKS0_
+// CHECK: define {{.*}} dllexport {{.*}} @_ZN1cIiE1fEv
+
+extern template class c<char>;
+template class __declspec(dllexport) c<char>;
+
+// CHECK: define {{.*}} dllexport {{.*}} @_ZN1cIcEaSERKS0_
+// CHECK: define {{.*}} dllexport {{.*}} @_ZN1cIcE1fEv
+
Index: cfe/trunk/lib/Sema/SemaTemplate.cpp
===================================================================
--- cfe/trunk/lib/Sema/SemaTemplate.cpp
+++ cfe/trunk/lib/Sema/SemaTemplate.cpp
@@ -7674,7 +7674,8 @@
       Def->setTemplateSpecializationKind(TSK);
 
       if (!getDLLAttr(Def) && getDLLAttr(Specialization) &&
-          Context.getTargetInfo().getCXXABI().isMicrosoft()) {
+          (Context.getTargetInfo().getCXXABI().isMicrosoft() ||
+           Context.getTargetInfo().getTriple().isWindowsItaniumEnvironment())) 
{
         // In the MS ABI, an explicit instantiation definition can add a dll
         // attribute to a template with a previous instantiation declaration.
         // MinGW doesn't allow this.


Index: cfe/trunk/test/CodeGenCXX/windows-itanium-dllexport.cpp
===================================================================
--- cfe/trunk/test/CodeGenCXX/windows-itanium-dllexport.cpp
+++ cfe/trunk/test/CodeGenCXX/windows-itanium-dllexport.cpp
@@ -7,3 +7,19 @@
 // CHECK: define {{.*}} dllexport {{.*}} @_ZN1saSERKS_
 // CHECK: define {{.*}} dllexport {{.*}} @_ZN1s1fEv
 
+template <class T>
+class c {
+  void f() {}
+};
+
+template class __declspec(dllexport) c<int>;
+
+// CHECK: define {{.*}} dllexport {{.*}} @_ZN1cIiEaSERKS0_
+// CHECK: define {{.*}} dllexport {{.*}} @_ZN1cIiE1fEv
+
+extern template class c<char>;
+template class __declspec(dllexport) c<char>;
+
+// CHECK: define {{.*}} dllexport {{.*}} @_ZN1cIcEaSERKS0_
+// CHECK: define {{.*}} dllexport {{.*}} @_ZN1cIcE1fEv
+
Index: cfe/trunk/lib/Sema/SemaTemplate.cpp
===================================================================
--- cfe/trunk/lib/Sema/SemaTemplate.cpp
+++ cfe/trunk/lib/Sema/SemaTemplate.cpp
@@ -7674,7 +7674,8 @@
       Def->setTemplateSpecializationKind(TSK);
 
       if (!getDLLAttr(Def) && getDLLAttr(Specialization) &&
-          Context.getTargetInfo().getCXXABI().isMicrosoft()) {
+          (Context.getTargetInfo().getCXXABI().isMicrosoft() ||
+           Context.getTargetInfo().getTriple().isWindowsItaniumEnvironment())) {
         // In the MS ABI, an explicit instantiation definition can add a dll
         // attribute to a template with a previous instantiation declaration.
         // MinGW doesn't allow this.
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to