diff options
author | Brian Gesiak <modocache@gmail.com> | 2018-04-02 23:39:40 +0000 |
---|---|---|
committer | Brian Gesiak <modocache@gmail.com> | 2018-04-02 23:39:40 +0000 |
commit | 64521bed0d7f44ab06fc7ae2f7bc05955c7211fd (patch) | |
tree | 23d52f870ca16847e1967b8fe755fc2bf860bcb9 /llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | |
parent | bae4856d31d7316e854e4222b224cf6ca26b9aa2 (diff) | |
download | bcm5719-llvm-64521bed0d7f44ab06fc7ae2f7bc05955c7211fd.tar.gz bcm5719-llvm-64521bed0d7f44ab06fc7ae2f7bc05955c7211fd.zip |
[Coroutines] Avoid assert splitting hidden coros
Summary:
When attempting to split a coroutine with 'hidden' visibility (for
example, a C++ coroutine that is inlined when compiled with the option
'-fvisibility-inlines-hidden'), LLVM would hit an assertion in
include/llvm/IR/GlobalValue.h:240: "local linkage requires default
visibility". The issue is that the visibility is copied from the source
of the function split in the `CloneFunctionInto` function, but the linkage
is not. To fix, create the new function first with external linkage,
then copy the linkage from the original function *after* `CloneFunctionInto`
is called.
Since `GlobalValue::setLinkage` in turn calls `maybeSetDsoLocal`, the
explicit call to `setDSOLocal` can be removed in CoroSplit.cpp.
Test Plan: check-llvm
Reviewers: GorNishanov, lewissbaker, EricWF, majnemer, rnk
Reviewed By: rnk
Subscribers: llvm-commits, eric_niebler
Differential Revision: https://reviews.llvm.org/D44185
llvm-svn: 329033
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp')
0 files changed, 0 insertions, 0 deletions