Skip to content

Commit 3b2c35d

Browse files
committed
Move implementation to .cpp file
1 parent 911217c commit 3b2c35d

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,21 @@ getFixIt(const tooling::Diagnostic &Diagnostic, bool AnyFix) {
358358

359359
} // namespace clang::tidy
360360

361+
void ClangTidyDiagnosticConsumer::BeginSourceFile(const LangOptions &LangOpts,
362+
const Preprocessor *PP) {
363+
DiagnosticConsumer::BeginSourceFile(LangOpts, PP);
364+
365+
assert(!InSourceFile);
366+
InSourceFile = true;
367+
}
368+
369+
void ClangTidyDiagnosticConsumer::EndSourceFile() {
370+
assert(InSourceFile);
371+
InSourceFile = false;
372+
373+
DiagnosticConsumer::EndSourceFile();
374+
}
375+
361376
void ClangTidyDiagnosticConsumer::HandleDiagnostic(
362377
DiagnosticsEngine::Level DiagLevel, const Diagnostic &Info) {
363378
// A diagnostic should not be reported outside of a

clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.h

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -293,19 +293,9 @@ class ClangTidyDiagnosticConsumer : public DiagnosticConsumer {
293293
const Diagnostic &Info) override;
294294

295295
void BeginSourceFile(const LangOptions &LangOpts,
296-
const Preprocessor *PP = nullptr) override {
297-
DiagnosticConsumer::BeginSourceFile(LangOpts, PP);
296+
const Preprocessor *PP = nullptr) override;
298297

299-
assert(!InSourceFile);
300-
InSourceFile = true;
301-
}
302-
303-
void EndSourceFile() override {
304-
assert(InSourceFile);
305-
InSourceFile = false;
306-
307-
DiagnosticConsumer::EndSourceFile();
308-
}
298+
void EndSourceFile() override;
309299

310300
// Retrieve the diagnostics that were captured.
311301
std::vector<ClangTidyError> take();

0 commit comments

Comments
 (0)