[PATCH] D44765: PR36643 Make clang-format support more generic TMarcos

Alexander Kornienko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 26 08:31:51 PDT 2018


alexfh requested changes to this revision.
alexfh added a comment.
This revision now requires changes to proceed.

Thank you! One more comment from me and I'll leave the rest of the review to Krasimir, who has a better idea of how the configuration options should be named etc.



================
Comment at: include/clang/Format/Format.h:1676-1677
 
+  /// \brief A vector of macros that should be interpreted as string wrapping
+  /// macros instead of as function calls.
+  ///
----------------
I'm not sure "string wrapping macros" is the right term or can be easily understood by the reader of the code. The relevant MSDN page is talking about "generic-text mapping". I'm not sure this is a commonly used term either, but at least there's a precedent. Another relevant term is "encoding prefix". With these in mind, I could suggest following descriptions: "generic-text mapping macros", "string literal encoding prefix macros", "macros expanding to a string literal encoding prefix".

I'd also expand this a bit explaining where these macros are coming from and how they are special. Something along the lines of:

"Some libraries provide macro(s) to change the encoding prefix of string literals depending on configuration, for example, `_T()` macro on Microsoft platforms. When splitting string literals, the macro should be applied to each fragment of the literal to apply the same encoding prefix to all of them, which requires special treatment from clang-format. This option lists the names of these special macros."


Repository:
  rC Clang

https://reviews.llvm.org/D44765





More information about the cfe-commits mailing list