summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/Format.cpp
diff options
context:
space:
mode:
authorFrancois Ferrand <thetypz@gmail.com>2019-06-06 20:06:23 +0000
committerFrancois Ferrand <thetypz@gmail.com>2019-06-06 20:06:23 +0000
commite8a301f87f75b7743a62077ac60fe06739fbab4b (patch)
tree3ef20f94b8d870923625788e3c8a9d5154534da2 /clang/lib/Format/Format.cpp
parentf1d9b3180e6197674c26463ef193316333a03805 (diff)
downloadbcm5719-llvm-e8a301f87f75b7743a62077ac60fe06739fbab4b.tar.gz
bcm5719-llvm-e8a301f87f75b7743a62077ac60fe06739fbab4b.zip
clang-format: better handle namespace macros
Summary: Other macros are used to declare namespaces, and should thus be handled similarly. This is the case for crpcut's TESTSUITE macro, or for unittest-cpp's SUITE macro: TESTSUITE(Foo) { TEST(MyFirstTest) { assert(0); } } // TESTSUITE(Foo) This patch deals with this cases by introducing a new option to specify lists of namespace macros. Internally, it re-uses the system already in place for foreach and statement macros, to ensure there is no impact on performance. Reviewers: krasimir, djasper, klimek Reviewed By: klimek Subscribers: acoomans, cfe-commits, klimek Tags: #clang Differential Revision: https://reviews.llvm.org/D37813 llvm-svn: 362740
Diffstat (limited to 'clang/lib/Format/Format.cpp')
-rw-r--r--clang/lib/Format/Format.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index d775ca14a7c..31442b5124d 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -455,6 +455,7 @@ template <> struct MappingTraits<FormatStyle> {
IO.mapOptional("MacroBlockEnd", Style.MacroBlockEnd);
IO.mapOptional("MaxEmptyLinesToKeep", Style.MaxEmptyLinesToKeep);
IO.mapOptional("NamespaceIndentation", Style.NamespaceIndentation);
+ IO.mapOptional("NamespaceMacros", Style.NamespaceMacros);
IO.mapOptional("ObjCBinPackProtocolList", Style.ObjCBinPackProtocolList);
IO.mapOptional("ObjCBlockIndentWidth", Style.ObjCBlockIndentWidth);
IO.mapOptional("ObjCSpaceAfterProperty", Style.ObjCSpaceAfterProperty);
OpenPOWER on IntegriCloud