[Lldb-commits] [PATCH] D69309: Support template instantiation in the expression evaluator

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Nov 25 08:15:12 PST 2019


clayborg added a comment.

I wanted to make sure that people understand about how templates are done in DWARF and the implications, just for completeness:

1. DWARF represents only specializations of templates (foo<int>) and not the generic template definition in terms of type T (foo<T>)
2. DWARF only creates the methods that are used in each compile unit. So we might only have `std::vector<int>::erase()` and `std::vector<int>::back()` in one compile unit and `std::vector<int>::operator[](size_t)` in another
3. The template type definitions we create in the clang AST context therefore have no generic template methods. The definition for foo<T> has no methods. All methods for the specialized type (foo<int>) are treated as specializations specific to the <int> type. We have to do this since we item #2 above might only have a fraction of the real template definition's methods.
4. #3 means that we must iterate over all instances of foo<int> to find as many methods as possible when creating the type since each one might only have a fraction of all methods from the original foo<T> definition in the code.

Any fixes we check in should:

- make sure that all tests that were previously passing continue to pass if we do any modifications.
- work for all cases (manual indexing, accelerator tables from apple and DWARF)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69309/new/

https://reviews.llvm.org/D69309





More information about the lldb-commits mailing list