[PATCH] D47097: [DebugInfo] Preserve scope in auto generated StoreInst
Vedant Kumar via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon May 21 14:48:54 PDT 2018
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 which set up the allocas.
================
Comment at: test/CodeGen/debug-info-preserve-scope.c:10
+
+// CHECK: store i32 %b, i32* %b.addr, align 4, !dbg ![[dbgLocForStore:[0-9]+]]
+
----------------
Can you check that the alloca gets the same location as well? You can do this with:
```
CHECK: alloca {{.*}} !dbg ![[dbgLocForStore:[0-9]+]]
CHECK: store i32 {{.*}} !dbg ![[dbgLocForStore]]
```
Repository:
rC Clang
https://reviews.llvm.org/D47097
More information about the cfe-commits
mailing list