Change CGDebugInfo::setLocation to just ignore invalid locations. This

simplifies clients.

Also, add assert that RegionStack is empty when the CGDebugInfo is
destroyed.

llvm-svn: 57684
This commit is contained in:
Daniel Dunbar
2008-10-17 16:15:48 +00:00
parent 472175e545
commit b9fd902fdc
6 changed files with 16 additions and 23 deletions

View File

@@ -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);
}