Support template template parameters
ClosedPublic

Authored by friss on Mar 18 2018, 3:31 PM.

Details

Summary

We would fail to resolve (and thus display the value of) any
templated type which contained a template template argument even
though we don't really use template arguments.

This patch adds minimal support for template template arguments,
but I doubt we need any more than that.

Diff Detail

Repository
rL LLVM
friss created this revision.Mar 18 2018, 3:31 PM
clayborg added inline comments.Mar 19 2018, 10:25 AM
source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
2043 ↗(On Diff #138869)

Shouldn't we be using a #define so this works on any compiler?

2093 ↗(On Diff #138869)

Do we really want to kill the program here? lldbassert would be better IMHO. Templates are one of the most contentious areas of the DWARF from compiler to compiler and I would rather we not crash when we can't successfully dig out a type from DWO/DWZ/type units/-gmodules etc...

friss added inline comments.Mar 19 2018, 12:30 PM
source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
2043 ↗(On Diff #138869)

You're right. I had looked in clang to see if it was used like this, but I think the many instances I saw were in the test directory.

2093 ↗(On Diff #138869)

Well, the lines above are

if (!clang_type)

clang_type = m_ast.GetBasicType(eBasicTypeVoid);

I could add a test and a return false like it was before, but it seems pretty silly to expect anything when you can't even figure out the builtin void type

friss updated this revision to Diff 139619.Mar 23 2018, 11:24 AM

Use LLVM macro for fallthrough

clayborg accepted this revision.Apr 2 2018, 8:21 AM

Sorry for the delay.

This revision is now accepted and ready to land.Apr 2 2018, 8:21 AM
This revision was automatically updated to reflect the committed changes.