SerializedDiagnosticPrinter.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===--- SerializedDiagnosticPrinter.h - Diagnostics serializer -*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #ifndef LLVM_CLANG_FRONTEND_SERIALIZEDDIAGNOSTICPRINTER_H
  14. #define LLVM_CLANG_FRONTEND_SERIALIZEDDIAGNOSTICPRINTER_H
  15. #include "clang/Basic/LLVM.h"
  16. #include "clang/Frontend/SerializedDiagnostics.h"
  17. #include "llvm/Bitstream/BitstreamWriter.h"
  18. namespace llvm {
  19. class raw_ostream;
  20. }
  21. namespace clang {
  22. class DiagnosticConsumer;
  23. class DiagnosticOptions;
  24. namespace serialized_diags {
  25. /// Returns a DiagnosticConsumer that serializes diagnostics to
  26. /// a bitcode file.
  27. ///
  28. /// The created DiagnosticConsumer is designed for quick and lightweight
  29. /// transfer of diagnostics to the enclosing build system (e.g., an IDE).
  30. /// This allows wrapper tools for Clang to get diagnostics from Clang
  31. /// (via libclang) without needing to parse Clang's command line output.
  32. ///
  33. std::unique_ptr<DiagnosticConsumer> create(StringRef OutputFile,
  34. DiagnosticOptions *Diags,
  35. bool MergeChildRecords = false);
  36. } // end serialized_diags namespace
  37. } // end clang namespace
  38. #endif
  39. #ifdef __GNUC__
  40. #pragma GCC diagnostic pop
  41. #endif