From 65ad5a42cca954e070428dcc499b62393aa7a6d3 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Sun, 18 Apr 2010 21:01:23 +0000 Subject: Local static variables must be available module-wise as they are accessible in static methods in a class local to the same function. Fixes PR6769. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101756 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExpr.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/CodeGen/CGExpr.cpp') diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 68f09e2d29..257f2fc4f2 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -1106,6 +1106,8 @@ LValue CodeGenFunction::EmitDeclRefLValue(const DeclRefExpr *E) { bool NonGCable = VD->hasLocalStorage() && !VD->hasAttr(); llvm::Value *V = LocalDeclMap[VD]; + if (!V && VD->isStaticLocal()) + V = CGM.getStaticLocalDeclMap(VD); assert(V && "DeclRefExpr not entered in LocalDeclMap?"); Qualifiers Quals = MakeQualifiers(E->getType()); -- cgit v1.2.3