[PATCH] D47720: [DebugInfo] Inline for without DebugLocation

Anastasis via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 4 08:08:39 PDT 2018


gramanas created this revision.
gramanas added a reviewer: vsk.
Herald added subscribers: cfe-commits, JDevlieghere, eraman, aprantl.

This test is a strip down version of a function inside the
amalgamated sqlite source. When converted to IR clang produces
a phi instruction without debug location.

It is a continuation of https://reviews.llvm.org/D47097 focusing on a different problem
of similar structure.

This was found while investigating instructions with missing DebugLoc
after running SROA on the amalgamated sqlite source, in an attempt to
try and preserve as much debug information as possible during the
early stage passes.


Repository:
  rC Clang

https://reviews.llvm.org/D47720

Files:
  test/CodeGen/debug-info-inline-for.c


Index: test/CodeGen/debug-info-inline-for.c
===================================================================
--- /dev/null
+++ test/CodeGen/debug-info-inline-for.c
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -debug-info-kind=limited -emit-llvm -o - %s | FileCheck %s
+
+int func(int n) {
+  int a;
+  for(a = 10; a>0 && n++; a--);
+  return n;
+}
+
+// CHECK: land.end:
+// CHECK-NEXT: {{.*}} = phi i1 {{.*}} !dbg ![[DbgLoc:[0-9]+]]
+
+// CHECK: ![[DbgLoc]] = !DILocation(


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47720.149772.patch
Type: text/x-patch
Size: 469 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180604/0b8253c1/attachment.bin>


More information about the cfe-commits mailing list