[PATCH] D70696: [DebugInfo] Support to emit debugInfo for extern variables
Yonghong Song via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Nov 29 08:46:49 PST 2019
yonghong-song added a comment.
@SouraVX Currently, I filtered all external globals if they are not used. See
for (auto D: ExternalDeclarations) {
if (!D || D->isInvalidDecl() || D->getPreviousDecl() || !D->isUsed())
continue;
Consumer.CompleteExternalDeclaration(D);
}
If I remove `!D->isUsed()`, I should be able to generate the debuginfo for `global_var` and eventually in dwarf in your above case.
I tested with gcc 7.3.1, indeed gcc generates dwarf info for `global_var` as you stated in the above.
What exactly your use case here for these unused external variables?
I would like to hear comments from llvm/clang debuginfo experts before making the change.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D70696/new/
https://reviews.llvm.org/D70696
More information about the cfe-commits
mailing list