[PATCH] D98799: [UniqueLinkageName] Use consistent checks when mangling symbo linkage name and debug linkage name.

Hongtao Yu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 13 13:44:09 PDT 2021


hoy added a comment.

In D98799#2757959 <https://reviews.llvm.org/D98799#2757959>, @dblaikie wrote:

>> I took another look. I think the divergence comes from getAs<FunctionProtoType> vs hasPrototype. The debug data generation uses hasPrototype while getAs<FunctionProtoType> is used as overloadable attribute processing as long as unique linkage name processing before this change. More specifically, the following function definition is represented by FunctionProtoType while it does not hasPrototype.
>
> Ah, sorry, maybe I'm coming around to this - so you're saying that the test in `ItaniumMangleContextImpl::isUniqueInternalLinkageDecl` must match the check in `CGDebugInfo::collectFunctionDeclProps` And when they diverge something bad happens? (could you refresh me on what that breaks - something crashes in ObjectiveC test cases? Or the tests fail?)
>
> I wonder whether we should change both of them then?

Yes, from AutoFDO point of view they should match, since both ELF symbol names and debug names are used to generate profiles. The current patch unifies them but it causes divergence from overloadable. Previously, `ItaniumMangleContextImpl::isUniqueInternalLinkageDecl`  was consistent with overloadable. I tried to unify in the other way so that all the three places are consistent, i.e, using `FD->getType()->getAs<FunctionProtoType>()` everywhere and it caused the following tests to fail:

  Clang :: CodeGenCXX/cp-blocks-linetables.cpp
  Clang :: CodeGenCXX/debug-info-block-invocation-linkage-name.cpp
  Clang :: CodeGenCXX/debug-info-blocks.cpp
  Clang :: CodeGenObjCXX/nested-ehlocation.mm
  Clang :: CodeGenObjCXX/property-objects.mm
  Clang :: CodeGenObjCXX/synthesized-property-cleanup.mm 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98799



More information about the cfe-commits mailing list