diff options
author | Daniel Dunbar <daniel@zuster.org> | 2008-10-17 16:15:48 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2008-10-17 16:15:48 +0000 |
commit | 66031a5594bc9a7dc0dc5137c3e7955f835e4639 (patch) | |
tree | 799a56539bb2faf5f68cfc113b1cdcf87ddfe5fe /lib/CodeGen/CGDecl.cpp | |
parent | e5fd2d92cf8e5549f2ee7b2253b6730ee4aaa2db (diff) |
Change CGDebugInfo::setLocation to just ignore invalid locations. This
simplifies clients.
Also, add assert that RegionStack is empty when the CGDebugInfo is
destroyed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57684 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDecl.cpp')
-rw-r--r-- | lib/CodeGen/CGDecl.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp index 57e9c39832..fd2e357370 100644 --- a/lib/CodeGen/CGDecl.cpp +++ b/lib/CodeGen/CGDecl.cpp @@ -130,8 +130,7 @@ void CodeGenFunction::EmitStaticBlockVarDecl(const VarDecl &D) { // Emit global variable debug descriptor for static vars. CGDebugInfo *DI = CGM.getDebugInfo(); if(DI) { - if(D.getLocation().isValid()) - DI->setLocation(D.getLocation()); + DI->setLocation(D.getLocation()); DI->EmitGlobalVariable(static_cast<llvm::GlobalVariable *>(GV), &D); } @@ -177,8 +176,7 @@ void CodeGenFunction::EmitLocalBlockVarDecl(const VarDecl &D) { // Emit debug info for local var declaration. CGDebugInfo *DI = CGM.getDebugInfo(); if(DI) { - if(D.getLocation().isValid()) - DI->setLocation(D.getLocation()); + DI->setLocation(D.getLocation()); DI->EmitDeclare(&D, llvm::dwarf::DW_TAG_auto_variable, DeclPtr, Builder); } @@ -235,8 +233,7 @@ void CodeGenFunction::EmitParmDecl(const VarDecl &D, llvm::Value *Arg) { // Emit debug info for param declaration. CGDebugInfo *DI = CGM.getDebugInfo(); if(DI) { - if(D.getLocation().isValid()) - DI->setLocation(D.getLocation()); + DI->setLocation(D.getLocation()); DI->EmitDeclare(&D, llvm::dwarf::DW_TAG_arg_variable, DeclPtr, Builder); } |