mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 13:41:04 +01:00
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:
co-authored by
Richard Smith
parent
71e9fb7511
commit
bc63e6ae0a
@@ -10,6 +10,7 @@
|
||||
#include "common/check.h"
|
||||
#include "llvm/ADT/Sequence.h"
|
||||
#include "llvm/ADT/StringExtras.h"
|
||||
#include "toolchain/diagnostics/diagnostic_emitter.h"
|
||||
#include "toolchain/diagnostics/null_diagnostics.h"
|
||||
#include "toolchain/lex/token_kind.h"
|
||||
#include "toolchain/lex/tokenized_buffer.h"
|
||||
@@ -297,8 +298,8 @@ class LexerBenchHelper {
|
||||
auto MakeSourceBuffer(llvm::StringRef text) -> SourceBuffer {
|
||||
CARBON_CHECK(fs_.addFile(filename_, /*ModificationTime=*/0,
|
||||
llvm::MemoryBuffer::getMemBuffer(text)));
|
||||
return std::move(
|
||||
*SourceBuffer::CreateFromFile(fs_, llvm::errs(), filename_));
|
||||
return std::move(*SourceBuffer::CreateFromFile(
|
||||
fs_, filename_, ConsoleDiagnosticConsumer()));
|
||||
}
|
||||
|
||||
llvm::vfs::InMemoryFileSystem fs_;
|
||||
|
||||
Reference in New Issue
Block a user