summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/Format.cpp
diff options
context:
space:
mode:
authorKrasimir Georgiev <krasimir@google.com>2017-07-03 15:05:14 +0000
committerKrasimir Georgiev <krasimir@google.com>2017-07-03 15:05:14 +0000
commit26b144cc32ca4db10f0be7c6d2c7085f7b496c29 (patch)
treec312277ac94f3cb35efef79c7985f75b6f31ffca /clang/lib/Format/Format.cpp
parentd3173740fd2a0bf6a092e8d1e3413df75d8521d8 (diff)
downloadbcm5719-llvm-26b144cc32ca4db10f0be7c6d2c7085f7b496c29.tar.gz
bcm5719-llvm-26b144cc32ca4db10f0be7c6d2c7085f7b496c29.zip
[clang-format] Support text proto messages
Summary: This patch adds support for textual protocol buffer messages. Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits, klimek, mgorny Differential Revision: https://reviews.llvm.org/D34441 llvm-svn: 307029
Diffstat (limited to 'clang/lib/Format/Format.cpp')
-rw-r--r--clang/lib/Format/Format.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index bb6781d7951..aa4ed8c42a7 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -56,6 +56,7 @@ template <> struct ScalarEnumerationTraits<FormatStyle::LanguageKind> {
IO.enumCase(Value, "ObjC", FormatStyle::LK_ObjC);
IO.enumCase(Value, "Proto", FormatStyle::LK_Proto);
IO.enumCase(Value, "TableGen", FormatStyle::LK_TableGen);
+ IO.enumCase(Value, "TextProto", FormatStyle::LK_TextProto);
}
};
@@ -631,6 +632,12 @@ FormatStyle getLLVMStyle() {
}
FormatStyle getGoogleStyle(FormatStyle::LanguageKind Language) {
+ if (Language == FormatStyle::LK_TextProto) {
+ FormatStyle GoogleStyle = getGoogleStyle(FormatStyle::LK_Proto);
+ GoogleStyle.Language = FormatStyle::LK_TextProto;
+ return GoogleStyle;
+ }
+
FormatStyle GoogleStyle = getLLVMStyle();
GoogleStyle.Language = Language;
OpenPOWER on IntegriCloud