aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/CGBlocks.cpp3
-rw-r--r--lib/CodeGen/CGDecl.cpp13
-rw-r--r--lib/CodeGen/CGExpr.cpp2
3 files changed, 9 insertions, 9 deletions
diff --git a/lib/CodeGen/CGBlocks.cpp b/lib/CodeGen/CGBlocks.cpp
index d62379e4ef..f1e7420681 100644
--- a/lib/CodeGen/CGBlocks.cpp
+++ b/lib/CodeGen/CGBlocks.cpp
@@ -608,8 +608,7 @@ CodeGenFunction::GenerateBlockFunction(const BlockExpr *BExpr,
++i) {
const VarDecl *VD = dyn_cast<VarDecl>(i->first);
- if (VD->getStorageClass() == VarDecl::Static
- || VD->getStorageClass() == VarDecl::Extern)
+ if (VD->getStorageClass() == VarDecl::Static || VD->hasExternalStorage())
LocalDeclMap[VD] = i->second;
}
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp
index 4cb4f5530b..c9e47eba77 100644
--- a/lib/CodeGen/CGDecl.cpp
+++ b/lib/CodeGen/CGDecl.cpp
@@ -68,18 +68,19 @@ void CodeGenFunction::EmitBlockVarDecl(const VarDecl &D) {
CGM.ErrorUnsupported(&D, "thread local ('__thread') variable", true);
switch (D.getStorageClass()) {
+ case VarDecl::None:
+ case VarDecl::Auto:
+ case VarDecl::Register:
+ return EmitLocalBlockVarDecl(D);
case VarDecl::Static:
return EmitStaticBlockVarDecl(D);
case VarDecl::Extern:
+ case VarDecl::PrivateExtern:
// Don't emit it now, allow it to be emitted lazily on its first use.
return;
- default:
- assert((D.getStorageClass() == VarDecl::None ||
- D.getStorageClass() == VarDecl::Auto ||
- D.getStorageClass() == VarDecl::Register) &&
- "Unknown storage class");
- return EmitLocalBlockVarDecl(D);
}
+
+ assert(0 && "Unknown storage class");
}
llvm::GlobalVariable *
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp
index fe16c4d30f..a1eb5c4e57 100644
--- a/lib/CodeGen/CGExpr.cpp
+++ b/lib/CodeGen/CGExpr.cpp
@@ -632,7 +632,7 @@ LValue CodeGenFunction::EmitDeclRefLValue(const DeclRefExpr *E) {
isa<ImplicitParamDecl>(VD))) {
LValue LV;
bool GCable = VD->hasLocalStorage() && ! VD->getAttr<BlocksAttr>();
- if (VD->getStorageClass() == VarDecl::Extern) {
+ if (VD->hasExternalStorage()) {
LV = LValue::MakeAddr(CGM.GetAddrOfGlobalVar(VD),
E->getType().getCVRQualifiers(),
getContext().getObjCGCAttrKind(E->getType()));