[PATCH] D125693: [DebugInfo] Support types, imports and static locals declared in a lexical block (3/5)

Kristina Bessonova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 6 02:21:45 PDT 2022


krisb added inline comments.


================
Comment at: llvm/test/Instrumentation/InstrProfiling/debug-info-correlate.ll:23
   call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 12345678, i32 2, i32 0)
-  ret void
+  ret void, !dbg !17
 }
----------------
ellis wrote:
> I asked the same question in D113741, but why is this test changed?
Normally, we emit function-local entities iff a parent function has location information. This is done the same way for local variables, labels, parameters, imported entities, and, //now,// for static locals as well.
Before this change static locals behaved more like global variables and get emitted doesn't matter its parent function. This patch makes them handled more like local variables.

I believe either the call or the 'ret' (or, likely, both) had had DILocation attached originally, but it has been removed to simplify the test.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D125693/new/

https://reviews.llvm.org/D125693



More information about the cfe-commits mailing list