[PATCH] D29203: Change debug-info-for-profiling from a TargetOption to a function attribute.

Paul Robinson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 27 10:59:54 PST 2017


probinson added a comment.

Regarding the mixed-mode LTO question, my understanding is that if we have a module-level flag then it would apply to everything in the merged module.  The merged module will still have debug info organized per original compilation unit.  So, if we have a per-CU flag and compiled flag-on.cpp and flag-off.cpp, then functions from flag-on.cpp would get the extra info and functions from flag-off.cpp would not, with the caveat that if you inline a function across compilation units, then the flag from the CU for the caller would apply.

I believe we have a module flag here, so the entire module would be treated as if -fdebug-info-for-profiling had been turned on for all CUs.

(Did I get that right?)



================
Comment at: test/DebugInfo/Inputs/gmlt_profiling.ll:14
+; CHECK: DW_AT_decl_file
+; CHECK: DW_AT_decl_line
+
----------------
danielcdh wrote:
> probinson wrote:
> > Writing checks for dwarfdump output is tricky because you're really trying to match several attribute lines within the same DWARF entry.  So here you want something like this:
> > ```
> > CHECK: DW_TAG_subprogram
> > CHECK-NOT: {{DW_TAG|NULL}}
> > CHECK: DW_AT_name {{.*}} "f1"
> > CHECK-NEXT: DW_AT_decl_file
> > CHECK-NEXT: DW_AT_decl_line
> > ```
> > 
> > This assumes that name/file/line appear in that exact sequence, but there are lots of debug-info tests with that kind of assumption.  Unless/until we get a fancier debug-info matcher this is the kind of thing we have to do.
> Done, but the CHECK-NOT cannot be used because we have DW_AT_low_pc and DW_AT_high_pc in between.
The CHECK-NOT should not match a DW_AT line.  You need it to ensure that the attributes belong to the same TAG that you found.


https://reviews.llvm.org/D29203





More information about the llvm-commits mailing list