[dsymutil] Add flag to force a static variable to keep its enclosing function
authorJonas Devlieghere <jonas@devlieghere.com>
Tue, 27 Apr 2021 01:20:49 +0000 (18:20 -0700)
committerJonas Devlieghere <jonas@devlieghere.com>
Wed, 28 Apr 2021 18:33:04 +0000 (11:33 -0700)
commit625bd94c6d645c4cae40649800de8047bacd3f53
treea97bd9fe2c366e576bd00274aae5aefb44a58e52
parent8a4ee3b39c149d6cf344f0804a572d5ff120bdff
[dsymutil] Add flag to force a static variable to keep its enclosing function

Add a flag to change dsymutil's behavior and force a static variable to
keep its enclosing function. The test shows a situation where that could
be useful. I'm not convinced this behavior makes sense as a default,
which is why it's behind a flag.

rdar://74918374

Differential revision: https://reviews.llvm.org/D101337
llvm/docs/CommandGuide/dsymutil.rst
llvm/include/llvm/DWARFLinker/DWARFLinker.h
llvm/lib/DWARFLinker/DWARFLinker.cpp
llvm/test/tools/dsymutil/Inputs/private/tmp/keep_func/main.o [new file with mode: 0644]
llvm/test/tools/dsymutil/Inputs/private/tmp/keep_func/main.out [new file with mode: 0755]
llvm/test/tools/dsymutil/X86/keep-func.test [new file with mode: 0644]
llvm/test/tools/dsymutil/cmdline.test
llvm/tools/dsymutil/DwarfLinkerForBinary.cpp
llvm/tools/dsymutil/LinkUtils.h
llvm/tools/dsymutil/Options.td
llvm/tools/dsymutil/dsymutil.cpp