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.
llvm-svn: 101756
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp
index 07d219f..58b9092 100644
--- a/clang/lib/CodeGen/CGDecl.cpp
+++ b/clang/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.
//