[PATCH] D72427: [DebugInfo] Add option to clang to limit debug info that is emitted for classes.
Amy Huang via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 10 10:13:00 PST 2020
akhuang marked 2 inline comments as done.
akhuang added inline comments.
================
Comment at: clang/lib/CodeGen/CGDebugInfo.cpp:4516
void CGDebugInfo::EmitGlobalVariable(const ValueDecl *VD, const APValue &Init) {
- assert(DebugKind >= codegenoptions::LimitedDebugInfo);
+ assert(CGM.getCodeGenOpts().isFullDebug());
if (VD->hasAttr<NoDebugAttr>())
----------------
aprantl wrote:
> This change appears to be unnecessary?
Do you mean changing the DebugKind comparison?
================
Comment at: clang/lib/Driver/ToolChains/Clang.cpp:3692
+ Args.getLastArg(options::OPT_flimit_debug_info_constructor), Args, D, TC) &&
+ DebugInfoKind == codegenoptions::LimitedDebugInfo)
+ DebugInfoKind = codegenoptions::DebugInfoConstructor;
----------------
dblaikie wrote:
> I'm surprised that this flag would only apply if you were already using -flimit-debug-info but that looks like what this code does? (I'd probably expect these to override each other -flimit-debug-info -flimit-debug-info-constructor gets you constructor limited, the other way around gets the classic/pre-patch behavior? but once this becomes not a driver option anymore, that gets a bit murkier I guess)
I did this assuming that DebugInfoKind was Limited by default, but looking at it now I think I just didn't put it in the right place in the code.
If this wasn't a driver option, then I guess it would just be -debug-info-kind=constructor?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D72427/new/
https://reviews.llvm.org/D72427
More information about the cfe-commits
mailing list