[cfe-dev] Debug info level specification with the clang driver
David Blaikie via cfe-dev
cfe-dev at lists.llvm.org
Tue Jul 28 11:50:24 PDT 2020
Context: While staging the constructor-based type homing we intended
to rollout enabling this by default in Google prior to changing the
default upstream to make it easier to test and rollback (& also having
the ability to turn it off even once it's on by default in case other
issues are discovered - either that don't rise to the level of needing
a rollback, or at least to allow forward progress without having to
wait on/merge an upstream rollback)
Turns out we don't have a way to change the debug-info-kind default,
without actually specifying debug-info-kind which enables debug info
even when that isn't desired. (eg: we'd like to change the build
system default, but allow users/build rules/etc to opt in/out of debug
info as needed)
This solution doesn't need to (& might be better off not being) a
driver flag, could be just a cc1 flag - I don't think we want to
support users generally opting in/out of these things in a
fine-grained way (same argument I made years ago about grouping the
existing 3 homing strategies (complete type, explicit template
specialization definition, vtable definition) together under one flag,
-f[no-]standalone-debug).
1) wire up constructor homing as a separate cc1 flag that composes
with -debug-info-kind: does nothing except when
-debug-info-kind=limited is specified, and then it makes limited more
aggressive by using the constructor homing technique (yeah, this was
the original proposed version of the patch, I think - and, looking
back on it, given the desire to eventually fold this into limited
anyway, maybe that was the right direction from the start)
2) take out all the debug-info-kind layers above "limited" (so,
limited, constructor, full) into a separate flag like
"debug-info-type-kind" (maybe that name's a bit subtle - since this
flag would not enable debug info by default, but debug-info-kind
does/would continue to). That way existing "-debug-info-kind=limited"
would be "-debug-info-kind=type -debug-info-type-kind=limited", for
instance.
3) ... other ideas?
More information about the cfe-dev
mailing list