|
18 | 18 | #include "clang/Basic/SourceManager.h"
|
19 | 19 | #include "clang/Basic/Version.h"
|
20 | 20 | #include "clang/Format/Format.h"
|
| 21 | +#include "clang/Frontend/TextDiagnosticPrinter.h" |
21 | 22 | #include "clang/Rewrite/Core/Rewriter.h"
|
22 | 23 | #include "llvm/Support/CommandLine.h"
|
23 | 24 | #include "llvm/Support/FileSystem.h"
|
@@ -423,9 +424,11 @@ static bool format(StringRef FileName) {
|
423 | 424 | IntrusiveRefCntPtr<llvm::vfs::InMemoryFileSystem> InMemoryFileSystem(
|
424 | 425 | new llvm::vfs::InMemoryFileSystem);
|
425 | 426 | FileManager Files(FileSystemOptions(), InMemoryFileSystem);
|
| 427 | + IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts(new DiagnosticOptions()); |
| 428 | + TextDiagnosticPrinter DiagnosticsConsumer(errs(), &*DiagOpts); |
426 | 429 | DiagnosticsEngine Diagnostics(
|
427 |
| - IntrusiveRefCntPtr<DiagnosticIDs>(new DiagnosticIDs), |
428 |
| - new DiagnosticOptions); |
| 430 | + IntrusiveRefCntPtr<DiagnosticIDs>(new DiagnosticIDs), &*DiagOpts, |
| 431 | + &DiagnosticsConsumer, false); |
429 | 432 | SourceManager Sources(Diagnostics, Files);
|
430 | 433 | FileID ID = createInMemoryFile(AssumedFileName, Code.get(), Sources, Files,
|
431 | 434 | InMemoryFileSystem.get());
|
|
0 commit comments