summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDecl.cpp
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2019-07-29 22:49:55 +0000
committerVedant Kumar <vsk@apple.com>2019-07-29 22:49:55 +0000
commit04818d8386c79956d251341d521a213d6ac78e39 (patch)
tree9d472c641f8f9e486d563037c6c4966df6a5f230 /clang/lib/CodeGen/CGDecl.cpp
parentb49d45925c235bc32c21933f958cb5d4a44364f3 (diff)
downloadbcm5719-llvm-04818d8386c79956d251341d521a213d6ac78e39.tar.gz
bcm5719-llvm-04818d8386c79956d251341d521a213d6ac78e39.zip
[DebugInfo] Don't emit incorrect descriptions of thunk params (PR42627)
The `this` parameter of a thunk requires adjustment. Stop emitting an incorrect dbg.declare pointing to the unadjusted pointer. We could describe the adjusted value instead, but there may not be much benefit in doing so as users tend not to debug thunks. Robert O'Callahan reports that this matches gcc's behavior. Fixes PR42627. Differential Revision: https://reviews.llvm.org/D65035 llvm-svn: 367269
Diffstat (limited to 'clang/lib/CodeGen/CGDecl.cpp')
-rw-r--r--clang/lib/CodeGen/CGDecl.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp
index 6ad43cefc4d..c6c2ff57e1c 100644
--- a/clang/lib/CodeGen/CGDecl.cpp
+++ b/clang/lib/CodeGen/CGDecl.cpp
@@ -2496,10 +2496,11 @@ void CodeGenFunction::EmitParmDecl(const VarDecl &D, ParamValue Arg,
setAddrOfLocalVar(&D, DeclPtr);
- // Emit debug info for param declaration.
+ // Emit debug info for param declarations in non-thunk functions.
if (CGDebugInfo *DI = getDebugInfo()) {
if (CGM.getCodeGenOpts().getDebugInfo() >=
- codegenoptions::LimitedDebugInfo) {
+ codegenoptions::LimitedDebugInfo &&
+ !CurFuncIsThunk) {
DI->EmitDeclareOfArgVariable(&D, DeclPtr.getPointer(), ArgNo, Builder);
}
}
OpenPOWER on IntegriCloud