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

Vedant Kumar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 21 09:46:16 PDT 2018


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
+// RUN: %clang_cc1 -O0 -debug-info-kind=limited -emit-llvm -o - %s | FileCheck %s
+
----------------
The -O0 flag isn't needed here.


================
Comment at: test/CodeGen/debug-info-preserve-scope.c:11
+// CHECK: store i32 %b, i32* %b.addr, align 4, !dbg ![[dbgLocForStore:[0-9]+]]
+
----------------
To check that we set the right location on the store, you might add:
`; CHECK: ![[dbgLocForStore]] = !DILocation(line: 0`


Repository:
  rC Clang

https://reviews.llvm.org/D47097





More information about the cfe-commits mailing list