summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2014-01-07 22:05:52 +0000
committerAdrian Prantl <aprantl@apple.com>2014-01-07 22:05:52 +0000
commite83b130defce6ff6ee69c300c14eec52cabadc88 (patch)
tree9bc431d4fc921f2a655bac0434af56ce12c10ac9 /clang
parentc6758879b3b048e334a84f436cae47f2c314be0b (diff)
downloadbcm5719-llvm-e83b130defce6ff6ee69c300c14eec52cabadc88.tar.gz
bcm5719-llvm-e83b130defce6ff6ee69c300c14eec52cabadc88.zip
Revert "Debug info: Ensure that the last stop point in a function is still within"
This reverts commit r198461. llvm-svn: 198714
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp5
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.h8
-rw-r--r--clang/lib/CodeGen/CGStmt.cpp2
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp7
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.h2
-rw-r--r--clang/test/CodeGenCXX/linetable-cleanup.cpp6
-rw-r--r--clang/test/CodeGenObjC/arc-linetable.m5
7 files changed, 11 insertions, 24 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 3138d82fb8b..2977ed22230 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -2537,8 +2537,7 @@ void CGDebugInfo::EmitFunctionStart(GlobalDecl GD, QualType FnType,
/// information in the source file. If the location is invalid, the
/// previous location will be reused.
void CGDebugInfo::EmitLocation(CGBuilderTy &Builder, SourceLocation Loc,
- bool ForceColumnInfo,
- llvm::MDNode *ForceScope) {
+ bool ForceColumnInfo) {
// Update our current location
setLocation(Loc);
@@ -2557,7 +2556,7 @@ void CGDebugInfo::EmitLocation(CGBuilderTy &Builder, SourceLocation Loc,
// Update last state.
PrevLoc = CurLoc;
- llvm::MDNode *Scope = ForceScope ? ForceScope : &*LexicalBlockStack.back();
+ llvm::MDNode *Scope = LexicalBlockStack.back();
Builder.SetCurrentDebugLocation(llvm::DebugLoc::get
(getLineNumber(CurLoc),
getColumnNumber(CurLoc, ForceColumnInfo),
diff --git a/clang/lib/CodeGen/CGDebugInfo.h b/clang/lib/CodeGen/CGDebugInfo.h
index ac31bdf3f58..0ca274f5688 100644
--- a/clang/lib/CodeGen/CGDebugInfo.h
+++ b/clang/lib/CodeGen/CGDebugInfo.h
@@ -211,17 +211,11 @@ public:
/// getLocation - Return the current source location.
SourceLocation getLocation() const { return CurLoc; }
- /// getScope() - Return the current scope.
- llvm::MDNode *getScope() const { return LexicalBlockStack.back(); }
-
/// EmitLocation - Emit metadata to indicate a change in line/column
/// information in the source file.
/// \param ForceColumnInfo Assume DebugColumnInfo option is true.
- /// \param ForceScope Force the location to be in a specific lexical
- /// scope rather than the top of LexicalBlockStack.
void EmitLocation(CGBuilderTy &Builder, SourceLocation Loc,
- bool ForceColumnInfo = false,
- llvm::MDNode *ForceScope = 0);
+ bool ForceColumnInfo = false);
/// EmitFunctionStart - Emit a call to llvm.dbg.function.start to indicate
/// start of a new function.
diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp
index 50882c8536b..b18ff09015a 100644
--- a/clang/lib/CodeGen/CGStmt.cpp
+++ b/clang/lib/CodeGen/CGStmt.cpp
@@ -37,7 +37,7 @@ void CodeGenFunction::EmitStopPoint(const Stmt *S) {
Loc = S->getLocStart();
DI->EmitLocation(Builder, Loc);
- LastStopPoint = std::make_pair(Loc, DI->getScope());
+ LastStopPoint = Loc;
}
}
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index fb668e4a168..c1e522d0d74 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -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);
else
- DI->EmitLocation(Builder, EndLoc, false, LastStopPoint.second);
+ DI->EmitLocation(Builder, EndLoc);
}
// 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);
}
// Emit function epilog (to return).
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index c11f2c91729..37bbcf3f342 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -877,7 +877,7 @@ private:
unsigned NumSimpleReturnExprs;
/// The last regular (non-return) debug location (breakpoint) in the function.
- std::pair<SourceLocation, llvm::MDNode*> LastStopPoint;
+ SourceLocation LastStopPoint;
public:
/// A scope within which we are constructing the fields of an object which
diff --git a/clang/test/CodeGenCXX/linetable-cleanup.cpp b/clang/test/CodeGenCXX/linetable-cleanup.cpp
index ce7f2c674ba..96b85722526 100644
--- a/clang/test/CodeGenCXX/linetable-cleanup.cpp
+++ b/clang/test/CodeGenCXX/linetable-cleanup.cpp
@@ -46,14 +46,12 @@ void bar()
void baz()
{
if (!foo())
- // CHECK: ![[SCOPE1:.*]] = metadata !{{{.*}}, i32 [[@LINE-1]], {{.*}}} ; [ DW_TAG_lexical_block ]
- // CHECK: {{.*}} = metadata !{i32 [[@LINE+1]], i32 0, metadata ![[SCOPE1]], null}
+ // CHECK: {{.*}} = metadata !{i32 [[@LINE+1]], i32 0, metadata !{{.*}}, null}
return;
if (foo()) {
// no cleanup
- // CHECK: {{.*}} = metadata !{i32 [[@LINE+2]], i32 0, metadata ![[SCOPE2:.*]], null}
- // CHECK: ![[SCOPE2]] = metadata !{{{.*}}, i32 [[@LINE-3]], {{.*}}} ; [ DW_TAG_lexical_block ]
+ // CHECK: {{.*}} = metadata !{i32 [[@LINE+1]], i32 0, metadata !{{.*}}, null}
return;
}
// CHECK: ![[RETBAZ]] = metadata !{i32 [[@LINE+1]], i32 0, metadata !{{.*}}, null}
diff --git a/clang/test/CodeGenObjC/arc-linetable.m b/clang/test/CodeGenObjC/arc-linetable.m
index 34b7d7640fa..eac91f18890 100644
--- a/clang/test/CodeGenObjC/arc-linetable.m
+++ b/clang/test/CodeGenObjC/arc-linetable.m
@@ -47,11 +47,8 @@
@implementation AppDelegate : NSObject
-// CHECK: ![[TESTNOSIDEEFFECT:.*]] = {{.*}}[ DW_TAG_subprogram ] [line [[@LINE+1]]] [local] [def] [-[AppDelegate testNoSideEffect:]]
- (int)testNoSideEffect:(NSString *)foo {
- // CHECK: ![[COMPOUND_STMT:.*]] = metadata !{i32 786443, metadata !{{.*}}, metadata ![[TESTNOSIDEEFFECT]], i32 [[@LINE-1]], i32 0, i32 0} ; [ DW_TAG_lexical_block ]
- int x = 1;
- // CHECK: ![[ARC1]] = metadata !{i32 [[@LINE+1]], i32 0, metadata ![[COMPOUND_STMT]], null}
+ // CHECK: ![[ARC1]] = metadata !{i32 [[@LINE+1]], i32 0, metadata !{{.*}}, null}
return 1; // Return expression
// CHECK: ![[RET1]] = metadata !{i32 [[@LINE+1]], i32 0, metadata !{{.*}}, null}
} // Cleanup + Ret
OpenPOWER on IntegriCloud