Emit parameter and local variable debug information with -g.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51765 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGDebugInfo.h b/lib/CodeGen/CGDebugInfo.h
index 4e6626f..3e7835a 100644
--- a/lib/CodeGen/CGDebugInfo.h
+++ b/lib/CodeGen/CGDebugInfo.h
@@ -30,11 +30,13 @@
class DebugInfoDesc;
class Value;
class TypeDesc;
+ class VariableDesc;
class SubprogramDesc;
}
namespace clang {
class FunctionDecl;
+ class VarDecl;
namespace CodeGen {
class CodeGenModule;
@@ -61,7 +63,8 @@
llvm::Function *RegionEndFn;
llvm::AnchorDesc *CompileUnitAnchor;
llvm::AnchorDesc *SubprogramAnchor;
- std::vector<llvm::DebugInfoDesc *> RegionStack;
+ std::vector<llvm::DebugInfoDesc *> RegionStack;
+ std::vector<llvm::VariableDesc *> VariableDescList;
llvm::SubprogramDesc *Subprogram;
/// Helper functions for getOrCreateType.
@@ -98,6 +101,10 @@
/// EmitRegionEnd - Emit call to llvm.dbg.region.end to indicate end of a
/// block.
void EmitRegionEnd(llvm::Function *Fn, llvm::IRBuilder &Builder);
+
+ /// EmitDeclare - Emit call to llvm.dbg.declare for a variable declaration.
+ void EmitDeclare(const VarDecl *decl, unsigned Tag, llvm::Value *AI,
+ llvm::IRBuilder &Builder);
/// getOrCreateCompileUnit - Get the compile unit from the cache or create a
/// new one if necessary.