This is an archive of the discontinued LLVM Phabricator instance.

Change debug-info-for-profiling from a TargetOption to a function attribute.
ClosedPublic

Authored by danielcdh on Jan 26 2017, 4:12 PM.

Event Timeline

danielcdh created this revision.Jan 26 2017, 4:12 PM
danielcdh updated this revision to Diff 86058.Jan 27 2017, 8:43 AM

change to use module flag.

mehdi_amini added inline comments.Jan 27 2017, 9:52 AM
lib/CodeGen/CodeGenModule.cpp
452 ↗(On Diff #86058)

Why should we warn on mismatch?

danielcdh added inline comments.Jan 27 2017, 9:57 AM
lib/CodeGen/CodeGenModule.cpp
452 ↗(On Diff #86058)

In theory, we expect this to be the same across all modules. Otherwise when we use this binary for profiling, we may get inaccurate profiles.

mehdi_amini added inline comments.Jan 27 2017, 10:17 AM
lib/CodeGen/CodeGenModule.cpp
452 ↗(On Diff #86058)

Oh I thought about the "unset" case but we wouldn't warn in this case.

Indeed we never even should have this flag with a zero value.

mehdi_amini added inline comments.Jan 27 2017, 10:18 AM
lib/CodeGen/CodeGenModule.cpp
452 ↗(On Diff #86058)

Unless you really intend to get a warning on mismatch, in which case you should always emit the flag, but with a zero value when not enabled.
I'd need more thought to really grasp all the consequences :)

dblaikie accepted this revision.Feb 1 2017, 2:28 PM
This revision is now accepted and ready to land.Feb 1 2017, 2:28 PM

Oops, forgot to write stuff so the approval appears on-list.

Anyway - looks good/approved.

danielcdh closed this revision.Feb 1 2017, 2:56 PM