summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/Format.cpp
diff options
context:
space:
mode:
authorFrancois Ferrand <thetypz@gmail.com>2019-05-29 16:30:47 +0000
committerFrancois Ferrand <thetypz@gmail.com>2019-05-29 16:30:47 +0000
commitc5227a1f53103d6c0cbcb5a59da84356208df0dd (patch)
tree025607de43508ca352e0d14c6b10a36c4b51d09d /clang/lib/Format/Format.cpp
parent308b7139b1d8e2374014c37f170b30197271e958 (diff)
downloadbcm5719-llvm-c5227a1f53103d6c0cbcb5a59da84356208df0dd.tar.gz
bcm5719-llvm-c5227a1f53103d6c0cbcb5a59da84356208df0dd.zip
[clang-format] Allow configuring list of function-like macros that resolve to a type
Summary: Adds a `TypenameMacros` configuration option that causes certain identifiers to be handled in a way similar to `typeof()`. This is enough to: - Prevent misinterpreting declarations of pointers to such types as expressions (`STACK_OF(int) * foo` -> `STACK_OF(int) *foo`), - Avoid surprising line breaks in variable/struct field declarations (`STACK_OF(int)\nfoo;` -> `STACK_OF(int) foo;`, see https://bugs.llvm.org/show_bug.cgi?id=30353). Reviewers: Typz, krasimir, djasper Reviewed By: Typz Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D57184 llvm-svn: 361986
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 2772db0a110..d775ca14a7c 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -505,6 +505,7 @@ template <> struct MappingTraits<FormatStyle> {
IO.mapOptional("Standard", Style.Standard);
IO.mapOptional("StatementMacros", Style.StatementMacros);
IO.mapOptional("TabWidth", Style.TabWidth);
+ IO.mapOptional("TypenameMacros", Style.TypenameMacros);
IO.mapOptional("UseTab", Style.UseTab);
}
};
OpenPOWER on IntegriCloud