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
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp
index 07d219f..58b9092 100644
--- a/lib/CodeGen/CGDecl.cpp
+++ b/lib/CodeGen/CGDecl.cpp
@@ -205,6 +205,7 @@
// Store into LocalDeclMap before generating initializer to handle
// circular references.
DMEntry = GV;
+ CGM.setStaticLocalDeclMap(&D, GV);
// Make sure to evaluate VLA bounds now so that we have them for later.
//