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 | affb37337fb313ccd2c45205d595bd47909096be (patch) | |
tree | 7f18e28a18a50e14ad93f72afe8301cb24fc2d78 /clang/lib/CodeGen/CGDecl.cpp | |
parent | 2a092395633776d6c868eece4f381a0cfadabaac (diff) | |
download | bcm5719-llvm-affb37337fb313ccd2c45205d595bd47909096be.tar.gz bcm5719-llvm-affb37337fb313ccd2c45205d595bd47909096be.zip |
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.
llvm-svn: 58971
Diffstat (limited to 'clang/lib/CodeGen/CGDecl.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDecl.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp index 788beb44106..e54c4b386db 100644 --- a/clang/lib/CodeGen/CGDecl.cpp +++ b/clang/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); } - } |