[PATCH] D52057: Emit template type and value parameter DIEs for template variables.

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 1 13:56:04 PDT 2018


dblaikie accepted this revision.
dblaikie added a comment.
This revision is now accepted and ready to land.

Thanks!



================
Comment at: test/DebugInfo/X86/template.ll:20
+; CHECK: DW_TAG_variable
+; CHECK-NEXT: DW_AT_name{{.*}}"var"
 ; CHECK-NOT: NULL
----------------
ormris wrote:
> ormris wrote:
> > dblaikie wrote:
> > > ormris wrote:
> > > > dblaikie wrote:
> > > > > Presumably this should actually be named 'var<int>'? Not a big deal, since this is just using whatever name is in the IR To begin with - but might make the test case less confusing.
> > > > In this case, the template parameters are not added to the variable name.
> > > Why's that?
> > > 
> > > The parameters are part of the variable name for class and function templates - seems they'd be necessary/useful to disambiguate for variable templates too.
> > > 
> > > (though I do see that GCC (8.1) also doesn't seem to put template parameters on variable templates... )
> > I did implement that in a previous patch (D44842), but it breaks LLDB's global symbol lookup.
> Correction: It breaks global variable look up, not global symbol lookup.
Fair enough - not a bug to be fixed here anyway. Hopefully LLDB is tracking the fix for that & Clang can switch over after that. Assuming it works for GDB.

(though perhaps it'd be best to make this test case look like the expected name (rather than the bug-workaround name) - so as to be less surprising to folks working on LLVM/reading this in the future?)


Repository:
  rL LLVM

https://reviews.llvm.org/D52057





More information about the llvm-commits mailing list