]> granicus.if.org Git - llvm/commit
[dsymutil] Pass LinkOptions by value instead of const ref.
authorJonas Devlieghere <jonas@devlieghere.com>
Tue, 30 Jul 2019 19:34:26 +0000 (19:34 +0000)
committerJonas Devlieghere <jonas@devlieghere.com>
Tue, 30 Jul 2019 19:34:26 +0000 (19:34 +0000)
commit7bbbe571686de8167ec444c379e8bb5e71d174d9
treecf1a9fa28d7e650920290804ad7a7d5b0ac31f80
parent9388778436fd4066ba6c591e6604cd2fa8abf5ca
[dsymutil] Pass LinkOptions by value instead of const ref.

When looping over the difference architectures in a fat binary, we
modify the link options before dispatching the link step to a different
thread. Passing the options by cont reference is not thread safe, as we
might modify its fields before the whole sturct is copied over.

Given that the link options are already stored in the DwarfLinker, we
can easily fix this by passing a copy of the link options instead of a
reference, which would just get copied later on.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367348 91177308-0d34-0410-b5e6-96231b3b80d8
tools/dsymutil/DwarfLinker.cpp
tools/dsymutil/DwarfLinker.h
tools/dsymutil/dsymutil.h