Details
Details
- Reviewers
sammccall - Commits
- rG9e9ac4138890: [clangd] Drop optional on ExternalIndexSpec
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Sorry about delay.
clang-tools-extra/clangd/tool/ClangdMain.cpp | ||
---|---|---|
555 ↗ | (On Diff #336841) | I think you hit llvm_unreachable here - is this an invariant enforced by the caller, or did you mean to return nullptr? |
Comment Actions
Add comment to IndexFactory about pre-condition of spec never being none.
clang-tools-extra/clangd/tool/ClangdMain.cpp | ||
---|---|---|
555 ↗ | (On Diff #336841) | it is enforced by the caller (i.e. ProjectAwareIndex::getIndex) hence fallback to unreachable was deliberate. It was more explicit before as Generator takes a reference, also semantically it feels wrong for generator to be called with a None spec. Even though we are lucky and can indicate the error by returning null in this case, I'd rather keep it as an assertion failure, similar to before. Gonna update the documentation on the IndexFactory to mention that spec is never None though. |