[PATCH] D44185: [Coroutines] Avoid assert splitting hidden coros

Brian Gesiak via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 6 19:02:57 PST 2018


modocache created this revision.
modocache added reviewers: GorNishanov, lewissbaker, EricWF.

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, but the linkage is not. To fix, copy the linkage
from the source function as well.

Test Plan: check-llvm


Repository:
  rL LLVM

https://reviews.llvm.org/D44185

Files:
  lib/Transforms/Coroutines/CoroSplit.cpp
  test/Transforms/Coroutines/coro-debug.ll
  test/Transforms/Coroutines/coro-eh-aware-edge-split.ll
  test/Transforms/Coroutines/coro-split-eh.ll
  test/Transforms/Coroutines/coro-split-hidden.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44185.137316.patch
Type: text/x-patch
Size: 6639 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180307/fb8c8683/attachment.bin>


More information about the llvm-commits mailing list