Set dso_local for guid decls.
authorRafael Espindola <rafael.espindola@gmail.com>
Tue, 20 Mar 2018 15:42:58 +0000 (15:42 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Tue, 20 Mar 2018 15:42:58 +0000 (15:42 +0000)
llvm-svn: 327991

clang/lib/CodeGen/CodeGenModule.cpp
clang/test/CodeGenCXX/microsoft-templ-uuidof.cpp

index a47c1c6..310fb8e 100644 (file)
@@ -1921,6 +1921,7 @@ ConstantAddress CodeGenModule::GetAddrOfUuidDescriptor(
       /*isConstant=*/true, llvm::GlobalValue::LinkOnceODRLinkage, Init, Name);
   if (supportsCOMDAT())
     GV->setComdat(TheModule.getOrInsertComdat(GV->getName()));
+  setDSOLocal(GV);
   return ConstantAddress(GV, Alignment);
 }
 
index 4d30a6f..7d40a15 100644 (file)
@@ -15,6 +15,8 @@ struct __declspec(uuid("{BBBBBBBB-BBBB-BBBB-BBBB-BBBBBBBBBBBB}")) X<B> {};
 
 struct __declspec(uuid("{CCCCCCCC-CCCC-CCCC-CCCC-CCCCCCCCCCCC}")) C {};
 
+// CHECK-DAG: @_GUID_aaaaaaaa_aaaa_aaaa_aaaa_aaaaaaaaaaaa = linkonce_odr dso_local
+
 const _GUID &xa = __uuidof(X<A>);
 // CHECK-DAG:  @"?xa@@3ABU_GUID@@B" = {{.*}} @_GUID_aaaaaaaa_aaaa_aaaa_aaaa_aaaaaaaaaaaa