diff options
author | Eli Friedman <efriedma@codeaurora.org> | 2018-07-13 21:58:55 +0000 |
---|---|---|
committer | Eli Friedman <efriedma@codeaurora.org> | 2018-07-13 21:58:55 +0000 |
commit | 835297a9516520b58010c5870258e4176c17f5d1 (patch) | |
tree | 34d9e49987bedbb01bbd0c8ad158d18f0da4805e /llvm/lib/Linker/IRMover.cpp | |
parent | dcdc9ac7a2a8717e503cdf2ba63b1f26e30846bb (diff) | |
download | bcm5719-llvm-835297a9516520b58010c5870258e4176c17f5d1.tar.gz bcm5719-llvm-835297a9516520b58010c5870258e4176c17f5d1.zip |
[LTO] Fix linking with an alias defined using another alias.
When we're linking an alias which will be defined later, we neeed to
build a GlobalAlias, or else we'll crash later in
IRLinker::linkGlobalValueBody.
clang sometimes constructs aliases like this for C++ destructors.
Differential Revision: https://reviews.llvm.org/D49316
llvm-svn: 337053
Diffstat (limited to 'llvm/lib/Linker/IRMover.cpp')
-rw-r--r-- | llvm/lib/Linker/IRMover.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Linker/IRMover.cpp b/llvm/lib/Linker/IRMover.cpp index 0416ddd5601..12f0a1e67c1 100644 --- a/llvm/lib/Linker/IRMover.cpp +++ b/llvm/lib/Linker/IRMover.cpp @@ -948,7 +948,7 @@ Expected<Constant *> IRLinker::linkGlobalValueProto(GlobalValue *SGV, if (DoneLinkingBodies) return nullptr; - NewGV = copyGlobalValueProto(SGV, ShouldLink); + NewGV = copyGlobalValueProto(SGV, ShouldLink || ForAlias); if (ShouldLink || !ForAlias) forceRenaming(NewGV, SGV->getName()); } |