Debug info: Implement a cleaner version of r198461. For symmetry with

C and C++ don't emit an extra lexical scope for the compound statement
that is the body of an Objective-C method.

rdar://problem/15010825

llvm-svn: 198699
This commit is contained in:
Adrian Prantl
2014-01-07 19:24:24 +00:00
parent 70d4ba7f19
commit f5ff0dc29b
8 changed files with 15 additions and 22 deletions

View File

@@ -209,10 +209,9 @@ void CodeGenFunction::FinishFunction(SourceLocation EndLoc) {
// all will be fine.
if (CGDebugInfo *DI = getDebugInfo()) {
if (OnlySimpleReturnStmts)
DI->EmitLocation(Builder, LastStopPoint.first,
false, LastStopPoint.second);
DI->EmitLocation(Builder, LastStopPoint, false);
else
DI->EmitLocation(Builder, EndLoc, false, LastStopPoint.second);
DI->EmitLocation(Builder, EndLoc, false);
}
// Pop any cleanups that might have been associated with the
@@ -229,7 +228,7 @@ void CodeGenFunction::FinishFunction(SourceLocation EndLoc) {
if (CGDebugInfo *DI = getDebugInfo())
if (OnlySimpleReturnStmts)
DI->EmitLocation(Builder, EndLoc, false, LastStopPoint.second);
DI->EmitLocation(Builder, EndLoc, false);
}
// Emit function epilog (to return).