Properly set thread-local flag on globals during cpp emission
authorAnton Korobeynikov <asl@math.spbu.ru>
Thu, 13 May 2010 07:41:57 +0000 (07:41 +0000)
committerAnton Korobeynikov <asl@math.spbu.ru>
Thu, 13 May 2010 07:41:57 +0000 (07:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103702 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/CppBackend/CPPBackend.cpp

index 28345b29379e7891d1dcbd106c2512b12445ed84..45a0c84a4f0164625fea43bd6bb352e4d04768c6 100644 (file)
@@ -1038,6 +1038,11 @@ namespace {
       Out << ");";
       nl(Out);
     }
+    if (GV->isThreadLocal()) {
+      printCppName(GV);
+      Out << "->setThreadLocal(true);";
+      nl(Out);
+    }
     if (is_inline) {
       out(); Out << "}"; nl(Out);
     }