Emit debug information for global and static variables when -g is specified.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51993 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGDebugInfo.h b/lib/CodeGen/CGDebugInfo.h
index 3e7835a..35d167c 100644
--- a/lib/CodeGen/CGDebugInfo.h
+++ b/lib/CodeGen/CGDebugInfo.h
@@ -32,6 +32,8 @@
   class TypeDesc;
   class VariableDesc;
   class SubprogramDesc;
+  class GlobalVariable;
+  class GlobalVariableDesc;
 }
 
 namespace clang {
@@ -63,8 +65,10 @@
   llvm::Function *RegionEndFn;
   llvm::AnchorDesc *CompileUnitAnchor;
   llvm::AnchorDesc *SubprogramAnchor;
+  llvm::AnchorDesc *GlobalVariableAnchor;
   std::vector<llvm::DebugInfoDesc *> RegionStack;
   std::vector<llvm::VariableDesc *> VariableDescList;
+  std::vector<llvm::GlobalVariableDesc *> GlobalVarDescList;
   llvm::SubprogramDesc *Subprogram;
 
   /// Helper functions for getOrCreateType.
@@ -105,6 +109,9 @@
   /// EmitDeclare - Emit call to llvm.dbg.declare for a variable declaration.
   void EmitDeclare(const VarDecl *decl, unsigned Tag, llvm::Value *AI,
                    llvm::IRBuilder &Builder);
+
+  /// EmitGlobalVariable - Emit information about a global variable.
+  void EmitGlobalVariable(llvm::GlobalVariable *GV, const VarDecl *decl);
  
   /// getOrCreateCompileUnit - Get the compile unit from the cache or create a
   /// new one if necessary.