mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 22:02:52 +01:00
Expand use of CheckIRId stores (#5820)
This is trying to make it clearer when vectors are being indexed with `CheckIRId`. The only one that I still kind of want to change is the `SmallVector<std::unique_ptr<CompilationUnit>>`, but because it's a `unique_ptr` that's a little more complex. I may not bother. Note, some of the changes around nuanced `SmallVector` interactions were based on trying to copy the way `SmallVector` itself takes arguments, like with range passing.
This commit is contained in:
@@ -166,13 +166,14 @@ auto Context::File::SetText(Context& context, std::optional<int64_t> version,
|
||||
// TODO: Include the prelude.
|
||||
Check::CheckParseTreesOptions check_options;
|
||||
check_options.vlog_stream = context.vlog_stream();
|
||||
auto getters =
|
||||
Parse::GetTreeAndSubtreesStore::MakeWithExplicitSize(1, getter);
|
||||
|
||||
auto clang_invocation =
|
||||
BuildClangInvocation(consumer, fs, {context.installation().clang_path()});
|
||||
|
||||
Check::CheckParseTrees(units,
|
||||
llvm::ArrayRef<Parse::GetTreeAndSubtreesFn>(getter),
|
||||
fs, check_options, std::move(clang_invocation));
|
||||
Check::CheckParseTrees(units, getters, fs, check_options,
|
||||
std::move(clang_invocation));
|
||||
|
||||
// Note we need to publish diagnostics even when empty.
|
||||
// TODO: Consider caching previously published diagnostics and only publishing
|
||||
|
||||
Reference in New Issue
Block a user