[UniqueLinkageName] Use consistent checks when mangling symbo linkage name and debug...
authorHongtao Yu <hoy@fb.com>
Wed, 17 Mar 2021 18:17:17 +0000 (11:17 -0700)
committerHongtao Yu <hoy@fb.com>
Fri, 19 Mar 2021 05:11:16 +0000 (22:11 -0700)
commitfc1812a0ad757838b66aab57e1df720ec205a16a
tree3794a2a24e12515b8d63eb32357530c45851fa01
parent1410db70b98d26e9a354373f02d4e4c407468933
[UniqueLinkageName] Use consistent checks when mangling symbo linkage name and debug linkage name.

C functions may be declared and defined in different prototypes like below. This patch unifies the checks for mangling names in symbol linkage name emission and debug linkage name emission so that the two names are consistent.

static int go(int);

static int go(a) int a;
{
  return a;
}

Test Plan:

Differential Revision: https://reviews.llvm.org/D98799
clang/lib/AST/ItaniumMangle.cpp
clang/lib/CodeGen/CGDebugInfo.cpp
clang/test/CodeGen/unique-internal-linkage-names-dwarf.c