xref: /llvm-project/clang/lib/StaticAnalyzer/Checkers/WebKit/DiagOutputUtils.h (revision f7c7e8a523f56b0ed1b14c0756ba4e5d1ccb48d2)
1 //=======- DiagOutputUtils.h -------------------------------------*- C++ -*-==//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_CLANG_ANALYZER_WEBKIT_DIAGPRINTUTILS_H
10 #define LLVM_CLANG_ANALYZER_WEBKIT_DIAGPRINTUTILS_H
11 
12 #include "clang/AST/Decl.h"
13 #include "llvm/Support/raw_ostream.h"
14 
15 namespace clang {
16 
17 template <typename NamedDeclDerivedT>
18 void printQuotedQualifiedName(llvm::raw_ostream &Os,
19                               const NamedDeclDerivedT &D) {
20   Os << "'";
21   D->getNameForDiagnostic(Os, D->getASTContext().getPrintingPolicy(),
22                           /*Qualified=*/true);
23   Os << "'";
24 }
25 
26 } // namespace clang
27 
28 #endif
29