[PATCH] D54539: [CodeGen] Replace '@' characters in block descriptors' symbol names with '\1' on ELF targets.

David Chisnall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 15 01:05:48 PST 2018


theraven added inline comments.


================
Comment at: lib/CodeGen/CGObjCRuntime.h:288
+  /// descriptor's symbol name.
+  virtual std::string getObjCEncodingForBlock(const BlockExpr *BE) const;
+
----------------
I'm not sure that this actually belongs in CGObjCRuntime.  The runtime doesn't care about the symbol namings, and the need for this mangling applies to any ELF platform (it would also apply to Mach-O if Mach-O adopted GNU-style symbol versioning).  It probably isn't relevant, for example, with WebAssembly, irrespective of the runtime, and it would be relevant for the Apple family of runtimes if anyone wanted to use them on ELF.  

If it does go in CGObjCRuntime, I think I'd prefer to have the implementation there as well and make it conditional on the object format, not on the runtime.  Having a function that maps Objective-C type encodings to valid symbol names in CGObjCRuntime would let us do a little bit of cleanup in CGObjCGNU* and could also be used in the blocks code.


Repository:
  rC Clang

https://reviews.llvm.org/D54539





More information about the cfe-commits mailing list