[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)
commit3a56174d85a2c815ef55a24a6935fb4771201026
tree12ec14166a9779298193ff099a83b44c74c0e158
parent450afcea39edd897eed541527e5150a9063397dd
[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.

llvm-svn: 367348
llvm/tools/dsymutil/DwarfLinker.cpp
llvm/tools/dsymutil/DwarfLinker.h
llvm/tools/dsymutil/dsymutil.h