1 //===--- ASTDiagnostic.h - Diagnostics for the AST library ------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #ifndef LLVM_CLANG_DIAGNOSTICAST_H 11 #define LLVM_CLANG_DIAGNOSTICAST_H 12 13 #include "clang/Basic/Diagnostic.h" 14 15 namespace clang { 16 namespace diag { 17 enum { 18 #define DIAG(ENUM,FLAGS,DEFAULT_MAPPING,DESC,GROUP,\ 19 SFINAE,ACCESS,CATEGORY,BRIEF,FULL) ENUM, 20 #define ASTSTART 21 #include "clang/Basic/DiagnosticASTKinds.inc" 22 #undef DIAG 23 NUM_BUILTIN_AST_DIAGNOSTICS 24 }; 25 } // end namespace diag 26 27 /// \brief Diagnostic argument formatting function for diagnostics that 28 /// involve AST nodes. 29 /// 30 /// This function formats diagnostic arguments for various AST nodes, 31 /// including types, declaration names, nested name specifiers, and 32 /// declaration contexts, into strings that can be printed as part of 33 /// diagnostics. It is meant to be used as the argument to 34 /// \c Diagnostic::SetArgToStringFn(), where the cookie is an \c ASTContext 35 /// pointer. 36 void FormatASTNodeDiagnosticArgument( 37 Diagnostic::ArgumentKind Kind, 38 intptr_t Val, 39 const char *Modifier, 40 unsigned ModLen, 41 const char *Argument, 42 unsigned ArgLen, 43 const Diagnostic::ArgumentValue *PrevArgs, 44 unsigned NumPrevArgs, 45 llvm::SmallVectorImpl<char> &Output, 46 void *Cookie, 47 llvm::SmallVectorImpl<intptr_t> &QualTypeVals); 48 } // end namespace clang 49 50 #endif 51