Skip to content

[AIX]export function descriptor symbols related to template functions. #101920

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions llvm/utils/extract_symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def should_keep_itanium_symbol(symbol, calling_convention_decoration):
if not symbol.startswith("_") and not symbol.startswith("."):
return symbol
# Discard manglings that aren't nested names
match = re.match("_Z(T[VTIS])?(N.+)", symbol)
match = re.match("\.?_Z(T[VTIS])?(N.+)", symbol)
if not match:
return None
# Demangle the name. If the name is too complex then we don't need to keep
Expand Down Expand Up @@ -323,7 +323,7 @@ def get_template_name(sym, mangling):
if mangling == "microsoft":
names = parse_microsoft_mangling(sym)
else:
match = re.match("_Z(T[VTIS])?(N.+)", sym)
match = re.match("\.?_Z(T[VTIS])?(N.+)", sym)
if match:
names, _ = parse_itanium_nested_name(match.group(2))
else:
Expand Down Expand Up @@ -483,6 +483,9 @@ def parse_tool_path(parser, tool, val):
else:
outfile = sys.stdout
for k, v in list(symbol_defs.items()):
# On AIX, export function descriptors instead of function entries.
if platform.system() == "AIX" and k.startswith("."):
continue
template = get_template_name(k, args.mangling)
if v == 1 and (not template or template in template_instantiation_refs):
print(k, file=outfile)
Loading