Add value store to be shared across compile stages. (#3311)

This updates lexing to use the data. I'll do checking separately, just
to split changes.

Note the ValueStore structure is also set up such that SemIR::File can
use it for other fields.

---------

Co-authored-by: Richard Smith <richard@metafoo.co.uk>
This commit is contained in:
Jon Ross-Perkins
2023-10-20 15:00:53 +00:00
committed by GitHub
co-authored by Richard Smith
parent 629c63c7d1
commit d13f76e001
26 changed files with 389 additions and 227 deletions
+4 -1
View File
@@ -6,6 +6,7 @@
#include <cstring>
#include "llvm/ADT/StringRef.h"
#include "toolchain/base/value_store.h"
#include "toolchain/diagnostics/null_diagnostics.h"
#include "toolchain/lex/tokenized_buffer.h"
#include "toolchain/parse/tree.h"
@@ -31,7 +32,9 @@ extern "C" int LLVMFuzzerTestOneInput(const unsigned char* data,
SourceBuffer::CreateFromFile(fs, TestFileName, NullDiagnosticConsumer());
// Lex the input.
auto tokens = Lex::TokenizedBuffer::Lex(*source, NullDiagnosticConsumer());
SharedValueStores value_stores;
auto tokens = Lex::TokenizedBuffer::Lex(value_stores, *source,
NullDiagnosticConsumer());
if (tokens.has_errors()) {
return 0;
}