summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGDecl.cpp4
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp5
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp6
3 files changed, 11 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp
index f0822675f87..00eb8b477ba 100644
--- a/clang/lib/CodeGen/CGDecl.cpp
+++ b/clang/lib/CodeGen/CGDecl.cpp
@@ -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);
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 5b63e6594d3..b9a803286c4 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -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)
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index eb190c79e1c..6512dcef9b4 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -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 }
OpenPOWER on IntegriCloud