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

Sourabh Singh Tomar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Nov 30 07:16:58 PST 2019


SouraVX added a comment.

In D70696#1764306 <https://reviews.llvm.org/D70696#1764306>, @umesh.kalappa0 wrote:

> @SouraVX  and @yonghong-song
>
> cat extern.c 
>  int global_var = 2;
>
> compile as an extern.c shared a library ,then final executable a.out doesn't have debugInfo for global_var.


Perfect! Now we have a better use case and motivation that we should generate declaration debug entry. for a variable declared as extern.  
that will also solves @umesh.kalappa0 above case. `a.out` will have debuginfo for `global_var`, since we generated it's declaration debuginfo in primary object `main.c`.


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