<div dir="ltr">Should these have no/artificial location? It seems like perhaps they should have the same location as the scope they're for? (well, the beginning or end of that scope, respectively, etc)</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 28, 2016 at 10:21 AM, Adrian Prantl via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: adrian<br>
Date: Thu Apr 28 12:21:56 2016<br>
New Revision: 267904<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=267904&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=267904&view=rev</a><br>
Log:<br>
Debug info: Apply an artificial debug location to __cyg_profile_func.* calls.<br>
The LLVM Verifier expects all inlinable calls in debuggable functions to<br>
have a location.<br>
<br>
rdar://problem/25818489<br>
<br>
Modified:<br>
    cfe/trunk/lib/CodeGen/CodeGenFunction.cpp<br>
    cfe/trunk/test/CodeGen/instrument-functions.c<br>
<br>
Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.cpp?rev=267904&r1=267903&r2=267904&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.cpp?rev=267904&r1=267903&r2=267904&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/CodeGen/CodeGenFunction.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.cpp Thu Apr 28 12:21:56 2016<br>
@@ -401,6 +401,7 @@ bool CodeGenFunction::ShouldInstrumentFu<br>
 /// instrumentation function with the current function and the call site, if<br>
 /// function instrumentation is enabled.<br>
 void CodeGenFunction::EmitFunctionInstrumentation(const char *Fn) {<br>
+  auto NL = ApplyDebugLocation::CreateArtificial(*this);<br>
   // void __cyg_profile_func_{enter,exit} (void *this_fn, void *call_site);<br>
   llvm::PointerType *PointerTy = Int8PtrTy;<br>
   llvm::Type *ProfileFuncArgs[] = { PointerTy, PointerTy };<br>
<br>
Modified: cfe/trunk/test/CodeGen/instrument-functions.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/instrument-functions.c?rev=267904&r1=267903&r2=267904&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/instrument-functions.c?rev=267904&r1=267903&r2=267904&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/CodeGen/instrument-functions.c (original)<br>
+++ cfe/trunk/test/CodeGen/instrument-functions.c Thu Apr 28 12:21:56 2016<br>
@@ -1,9 +1,9 @@<br>
-// RUN: %clang_cc1 -S -emit-llvm -o - %s -finstrument-functions | FileCheck %s<br>
+// RUN: %clang_cc1 -S -debug-info-kind=standalone -emit-llvm -o - %s -finstrument-functions | FileCheck %s<br>
<br>
 // CHECK: @test1<br>
 int test1(int x) {<br>
-// CHECK: __cyg_profile_func_enter<br>
-// CHECK: __cyg_profile_func_exit<br>
+// CHECK: call void @__cyg_profile_func_enter({{.*}}, !dbg<br>
+// CHECK: call void @__cyg_profile_func_exit({{.*}}, !dbg<br>
 // CHECK: ret<br>
   return x;<br>
 }<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>