[PATCH] D100346: [Clang] String Literal and Wide String Literal Encoding from the Preprocessor

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 12 18:59:53 PDT 2021


rsmith added a comment.

Exposing this information seems fine to me. I think it'd be more useful to expose it in a way the preprocessor can inspect, but it's hard to see how to do that without requiring us to invent identifier-shaped names for all encodings, and perhaps we shouldn't be in the business of doing that. If this string literal approach addresses the use cases you have, then I think that's OK.



================
Comment at: clang/test/Preprocessor/init.c:122-123
 // COMMON:#define __clang_version__ {{.*}}
+// COMMON:#define __clang_literal_encoding__ {{.*}}
+// COMMON:#define __clang_wide_literal_encoding__ {{.*}}
 // COMMON:#define __llvm__ 1
----------------
Please add documentation to `docs/LanguageExtensions.rst` for these.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100346/new/

https://reviews.llvm.org/D100346



More information about the cfe-commits mailing list