vsk added inline comments.
Comment at: lib/CodeGen/CGDecl.cpp:2062
EmitStoreOfScalar(ArgVal, lv, /* isInitialization */ true);
+ApplyDebugLocation::CreateArtificial(*this);
+ }
There are two issues here:
1) ApplyDebugLocation is a RAII helper, which mea
gramanas updated this revision to Diff 147840.
gramanas marked an inline comment as done.
gramanas added a comment.
Update according to the comments
Repository:
rC Clang
https://reviews.llvm.org/D47097
Files:
lib/CodeGen/CGDecl.cpp
test/CodeGen/debug-info-preserve-scope.c
Index: test/C
gramanas updated this revision to Diff 147838.
gramanas added a comment.
- Apply debug location
Repository:
rC Clang
https://reviews.llvm.org/D47097
Files:
lib/CodeGen/CGDecl.cpp
test/CodeGen/debug-info-preserve-scope.c
Index: test/CodeGen/debug-info-preserve-scope.c
==
vsk added a comment.
I think CodeGenFunction::EmitParmDecl is the right place to set up an
ApplyDebugLocation instance. You can look at CodeGenFunction::EmitAutoVarInit
for an example of how to use ApplyDebugLocation.
Comment at: test/CodeGen/debug-info-preserve-scope.c:1
+//
gramanas created this revision.
gramanas added a reviewer: vsk.
Herald added subscribers: JDevlieghere, aprantl.
In this test there is a store instruction generated by clang
for the function argument `int b` where the debug info is missing.
The goal of this patch is to instruct clang to add an ar