[PATCH] D44649: Set dso_local for guid decls

Rafael Avila de Espindola via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 19 13:58:07 PDT 2018


espindola created this revision.
espindola added reviewers: rnk, echristo.

https://reviews.llvm.org/D44649

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


Index: test/CodeGenCXX/microsoft-templ-uuidof.cpp
===================================================================
--- test/CodeGenCXX/microsoft-templ-uuidof.cpp
+++ test/CodeGenCXX/microsoft-templ-uuidof.cpp
@@ -15,6 +15,8 @@
 
 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
 
Index: lib/CodeGen/CodeGenModule.cpp
===================================================================
--- lib/CodeGen/CodeGenModule.cpp
+++ lib/CodeGen/CodeGenModule.cpp
@@ -1921,6 +1921,7 @@
       /*isConstant=*/true, llvm::GlobalValue::LinkOnceODRLinkage, Init, Name);
   if (supportsCOMDAT())
     GV->setComdat(TheModule.getOrInsertComdat(GV->getName()));
+  setDSOLocal(GV);
   return ConstantAddress(GV, Alignment);
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44649.139002.patch
Type: text/x-patch
Size: 951 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180319/10934c54/attachment.bin>


More information about the cfe-commits mailing list