Factors out member decleration gathering and uses it in parsing to call signature
help. Doesn't support signature help for base class constructors, the code was too
coupled with diagnostic handling, but still can be factored out but just needs
more afford.
Details
- Reviewers
sammccall ilya-biryukov ioeric - Commits
- rG84774c3ae3df: [CodeCompletion] Enable signature help when initializing class/struct/union…
rL341949: [CodeCompletion] Enable signature help when initializing class/struct/union…
rC341949: [CodeCompletion] Enable signature help when initializing class/struct/union…
Diff Detail
- Repository
- rL LLVM
Event Timeline
include/clang/Sema/Sema.h | ||
---|---|---|
10798 ↗ | (On Diff #164825) | The name is very generic, but the helper is only applicable to our specific case (looking up ctor member initializer). Maybe choose a different name? |
lib/Parse/ParseDeclCXX.cpp | ||
3471 ↗ | (On Diff #164825) | We're calling completion in other instances, this gives us valuable information (preferred type). |
3473 ↗ | (On Diff #164825) | That's a lot of code in parser. We could probably extract this as a helper in Sema (similar to ProduceConstructorSignatureHelp) to follow the same pattern that we have for all the other signature help calls. |
lib/Parse/ParseDeclCXX.cpp | ||
---|---|---|
3472 ↗ | (On Diff #164844) | Let's always call signature help and code completion here to be consistent with other cases. |
lib/Sema/SemaDeclCXX.cpp | ||
3784 ↗ | (On Diff #164844) | NIT: invert condition to reduce nesting and simplify the code, i.e. if (SS.getScopeRep() || TemplateTypeTy) return nullptr; // rest of the code |
3785 ↗ | (On Diff #164844) | This comment does not look useful without a context, maybe move it to the previous call site in sema? |
include/clang/Sema/Sema.h | ||
---|---|---|
4571 ↗ | (On Diff #164844) | s/decleration/declaration. Maybe even remove the comment? the name is self-descriptive |