Skip to content

Commit 42726a3

Browse files
committed
[NFC][Coro] Use CloneFunctionInto for coroutine cloning instead of CloneFunction<Part>
Summary: CloneFunctionInto now is fast on its own and we don't need to use CloneFunctionAttributes/Metadata/Body separately. CommonDebugInfo in CoroClone is now unused and is cleaned up separately in the next diff in the stack. Test Plan: ninja check-all stack-info: PR: #129149, branch: users/artempyanykh/fast-coro-upstream-part2-take2/7
1 parent 2773399 commit 42726a3

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

llvm/lib/Transforms/Coroutines/CoroSplit.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -922,14 +922,8 @@ void coro::BaseCloner::create() {
922922
auto savedLinkage = NewF->getLinkage();
923923
NewF->setLinkage(llvm::GlobalValue::ExternalLinkage);
924924

925-
MetadataPredicate IdentityMD = [&](const Metadata *MD) {
926-
return CommonDebugInfo.contains(MD);
927-
};
928-
CloneFunctionAttributesInto(NewF, &OrigF, VMap, false);
929-
CloneFunctionMetadataInto(*NewF, OrigF, VMap, RF_None, nullptr, nullptr,
930-
&IdentityMD);
931-
CloneFunctionBodyInto(*NewF, OrigF, VMap, RF_None, Returns, "", nullptr,
932-
nullptr, nullptr, &IdentityMD);
925+
CloneFunctionInto(NewF, &OrigF, VMap,
926+
CloneFunctionChangeType::LocalChangesOnly, Returns);
933927

934928
auto &Context = NewF->getContext();
935929

0 commit comments

Comments
 (0)