Coroutines: adjust for SVN r358739

CallSite has been removed in favour of CallBase.  Adjust the coroutine split to
account for that.

llvm-svn: 368798
This commit is contained in:
John McCall 2019-08-14 03:54:25 +00:00
parent 3bbf207fbc
commit a318c55073
1 changed files with 6 additions and 4 deletions

View File

@ -1549,10 +1549,12 @@ static void replacePrepare(CallInst *Prepare, CallGraph &CG) {
// If so, we'll need to update the call graph.
if (PrepareUserNode) {
for (auto &Use : Cast->uses()) {
auto CS = CallSite(Use.getUser());
if (!CS || !CS.isCallee(&Use)) continue;
PrepareUserNode->removeCallEdgeFor(CS);
PrepareUserNode->addCalledFunction(CS, FnNode);
if (auto *CB = dyn_cast<CallBase>(Use.getUser())) {
if (!CB->isCallee(&Use))
continue;
PrepareUserNode->removeCallEdgeFor(*CB);
PrepareUserNode->addCalledFunction(CB, FnNode);
}
}
}