summaryrefslogtreecommitdiffstats
path: root/clang/lib/Tooling/Core/IncludeStyle.cpp
diff options
context:
space:
mode:
authorEric Liu <ioeric@google.com>2018-05-14 19:51:33 +0000
committerEric Liu <ioeric@google.com>2018-05-14 19:51:33 +0000
commit9d92c027e89e877409ec0e65f700d3bbb14d139b (patch)
treec8ee5107479e4ff85afb8cd5738c63553ad178d4 /clang/lib/Tooling/Core/IncludeStyle.cpp
parentd9f28735117d8ff86b48f093f7b37cce4aac2fdb (diff)
downloadbcm5719-llvm-9d92c027e89e877409ec0e65f700d3bbb14d139b.tar.gz
bcm5719-llvm-9d92c027e89e877409ec0e65f700d3bbb14d139b.zip
[clang-format] Move #include related style to libToolingCore
Summary: This will be shared by include insertion/deletion library. Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: mgorny, klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D46758 llvm-svn: 332284
Diffstat (limited to 'clang/lib/Tooling/Core/IncludeStyle.cpp')
-rw-r--r--clang/lib/Tooling/Core/IncludeStyle.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/clang/lib/Tooling/Core/IncludeStyle.cpp b/clang/lib/Tooling/Core/IncludeStyle.cpp
new file mode 100644
index 00000000000..74eec481c28
--- /dev/null
+++ b/clang/lib/Tooling/Core/IncludeStyle.cpp
@@ -0,0 +1,32 @@
+//===--- IncludeStyle.cpp - Style of C++ #include directives -----*- C++-*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang/Tooling/Core/IncludeStyle.h"
+
+
+using clang::tooling::IncludeStyle;
+
+namespace llvm {
+namespace yaml {
+
+void MappingTraits<IncludeStyle::IncludeCategory>::mapping(
+ IO &IO, IncludeStyle::IncludeCategory &Category) {
+ IO.mapOptional("Regex", Category.Regex);
+ IO.mapOptional("Priority", Category.Priority);
+}
+
+void ScalarEnumerationTraits<IncludeStyle::IncludeBlocksStyle>::enumeration(
+ IO &IO, IncludeStyle::IncludeBlocksStyle &Value) {
+ IO.enumCase(Value, "Preserve", IncludeStyle::IBS_Preserve);
+ IO.enumCase(Value, "Merge", IncludeStyle::IBS_Merge);
+ IO.enumCase(Value, "Regroup", IncludeStyle::IBS_Regroup);
+}
+
+} // namespace yaml
+} // namespace llvm
OpenPOWER on IntegriCloud