| 1 | //===--- IncludeStyle.cpp - Style of C++ #include directives -----*- 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 | #include "clang/Tooling/Inclusions/IncludeStyle.h" |
| 10 | |
| 11 | using clang::tooling::IncludeStyle; |
| 12 | |
| 13 | namespace llvm { |
| 14 | namespace yaml { |
| 15 | |
| 16 | void MappingTraits<IncludeStyle::IncludeCategory>::mapping( |
| 17 | IO &IO, IncludeStyle::IncludeCategory &Category) { |
| 18 | IO.mapOptional(Key: "Regex" , Val&: Category.Regex); |
| 19 | IO.mapOptional(Key: "Priority" , Val&: Category.Priority); |
| 20 | IO.mapOptional(Key: "SortPriority" , Val&: Category.SortPriority); |
| 21 | IO.mapOptional(Key: "CaseSensitive" , Val&: Category.RegexIsCaseSensitive); |
| 22 | } |
| 23 | |
| 24 | void ScalarEnumerationTraits<IncludeStyle::IncludeBlocksStyle>::enumeration( |
| 25 | IO &IO, IncludeStyle::IncludeBlocksStyle &Value) { |
| 26 | IO.enumCase(Val&: Value, Str: "Preserve" , ConstVal: IncludeStyle::IBS_Preserve); |
| 27 | IO.enumCase(Val&: Value, Str: "Merge" , ConstVal: IncludeStyle::IBS_Merge); |
| 28 | IO.enumCase(Val&: Value, Str: "Regroup" , ConstVal: IncludeStyle::IBS_Regroup); |
| 29 | } |
| 30 | |
| 31 | void ScalarEnumerationTraits<IncludeStyle::MainIncludeCharDiscriminator>:: |
| 32 | enumeration(IO &IO, IncludeStyle::MainIncludeCharDiscriminator &Value) { |
| 33 | IO.enumCase(Val&: Value, Str: "Quote" , ConstVal: IncludeStyle::MICD_Quote); |
| 34 | IO.enumCase(Val&: Value, Str: "AngleBracket" , ConstVal: IncludeStyle::MICD_AngleBracket); |
| 35 | IO.enumCase(Val&: Value, Str: "Any" , ConstVal: IncludeStyle::MICD_Any); |
| 36 | } |
| 37 | |
| 38 | } // namespace yaml |
| 39 | } // namespace llvm |
| 40 | |