Skip to content

Commit aa95bd8

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 0f7fb67 commit aa95bd8

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
@@ -921,14 +921,8 @@ void coro::BaseCloner::create() {
921921
auto savedLinkage = NewF->getLinkage();
922922
NewF->setLinkage(llvm::GlobalValue::ExternalLinkage);
923923

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

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

0 commit comments

Comments
 (0)