summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDecl.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-11-10 06:08:34 +0000
committerChris Lattner <sabre@nondot.org>2008-11-10 06:08:34 +0000
commitaffb37337fb313ccd2c45205d595bd47909096be (patch)
tree7f18e28a18a50e14ad93f72afe8301cb24fc2d78 /clang/lib/CodeGen/CGDecl.cpp
parent2a092395633776d6c868eece4f381a0cfadabaac (diff)
downloadbcm5719-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.cpp14
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);
}
-
}
OpenPOWER on IntegriCloud