IncludeStyle.cpp 1.2 KB

1234567891011121314151617181920212223242526272829303132
  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. #include "clang/Tooling/Inclusions/IncludeStyle.h"
  9. using clang::tooling::IncludeStyle;
  10. namespace llvm {
  11. namespace yaml {
  12. void MappingTraits<IncludeStyle::IncludeCategory>::mapping(
  13. IO &IO, IncludeStyle::IncludeCategory &Category) {
  14. IO.mapOptional("Regex", Category.Regex);
  15. IO.mapOptional("Priority", Category.Priority);
  16. IO.mapOptional("SortPriority", Category.SortPriority);
  17. IO.mapOptional("CaseSensitive", Category.RegexIsCaseSensitive);
  18. }
  19. void ScalarEnumerationTraits<IncludeStyle::IncludeBlocksStyle>::enumeration(
  20. IO &IO, IncludeStyle::IncludeBlocksStyle &Value) {
  21. IO.enumCase(Value, "Preserve", IncludeStyle::IBS_Preserve);
  22. IO.enumCase(Value, "Merge", IncludeStyle::IBS_Merge);
  23. IO.enumCase(Value, "Regroup", IncludeStyle::IBS_Regroup);
  24. }
  25. } // namespace yaml
  26. } // namespace llvm