mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 22:02:52 +01:00
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:
co-authored by
Richard Smith
parent
629c63c7d1
commit
d13f76e001
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user