]> granicus.if.org Git - clang/commitdiff
[TLS on Darwin] treat all Darwin platforms in the same way.
authorManman Ren <manman.ren@gmail.com>
Wed, 11 Nov 2015 23:08:18 +0000 (23:08 +0000)
committerManman Ren <manman.ren@gmail.com>
Wed, 11 Nov 2015 23:08:18 +0000 (23:08 +0000)
rdar://problem/9001553

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252820 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CodeGenModule.cpp
lib/CodeGen/ItaniumCXXABI.cpp

index 5f4de74014f466d7fb437965579497fc3e2523b5..b587783c36ac1046b7f6324f95bfbb8b34af5299 100644 (file)
@@ -2323,7 +2323,7 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D) {
   // variable. This is to preserve the ability to change the implementation
   // behind the scenes.
   if (!D->isStaticLocal() && D->getTLSKind() == VarDecl::TLS_Dynamic &&
-      Context.getTargetInfo().getTriple().isMacOSX() &&
+      Context.getTargetInfo().getTriple().isOSDarwin() &&
       !llvm::GlobalVariable::isLinkOnceLinkage(Linkage) &&
       !llvm::GlobalVariable::isWeakLinkage(Linkage))
     Linkage = llvm::GlobalValue::InternalLinkage;
index a6402f233c3c541d69baa5529916818f324264f0..3b501c30e77ed2b9a14e62314a37685cc38c8be0 100644 (file)
@@ -2088,7 +2088,7 @@ static void emitGlobalDtorWithCXAAtExit(CodeGenFunction &CGF,
   const char *Name = "__cxa_atexit";
   if (TLS) {
     const llvm::Triple &T = CGF.getTarget().getTriple();
-    Name = T.isMacOSX() ?  "_tlv_atexit" : "__cxa_thread_atexit";
+    Name = T.isOSDarwin() ?  "_tlv_atexit" : "__cxa_thread_atexit";
   }
 
   // We're assuming that the destructor function is something we can
@@ -2144,10 +2144,10 @@ void ItaniumCXXABI::registerGlobalDtor(CodeGenFunction &CGF,
 static bool isThreadWrapperReplaceable(const VarDecl *VD,
                                        CodeGen::CodeGenModule &CGM) {
   assert(!VD->isStaticLocal() && "static local VarDecls don't need wrappers!");
-  // OS X prefers to have references to thread local variables to go through
+  // Darwin prefers to have references to thread local variables to go through
   // the thread wrapper instead of directly referencing the backing variable.
   return VD->getTLSKind() == VarDecl::TLS_Dynamic &&
-         CGM.getTarget().getTriple().isMacOSX();
+         CGM.getTarget().getTriple().isOSDarwin();
 }
 
 /// Get the appropriate linkage for the wrapper function. This is essentially