[PATCH] D70696: [DebugInfo] Support to emit debugInfo for extern variables

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 2 12:09:26 PST 2019


dblaikie added a comment.

In D70696#1765675 <https://reviews.llvm.org/D70696#1765675>, @yonghong-song wrote:

> @probinson for the question,
>
> > Does bpf require debug info for the declaration of global_var in noref.c ?
>
> No, bpf only cares the referenced external global variables. So my current implementation does not emit debug info
>  for external global_var in noref.c.
>
> It is just strange that gcc 7.3.1 (did not test, but maybe later gcc versions as well) emits the debuginfo (encoded in dwarf)
>  even if the external variable is not used in the current compilation unit. Not sure what is the rationale behind it.


FWIW, looks like GCC trunk doesn't do this anymore: https://godbolt.org/z/EP5mWF (try it with GCC trunk V GCC 9.2 - 9.2 mentions "glbl_var" and trunk does not).


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