ASTDiagnostic.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===--- ASTDiagnostic.h - Diagnostics for the AST library ------*- 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_AST_ASTDIAGNOSTIC_H
  14. #define LLVM_CLANG_AST_ASTDIAGNOSTIC_H
  15. #include "clang/AST/Type.h"
  16. #include "clang/Basic/Diagnostic.h"
  17. #include "clang/Basic/DiagnosticAST.h"
  18. namespace clang {
  19. /// DiagnosticsEngine argument formatting function for diagnostics that
  20. /// involve AST nodes.
  21. ///
  22. /// This function formats diagnostic arguments for various AST nodes,
  23. /// including types, declaration names, nested name specifiers, and
  24. /// declaration contexts, into strings that can be printed as part of
  25. /// diagnostics. It is meant to be used as the argument to
  26. /// \c DiagnosticsEngine::SetArgToStringFn(), where the cookie is an \c
  27. /// ASTContext pointer.
  28. void FormatASTNodeDiagnosticArgument(
  29. DiagnosticsEngine::ArgumentKind Kind,
  30. intptr_t Val,
  31. StringRef Modifier,
  32. StringRef Argument,
  33. ArrayRef<DiagnosticsEngine::ArgumentValue> PrevArgs,
  34. SmallVectorImpl<char> &Output,
  35. void *Cookie,
  36. ArrayRef<intptr_t> QualTypeVals);
  37. /// Returns a desugared version of the QualType, and marks ShouldAKA as true
  38. /// whenever we remove significant sugar from the type.
  39. QualType desugarForDiagnostic(ASTContext &Context, QualType QT,
  40. bool &ShouldAKA);
  41. } // end namespace clang
  42. #endif
  43. #ifdef __GNUC__
  44. #pragma GCC diagnostic pop
  45. #endif