Switch SourceBuffer to diagnostics. (#3197)

This updates SourceBuffer to diagnostics. Some additional edits to
diagnostics were necessary due to issues moving arguments around, which
seems to stem from a compile error with clang 14 (fixed in later
versions).

---------

Co-authored-by: Richard Smith <richard@metafoo.co.uk>
This commit is contained in:
Jon Ross-Perkins
2023-09-07 23:02:10 +00:00
committed by GitHub
co-authored by Richard Smith
parent 71e9fb7511
commit bc63e6ae0a
15 changed files with 104 additions and 52 deletions
+2 -1
View File
@@ -27,7 +27,8 @@ extern "C" int LLVMFuzzerTestOneInput(const unsigned char* data,
TestFileName, /*ModificationTime=*/0,
llvm::MemoryBuffer::getMemBuffer(data_ref, /*BufferName=*/TestFileName,
/*RequiresNullTerminator=*/false)));
auto source = SourceBuffer::CreateFromFile(fs, llvm::nulls(), TestFileName);
auto source =
SourceBuffer::CreateFromFile(fs, TestFileName, NullDiagnosticConsumer());
// Lex the input.
auto tokens = Lex::TokenizedBuffer::Lex(*source, NullDiagnosticConsumer());