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

Dehao Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 27 11:18:10 PST 2017


danielcdh added a comment.

In https://reviews.llvm.org/D29203#658981, @probinson wrote:

> 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.


I think you are right. If we always emit this module flag (with value 0 or 1), when there are some CUs built with this flag, and some CUs without, in LTO, it will emit a warning and turn this flag on for all CUs.

Dehao

> (Did I get that right?)




https://reviews.llvm.org/D29203





More information about the llvm-commits mailing list