[PATCH] D47097: [DebugInfo] Preserve scope in auto generated StoreInst

2018-06-07 Thread Anastasis via Phabricator via cfe-commits
gramanas updated this revision to Diff 150357. gramanas added a comment. Make more elaborate comment. 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

[PATCH] D47097: [DebugInfo] Preserve scope in auto generated StoreInst

2018-06-06 Thread Adrian Prantl via Phabricator via cfe-commits
aprantl added inline comments. Comment at: lib/CodeGen/CGDecl.cpp:1949 + // Set artificial debug location in order to preserve the scope + auto DL = ApplyDebugLocation::CreateArtificial(*this); Can you make that comment elaborate more about why this is being

[PATCH] D47097: [DebugInfo] Preserve scope in auto generated StoreInst

2018-06-06 Thread Anastasis via Phabricator via cfe-commits
gramanas added a comment. What about this? Ping! Repository: rC Clang https://reviews.llvm.org/D47097 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D47097: [DebugInfo] Preserve scope in auto generated StoreInst

2018-05-25 Thread Anastasis via Phabricator via cfe-commits
gramanas updated this revision to Diff 148588. gramanas added a comment. I added a test that illustrates what @vsk is talking about. Sorry for not providing the relevant information but I thought this would be a simple one liner like https://reviews.llvm.org/rL327800. I will update the

[PATCH] D47097: [DebugInfo] Preserve scope in auto generated StoreInst

2018-05-24 Thread Vedant Kumar via Phabricator via cfe-commits
vsk added a comment. In https://reviews.llvm.org/D47097#248, @aprantl wrote: > In https://reviews.llvm.org/D47097#223, @gramanas wrote: > > > In https://reviews.llvm.org/D47097#149, @probinson wrote: > > > > > Can we step back a second and better explain what the problem is? With >

[PATCH] D47097: [DebugInfo] Preserve scope in auto generated StoreInst

2018-05-24 Thread Adrian Prantl via Phabricator via cfe-commits
aprantl added a comment. In https://reviews.llvm.org/D47097#223, @gramanas wrote: > In https://reviews.llvm.org/D47097#149, @probinson wrote: > > > Can we step back a second and better explain what the problem is? With > > current Clang the debug info for this function looks okay to me.

[PATCH] D47097: [DebugInfo] Preserve scope in auto generated StoreInst

2018-05-24 Thread Anastasis via Phabricator via cfe-commits
gramanas added a comment. In https://reviews.llvm.org/D47097#149, @probinson wrote: > Can we step back a second and better explain what the problem is? With > current Clang the debug info for this function looks okay to me. > The store that is "missing" a debug location is homing the

[PATCH] D47097: [DebugInfo] Preserve scope in auto generated StoreInst

2018-05-24 Thread Paul Robinson via Phabricator via cfe-commits
probinson added a comment. Can we step back a second and better explain what the problem is? With current Clang the debug info for this function looks okay to me. The store that is "missing" a debug location is homing the formal parameter to its local stack location; this is part of prolog

[PATCH] D47097: [DebugInfo] Preserve scope in auto generated StoreInst

2018-05-24 Thread Anastasis via Phabricator via cfe-commits
gramanas updated this revision to Diff 148414. gramanas added a comment. Adress review comments. Limit changes to the storeInst Repository: rC Clang https://reviews.llvm.org/D47097 Files: lib/CodeGen/CGDecl.cpp test/CodeGen/debug-info-preserve-scope.c Index:

[PATCH] D47097: [DebugInfo] Preserve scope in auto generated StoreInst

2018-05-23 Thread Adrian Prantl via Phabricator via cfe-commits
aprantl added inline comments. Comment at: lib/CodeGen/CGExpr.cpp:72 + // Set debug location in order to preserve the scope + Alloca->setDebugLoc(Builder.getCurrentDebugLocation()); if (AllocaAddr) vsk wrote: > aprantl wrote: > > vsk wrote: > > > aprantl

[PATCH] D47097: [DebugInfo] Preserve scope in auto generated StoreInst

2018-05-23 Thread Vedant Kumar via Phabricator via cfe-commits
vsk added inline comments. Comment at: lib/CodeGen/CGExpr.cpp:72 + // Set debug location in order to preserve the scope + Alloca->setDebugLoc(Builder.getCurrentDebugLocation()); if (AllocaAddr) aprantl wrote: > vsk wrote: > > aprantl wrote: > > > vsk wrote:

[PATCH] D47097: [DebugInfo] Preserve scope in auto generated StoreInst

2018-05-23 Thread Adrian Prantl via Phabricator via cfe-commits
aprantl added inline comments. Comment at: lib/CodeGen/CGExpr.cpp:72 + // Set debug location in order to preserve the scope + Alloca->setDebugLoc(Builder.getCurrentDebugLocation()); if (AllocaAddr) vsk wrote: > aprantl wrote: > > vsk wrote: > > > I think we

[PATCH] D47097: [DebugInfo] Preserve scope in auto generated StoreInst

2018-05-23 Thread Vedant Kumar via Phabricator via cfe-commits
vsk added inline comments. Comment at: lib/CodeGen/CGExpr.cpp:72 + // Set debug location in order to preserve the scope + Alloca->setDebugLoc(Builder.getCurrentDebugLocation()); if (AllocaAddr) aprantl wrote: > vsk wrote: > > I think we need to be a bit

[PATCH] D47097: [DebugInfo] Preserve scope in auto generated StoreInst

2018-05-23 Thread Adrian Prantl via Phabricator via cfe-commits
aprantl added inline comments. Comment at: lib/CodeGen/CGExpr.cpp:72 + // Set debug location in order to preserve the scope + Alloca->setDebugLoc(Builder.getCurrentDebugLocation()); if (AllocaAddr) vsk wrote: > I think we need to be a bit more careful here.

[PATCH] D47097: [DebugInfo] Preserve scope in auto generated StoreInst

2018-05-23 Thread Vedant Kumar via Phabricator via cfe-commits
vsk added inline comments. Comment at: lib/CodeGen/CGExpr.cpp:72 + // Set debug location in order to preserve the scope + Alloca->setDebugLoc(Builder.getCurrentDebugLocation()); if (AllocaAddr) I think we need to be a bit more careful here. The current

[PATCH] D47097: [DebugInfo] Preserve scope in auto generated StoreInst

2018-05-23 Thread Anastasis via Phabricator via cfe-commits
gramanas updated this revision to Diff 148200. gramanas marked an inline comment as done. gramanas added a comment. Remove redundant `this` Repository: rC Clang https://reviews.llvm.org/D47097 Files: lib/CodeGen/CGDecl.cpp lib/CodeGen/CGExpr.cpp

[PATCH] D47097: [DebugInfo] Preserve scope in auto generated StoreInst

2018-05-23 Thread Anastasis via Phabricator via cfe-commits
gramanas updated this revision to Diff 148198. gramanas added a comment. Set debug location to the entry block alloca Repository: rC Clang https://reviews.llvm.org/D47097 Files: lib/CodeGen/CGDecl.cpp lib/CodeGen/CGExpr.cpp test/CodeGen/debug-info-preserve-scope.c Index:

[PATCH] D47097: [DebugInfo] Preserve scope in auto generated StoreInst

2018-05-22 Thread Vedant Kumar via Phabricator via cfe-commits
vsk added inline comments. Comment at: test/CodeGen/debug-info-preserve-scope.c:10 + +// CHECK: alloca i32 {{.*}} !dbg ![[dbgLocForStore:[0-9]+]] +// CHECK: store i32 {{.*}} !dbg ![[dbgLocForStore:[0-9]+]] In these two check lines, you're capturing the variable

[PATCH] D47097: [DebugInfo] Preserve scope in auto generated StoreInst

2018-05-22 Thread Anastasis via Phabricator via cfe-commits
gramanas updated this revision to Diff 148034. gramanas added a comment. Move ApplyDebugLocation before CreateMemTemp Repository: rC Clang https://reviews.llvm.org/D47097 Files: lib/CodeGen/CGDecl.cpp test/CodeGen/debug-info-preserve-scope.c Index:

[PATCH] D47097: [DebugInfo] Preserve scope in auto generated StoreInst

2018-05-21 Thread Vedant Kumar via Phabricator via cfe-commits
vsk added inline comments. Comment at: lib/CodeGen/CGDecl.cpp:2074 + if (DoStore) { + auto DL = ApplyDebugLocation::CreateArtificial(*this); + EmitStoreOfScalar(ArgVal, lv, /* isInitialization */ true); Ideally this would precede the calls to CreateMemTemp

[PATCH] D47097: [DebugInfo] Preserve scope in auto generated StoreInst

2018-05-21 Thread Anastasis via Phabricator via cfe-commits
gramanas updated this revision to Diff 147876. gramanas added a comment. Update diff 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