[clang] [compiler-rt] [libc] [clang-tools-extra] [libcxx] [llvm] [lldb] [flang] ✨ [Sema, Lex, Parse] Preprocessor embed in C and C++ (and Obj-C and Obj-C++ by-proxy) (PR #68620)

James Y Knight via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 27 13:46:49 PST 2023


jyknight wrote:

I'm somewhat concerned about the default for `-E` being to explode `#embed` into the comma-separated raw integers. Even with moderately-sized embeds, I think it'll generate unusably-bloated output. The human-readability of a big list of integers is not better than embedded base64 -- and actually, seems more of a pain to decode.

I think the most user-friendly behavior would be:
- `-E`: convert `#embed "file"` into `#embed_base64 "base64-file-contents"`. This preserves the property of the output not depending on other files, but doesn't make it hugely-bloated.
- `-E -dE`: preserve any `#embed` directive as-is, referring to the external file.
- Potentially another `-d?` mode to explode `#embed` into the raw integers (like you had proposed for the default behavior) -- though I'm not sure that's really going to be useful.

https://github.com/llvm/llvm-project/pull/68620


More information about the cfe-commits mailing list