summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/Format.cpp
diff options
context:
space:
mode:
authorKrasimir Georgiev <krasimir@google.com>2018-04-25 14:56:19 +0000
committerKrasimir Georgiev <krasimir@google.com>2018-04-25 14:56:19 +0000
commit5559cc3b75bd2c3bfdffd7ef752d899e085e4a39 (patch)
treeadec920450a5581b6356b937561c3cee7430c03b /clang/lib/Format/Format.cpp
parent1f5d9941192d9a5876c44d6c274b4447b9bf2099 (diff)
downloadbcm5719-llvm-5559cc3b75bd2c3bfdffd7ef752d899e085e4a39.tar.gz
bcm5719-llvm-5559cc3b75bd2c3bfdffd7ef752d899e085e4a39.zip
[clang-format] Start formatting cpp code in raw strings in google style
Summary: This adds some delimiters to detect cpp code in raw strings. Reviewers: klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D46062 llvm-svn: 330832
Diffstat (limited to 'clang/lib/Format/Format.cpp')
-rw-r--r--clang/lib/Format/Format.cpp43
1 files changed, 31 insertions, 12 deletions
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index e2d25657c72..2c23600430c 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -718,20 +718,39 @@ FormatStyle getGoogleStyle(FormatStyle::LanguageKind Language) {
GoogleStyle.ObjCSpaceAfterProperty = false;
GoogleStyle.ObjCSpaceBeforeProtocolList = true;
GoogleStyle.PointerAlignment = FormatStyle::PAS_Left;
- GoogleStyle.RawStringFormats = {{
- FormatStyle::LK_TextProto,
- /*Delimiters=*/
+ GoogleStyle.RawStringFormats = {
{
- "pb",
- "PB",
- "proto",
- "PROTO",
+ FormatStyle::LK_Cpp,
+ /*Delimiters=*/
+ {
+ "cc",
+ "CC",
+ "cpp",
+ "Cpp",
+ "CPP",
+ "c++",
+ "C++",
+ },
+ /*EnclosingFunctionNames=*/
+ {},
+ /*CanonicalDelimiter=*/"",
+ /*BasedOnStyle=*/"google",
},
- /*EnclosingFunctionNames=*/
- {},
- /*CanonicalDelimiter=*/"",
- /*BasedOnStyle=*/"google",
- }};
+ {
+ FormatStyle::LK_TextProto,
+ /*Delimiters=*/
+ {
+ "pb",
+ "PB",
+ "proto",
+ "PROTO",
+ },
+ /*EnclosingFunctionNames=*/
+ {},
+ /*CanonicalDelimiter=*/"",
+ /*BasedOnStyle=*/"google",
+ },
+ };
GoogleStyle.SpacesBeforeTrailingComments = 2;
GoogleStyle.Standard = FormatStyle::LS_Auto;
OpenPOWER on IntegriCloud