summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorBob Haarman <llvm@inglorion.net>2017-09-11 22:11:57 +0000
committerBob Haarman <llvm@inglorion.net>2017-09-11 22:11:57 +0000
commitc6c9b8fa1fbfcda3dbcb6be2d085f8b4d69d44d1 (patch)
tree3c47e1d359b4d95145e7ed21da79c5998b8a8e5e /clang/lib/CodeGen/CGDebugInfo.cpp
parentd2da71f971c92d0d1f257ccc80d7daf4de14adf5 (diff)
downloadbcm5719-llvm-c6c9b8fa1fbfcda3dbcb6be2d085f8b4d69d44d1.tar.gz
bcm5719-llvm-c6c9b8fa1fbfcda3dbcb6be2d085f8b4d69d44d1.zip
[codeview] omit debug locations for nested exprs unless column info enabled
Summary: Microsoft Visual Studio expects debug locations to correspond to statements. We used to emit locations for expressions nested inside statements. This would confuse the debugger, causing it to stop multiple times on the same line and breaking the "step into specific" feature. This change inhibits the emission of debug locations for nested expressions when emitting CodeView debug information, unless column information is enabled. Fixes PR34312. Reviewers: rnk, zturner Reviewed By: rnk Subscribers: majnemer, echristo, aprantl, cfe-commits Differential Revision: https://reviews.llvm.org/D37529 llvm-svn: 312965
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index befb704f39e..f4c84c5c630 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -97,6 +97,10 @@ void ApplyDebugLocation::init(SourceLocation TemporaryLocation,
}
OriginalLocation = CGF->Builder.getCurrentDebugLocation();
+
+ if (OriginalLocation && !DI->CGM.getExpressionLocationsEnabled())
+ return;
+
if (TemporaryLocation.isValid()) {
DI->EmitLocation(CGF->Builder, TemporaryLocation);
return;
OpenPOWER on IntegriCloud