16 #ifndef LLVM_CLANG_TOOLING_DIAGNOSTICSYAML_H 17 #define LLVM_CLANG_TOOLING_DIAGNOSTICSYAML_H 21 #include "llvm/Support/YAMLTraits.h" 30 template <>
struct MappingTraits<
clang::tooling::DiagnosticMessage> {
32 Io.mapRequired(
"Message", M.
Message);
33 Io.mapOptional(
"FilePath", M.
FilePath);
38 template <>
struct MappingTraits<
clang::tooling::Diagnostic> {
41 class NormalizedDiagnostic {
44 : DiagLevel(
clang::tooling::Diagnostic::
Level::Warning) {}
47 : DiagnosticName(D.DiagnosticName), Message(D.Message), Fix(D.Fix),
48 Notes(D.Notes), DiagLevel(D.DiagLevel),
49 BuildDirectory(D.BuildDirectory) {}
53 DiagLevel, BuildDirectory);
58 llvm::StringMap<clang::tooling::Replacements>
Fix;
65 MappingNormalization<NormalizedDiagnostic, clang::tooling::Diagnostic> Keys(
67 Io.mapRequired(
"DiagnosticName", Keys->DiagnosticName);
68 Io.mapRequired(
"Message", Keys->Message.Message);
69 Io.mapRequired(
"FileOffset", Keys->Message.FileOffset);
70 Io.mapRequired(
"FilePath", Keys->Message.FilePath);
71 Io.mapOptional(
"Notes", Keys->Notes);
75 std::vector<clang::tooling::Replacement> Fixes;
76 for (
auto &Replacements : Keys->Fix) {
77 for (
auto &Replacement : Replacements.second) {
78 Fixes.push_back(Replacement);
81 Io.mapRequired(
"Replacements", Fixes);
82 for (
auto &Fix : Fixes) {
83 llvm::Error Err = Keys->Fix[Fix.getFilePath()].add(Fix);
86 llvm::errs() <<
"Fix conflicts with existing fix: " 95 template <>
struct MappingTraits<
clang::tooling::TranslationUnitDiagnostics> {
104 #endif // LLVM_CLANG_TOOLING_DIAGNOSTICSYAML_H
DominatorTree GraphTraits specialization so the DominatorTree can be iterable by generic graph iterat...
static std::string toString(const clang::SanitizerSet &Sanitizers)
Produce a string containing comma-separated names of sanitizers in Sanitizers set.
Dataflow Directional Tag Classes.
This file defines the structure of a YAML document for serializing replacements.