]> granicus.if.org Git - clang/commitdiff
reject codegen of __thread variables as unimplemented, rdar://6775265
authorChris Lattner <sabre@nondot.org>
Fri, 10 Apr 2009 00:35:59 +0000 (00:35 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 10 Apr 2009 00:35:59 +0000 (00:35 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68755 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDecl.cpp
lib/CodeGen/CodeGenFunction.cpp
lib/CodeGen/CodeGenModule.cpp

index f0822675f8772b1be4873d2e733279a4562b8730..00eb8b477bad657bf9050cc7bab67359031ce96d 100644 (file)
@@ -63,6 +63,10 @@ void CodeGenFunction::EmitBlockVarDecl(const VarDecl &D) {
   if (D.getAttr<AsmLabelAttr>())
     CGM.ErrorUnsupported(&D, "__asm__");
   
+  // We don't support __thread yet.
+  if (D.isThreadSpecified())
+    CGM.ErrorUnsupported(&D, "__thread variable", true);
+  
   switch (D.getStorageClass()) {
   case VarDecl::Static:
     return EmitStaticBlockVarDecl(D);
index 5b63e6594d31ad1a130b862a9da653cb7878b846..b9a803286c4405ab55df35a50ee8781e7ffaf85c 100644 (file)
@@ -231,11 +231,10 @@ void CodeGenFunction::GenerateCode(const FunctionDecl *FD,
   EmitStmt(FD->getBody());
   
   const CompoundStmt *S = dyn_cast<CompoundStmt>(FD->getBody());
-  if (S) {
+  if (S)
     FinishFunction(S->getRBracLoc());
-  } else {
+  else
     FinishFunction();
-  }
     
   // Destroy the 'this' declaration.
   if (CXXThisDecl)
index eb190c79e1cb8c91169cb8181b413294b2bc4dac..6512dcef9b4dda0b36cf6ff20ec19a5b1999318b 100644 (file)
@@ -614,6 +614,10 @@ llvm::Constant *CodeGenModule::GetOrCreateLLVMGlobal(const char *MangledName,
     return llvm::ConstantExpr::getBitCast(Entry, Ty);
   }
   
+  // We don't support __thread yet.
+  if (D && D->isThreadSpecified())
+    ErrorUnsupported(D, "thread local ('__thread') variable", true);
+  
   // This is the first use or definition of a mangled name.  If there is a
   // deferred decl with this name, remember that we need to emit it at the end
   // of the file.
@@ -680,7 +684,7 @@ CodeGenModule::CreateRuntimeVariable(const llvm::Type *Ty,
 void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D) {
   llvm::Constant *Init = 0;
   QualType ASTTy = D->getType();
-
+  
   if (D->getInit() == 0) {
     // This is a tentative definition; tentative definitions are
     // implicitly initialized with { 0 }