[cfe-commits] r68755 - in /cfe/trunk/lib/CodeGen: CGDecl.cpp CodeGenFunction.cpp CodeGenModule.cpp

Chris Lattner sabre at nondot.org
Thu Apr 9 17:35:59 PDT 2009


Author: lattner
Date: Thu Apr  9 19:35:59 2009
New Revision: 68755

URL: http://llvm.org/viewvc/llvm-project?rev=68755&view=rev
Log:
reject codegen of __thread variables as unimplemented, rdar://6775265

Modified:
    cfe/trunk/lib/CodeGen/CGDecl.cpp
    cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
    cfe/trunk/lib/CodeGen/CodeGenModule.cpp

Modified: cfe/trunk/lib/CodeGen/CGDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDecl.cpp?rev=68755&r1=68754&r2=68755&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGDecl.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDecl.cpp Thu Apr  9 19:35:59 2009
@@ -63,6 +63,10 @@
   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);

Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.cpp?rev=68755&r1=68754&r2=68755&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.cpp Thu Apr  9 19:35:59 2009
@@ -231,11 +231,10 @@
   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)

Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=68755&r1=68754&r2=68755&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Thu Apr  9 19:35:59 2009
@@ -614,6 +614,10 @@
     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 @@
 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 }





More information about the cfe-commits mailing list