Skip to content

Commit 637c77f

Browse files
committed
Revert "clang-format: Add a consumer to diagnostics engine"
This reverts commit df00267. clang-format should not depend on Frontend, see comment on https://reviews.llvm.org/D90121.
1 parent f52c1b5 commit 637c77f

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

clang/tools/clang-format/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ add_clang_tool(clang-format
77
set(CLANG_FORMAT_LIB_DEPS
88
clangBasic
99
clangFormat
10-
clangFrontend
1110
clangRewrite
1211
clangToolingCore
1312
)

clang/tools/clang-format/ClangFormat.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include "clang/Basic/SourceManager.h"
1919
#include "clang/Basic/Version.h"
2020
#include "clang/Format/Format.h"
21-
#include "clang/Frontend/TextDiagnosticPrinter.h"
2221
#include "clang/Rewrite/Core/Rewriter.h"
2322
#include "llvm/Support/CommandLine.h"
2423
#include "llvm/Support/FileSystem.h"
@@ -424,11 +423,9 @@ static bool format(StringRef FileName) {
424423
IntrusiveRefCntPtr<llvm::vfs::InMemoryFileSystem> InMemoryFileSystem(
425424
new llvm::vfs::InMemoryFileSystem);
426425
FileManager Files(FileSystemOptions(), InMemoryFileSystem);
427-
IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts(new DiagnosticOptions());
428-
TextDiagnosticPrinter DiagnosticsConsumer(errs(), &*DiagOpts);
429426
DiagnosticsEngine Diagnostics(
430-
IntrusiveRefCntPtr<DiagnosticIDs>(new DiagnosticIDs), &*DiagOpts,
431-
&DiagnosticsConsumer, false);
427+
IntrusiveRefCntPtr<DiagnosticIDs>(new DiagnosticIDs),
428+
new DiagnosticOptions);
432429
SourceManager Sources(Diagnostics, Files);
433430
FileID ID = createInMemoryFile(AssumedFileName, Code.get(), Sources, Files,
434431
InMemoryFileSystem.get());

0 commit comments

Comments
 (0)