clang 24.0.0git
IncludeStyle.cpp
Go to the documentation of this file.
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
10
12
13namespace llvm {
14namespace yaml {
15
16void MappingTraits<IncludeStyle::IncludeCategory>::mapping(
17 IO &IO, IncludeStyle::IncludeCategory &Category) {
18 IO.mapOptional("Regex", Category.Regex);
19 IO.mapOptional("Priority", Category.Priority);
20 IO.mapOptional("SortPriority", Category.SortPriority);
21 IO.mapOptional("CaseSensitive", Category.RegexIsCaseSensitive);
22}
23
24void ScalarEnumerationTraits<IncludeStyle::IncludeBlocksStyle>::enumeration(
26 IO.enumCase(Value, "Preserve", IncludeStyle::IBS_Preserve);
27 IO.enumCase(Value, "Merge", IncludeStyle::IBS_Merge);
28 IO.enumCase(Value, "Regroup", IncludeStyle::IBS_Regroup);
29}
30
31void ScalarEnumerationTraits<IncludeStyle::MainIncludeCharDiscriminator>::
33 IO.enumCase(Value, "Quote", IncludeStyle::MICD_Quote);
34 IO.enumCase(Value, "AngleBracket", IncludeStyle::MICD_AngleBracket);
35 IO.enumCase(Value, "Any", IncludeStyle::MICD_Any);
36}
37
38} // namespace yaml
39} // namespace llvm
Diagnostic wrappers for TextAPI types for error reporting.
Definition Dominators.h:30
IncludeBlocksStyle
Styles for sorting multiple #include blocks.
@ IBS_Preserve
Sort each #include block separately.
@ IBS_Regroup
Merge multiple #include blocks together and sort as one.
@ IBS_Merge
Merge multiple #include blocks together and sort as one.
MainIncludeCharDiscriminator
Character to consider in the include directives for the main header.
@ MICD_Quote
Main include uses quotes: #include "foo.hpp" (the default).
@ MICD_AngleBracket
Main include uses angle brackets: #include <foo.hpp>.
@ MICD_Any
Main include uses either quotes or angle brackets.
Style for sorting and grouping C++ include directives.