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

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat May 15 19:05:29 PDT 2021


dblaikie added subscribers: JDevlieghere, rjmccall.
dblaikie added a comment.

OK - poked around a bit more to better understand this, so attempting to summarize my current understanding (excuse the repetition from previous parts of this thread) and results.

- `__attribute__((overloadable))` can/does mangle K&R C style declarations <https://reviews.llvm.org/D98799#2638997>
- with this patch (currently committed), `-funique-internal-linkage-names` does not mangle K&R C style declarations (see `bar` in the included test case, unmangled)
- I'd like to avoid that divergence if possible
- Changing the debug info code to be more generous with names it mangles (by using `FD->getType()->getAs<FunctionProtoType>()` rather than `hasPrototype()`) causes problems
  - Specifically: Objective C blocks (which have a `FunctionProtoType` type, but `!hasPrototype` it seems) are missing parameter info so this <https://github.com/llvm-mirror/clang/blob/aa231e4be75ac4759c236b755c57876f76e3cf05/lib/AST/ItaniumMangle.cpp#L2908> call crashes
    - There doesn't seem to be any way to test for this property of the `FunctionDecl` that I can see - where it has a type, but doesn't have parameter info

Trying to pull in some folks who might know what's going on here/be able to suggest a way to split these cases if needed, or fix the block `FunctionDecl`s to have param info. @rjmccall @JDevlieghere - I'd really appreciate some help here.


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