Details
- Reviewers
ilya-biryukov - Commits
- rGf5ba09f74bc4: [SemaCodeComplete] Make sure visited contexts are passed to completion results…
rL336255: [SemaCodeComplete] Make sure visited contexts are passed to completion results…
rC336255: [SemaCodeComplete] Make sure visited contexts are passed to completion results…
Diff Detail
- Repository
- rC Clang
- Build Status
Buildable 20022 Build 20022: arc lint + arc unit
Event Timeline
Generally LG, just one comment.
lib/Sema/SemaCodeComplete.cpp | ||
---|---|---|
3744 | ResultsBuilder's constructor accepts a CodeCompletionContext. Can we pass in the context with PreferedType there instead of reconstructing it later? |
lib/Sema/SemaCodeComplete.cpp | ||
---|---|---|
3744 | The PreferedType should actually already be set in the ResultsBuilder (line 3715). In thoery, Results.getCompletionContext() should work fine here as well, but it would break some Index tests - it introduced some inconsistency in sema scoring when running with and without result caching (https://github.com/llvm-mirror/clang/blob/master/test/Index/complete-exprs.c#L35). This is probably a bug, but I'm not sure if I'm the right person to chase it :( |
lib/Sema/SemaCodeComplete.cpp | ||
---|---|---|
3744 | What kind of inconsistencies? Maybe we should just update the CHECKS in the test? |
lib/Sema/SemaCodeComplete.cpp | ||
---|---|---|
3744 | After chatting offline: it seems passing in the context that has the preferred type set into ResultsBuilder saves us from check failures. |
lib/Sema/SemaCodeComplete.cpp | ||
---|---|---|
3744 | Sounds good. Thanks! |
ResultsBuilder's constructor accepts a CodeCompletionContext. Can we pass in the context with PreferedType there instead of reconstructing it later?
To make sure we don't miss other things (incl. any future additions) that ResultsBuilder puts into the context.