summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/Format.cpp
diff options
context:
space:
mode:
authorKrasimir Georgiev <krasimir@google.com>2018-01-17 16:17:26 +0000
committerKrasimir Georgiev <krasimir@google.com>2018-01-17 16:17:26 +0000
commit2537e2209454a67f9630fcacae6b05e2a7caffb1 (patch)
treecf133faa1ae78e23c05b6462ba78875baa0423bc /clang/lib/Format/Format.cpp
parent2c6fe505b1868033fa1e225ec5a777dbb9e01700 (diff)
downloadbcm5719-llvm-2537e2209454a67f9630fcacae6b05e2a7caffb1.tar.gz
bcm5719-llvm-2537e2209454a67f9630fcacae6b05e2a7caffb1.zip
[clang-format] adds enclosing function detection to raw string formatting
Summary: This patch adds enclosing function detection to raw string formatting. Reviewers: bkramer Reviewed By: bkramer Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D42167 llvm-svn: 322678
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 ebcf3ab4539..6ef38ad1692 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -457,6 +457,7 @@ template <> struct MappingTraits<FormatStyle::RawStringFormat> {
static void mapping(IO &IO, FormatStyle::RawStringFormat &Format) {
IO.mapOptional("Language", Format.Language);
IO.mapOptional("Delimiters", Format.Delimiters);
+ IO.mapOptional("EnclosingFunctions", Format.EnclosingFunctions);
IO.mapOptional("BasedOnStyle", Format.BasedOnStyle);
}
};
@@ -705,6 +706,12 @@ FormatStyle getGoogleStyle(FormatStyle::LanguageKind Language) {
"textproto",
"TEXTPROTO",
},
+ /*EnclosingFunctionNames=*/
+ {
+ "EqualsProto",
+ "PARSE_TEXT_PROTO",
+ "ParseTextProto",
+ },
/*BasedOnStyle=*/"google",
}};
GoogleStyle.SpacesBeforeTrailingComments = 2;
OpenPOWER on IntegriCloud