[PATCH] D74813: [RFC] Add hash of block contents to function block names

Duncan P. N. Exon Smith via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 14 19:03:56 PDT 2020


dexonsmith added a comment.

In D74813#1982089 <https://reviews.llvm.org/D74813#1982089>, @alexbdv wrote:

> @erik.pilkington / @vsk / @dexonsmith - how block name = hash(parent_function_name + block_type) ? 
>  So any blocks that are inside the same parent function + have the same type will get an incremental number to de-duplicate names.


Do these need to be behind a hash, or can we just put that directly in the block name?  The name is currently `__<mangled-function-name>_block_invoke` followed by an optional integer discriminator.  We could call it `__<mangled-function-name>_block_invoke_<mangled-block-type>` followed by an optional discriminator.  WDYT?



================
Comment at: clang/lib/AST/Mangle.cpp:86-87
+
 // FIXME: For blocks we currently mimic GCC's mangling scheme, which leaves
 // much to be desired. Come up with a better mangling scheme.
+static void mangleFunctionBlock(MangleContext &Context, StringRef Outer,
----------------
Seems like this patch is addressing this FIXME.  Can it be removed?


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

https://reviews.llvm.org/D74813





More information about the cfe-commits mailing list