[PATCH] D29205: Change debug-info-for-profiling from a TargetOption to a function attribute.
Mehdi AMINI via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 27 10:18:49 PST 2017
mehdi_amini added inline comments.
================
Comment at: lib/CodeGen/CodeGenModule.cpp:452
+ if (CodeGenOpts.DebugInfoForProfiling)
+ getModule().addModuleFlag(llvm::Module::Warning, "DebugInfoForProfiling", 1);
----------------
mehdi_amini wrote:
> danielcdh wrote:
> > mehdi_amini wrote:
> > > Why should we warn on mismatch?
> > 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.
> 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.
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 :)
https://reviews.llvm.org/D29205
More information about the cfe-commits
mailing list