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

Sourabh Singh Tomar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 2 12:06:47 PST 2019


SouraVX 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.


I'm using gcc 9.2.0 -- it's generating, for `noref.c`{Not used in compilation unit} case also.


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