diff options
author | Chris Lattner <sabre@nondot.org> | 2008-11-10 06:08:34 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-11-10 06:08:34 +0000 |
commit | 9c85ba33ac85bbf5915f300a4b228bad7c693ee7 (patch) | |
tree | 85cdfa0459102a72ab383e3f59ae0c6c847a2982 /lib/CodeGen/CGDecl.cpp | |
parent | 7d94e269d87fd5ae53d9b1c43578c70c184db2d3 (diff) |
reimplement debug info generation in terms of DebugInfo.h instead of
using MachineModuleInfo. This runs at about the same speed as the old
code, but fixes a bunch of bugs and is simpler and shorter.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58971 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDecl.cpp')
-rw-r--r-- | lib/CodeGen/CGDecl.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp index 788beb4410..e54c4b386d 100644 --- a/lib/CodeGen/CGDecl.cpp +++ b/lib/CodeGen/CGDecl.cpp @@ -21,7 +21,6 @@ #include "clang/Basic/TargetInfo.h" #include "llvm/GlobalVariable.h" #include "llvm/Type.h" -#include "llvm/Support/Dwarf.h" using namespace clang; using namespace CodeGen; @@ -174,11 +173,9 @@ void CodeGenFunction::EmitLocalBlockVarDecl(const VarDecl &D) { DMEntry = DeclPtr; // Emit debug info for local var declaration. - CGDebugInfo *DI = CGM.getDebugInfo(); - if(DI) { + if (CGDebugInfo *DI = CGM.getDebugInfo()) { DI->setLocation(D.getLocation()); - DI->EmitDeclare(&D, llvm::dwarf::DW_TAG_auto_variable, - DeclPtr, Builder); + DI->EmitDeclareOfAutoVariable(&D, DeclPtr, Builder); } // If this local has an initializer, emit it now. @@ -231,12 +228,9 @@ void CodeGenFunction::EmitParmDecl(const VarDecl &D, llvm::Value *Arg) { DMEntry = DeclPtr; // Emit debug info for param declaration. - CGDebugInfo *DI = CGM.getDebugInfo(); - if(DI) { + if (CGDebugInfo *DI = CGM.getDebugInfo()) { DI->setLocation(D.getLocation()); - DI->EmitDeclare(&D, llvm::dwarf::DW_TAG_arg_variable, - DeclPtr, Builder); + DI->EmitDeclareOfArgVariable(&D, DeclPtr, Builder); } - } |