summaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Coroutines/CoroSplit.cpp
diff options
context:
space:
mode:
authorArtem Pianykh <artem.pyanykh@gmail.com>2025-03-14 15:08:40 +0000
committerGitHub <noreply@github.com>2025-03-14 15:08:40 +0000
commit841f4637a078ce9adc5ef45f533a43bf7fbc7fc7 (patch)
tree563877499208a1c3c34ba84e419e7784b355bf34 /llvm/lib/Transforms/Coroutines/CoroSplit.cpp
parent389ed474e81f402294a1dc03a5ea7b039a523965 (diff)
[NFC][Coro] Use CloneFunctionInto for coroutine cloning instead of CloneFunction<Part> (#129149)
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
Diffstat (limited to 'llvm/lib/Transforms/Coroutines/CoroSplit.cpp')
-rw-r--r--llvm/lib/Transforms/Coroutines/CoroSplit.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/Coroutines/CoroSplit.cpp b/llvm/lib/Transforms/Coroutines/CoroSplit.cpp
index b2c4e6431972..fabbf5f020a7 100644
--- a/llvm/lib/Transforms/Coroutines/CoroSplit.cpp
+++ b/llvm/lib/Transforms/Coroutines/CoroSplit.cpp
@@ -921,14 +921,8 @@ void coro::BaseCloner::create() {
auto savedLinkage = NewF->getLinkage();
NewF->setLinkage(llvm::GlobalValue::ExternalLinkage);
- MetadataPredicate IdentityMD = [&](const Metadata *MD) {
- return CommonDebugInfo.contains(MD);
- };
- CloneFunctionAttributesInto(NewF, &OrigF, VMap, false);
- CloneFunctionMetadataInto(*NewF, OrigF, VMap, RF_None, nullptr, nullptr,
- &IdentityMD);
- CloneFunctionBodyInto(*NewF, OrigF, VMap, RF_None, Returns, "", nullptr,
- nullptr, nullptr, &IdentityMD);
+ CloneFunctionInto(NewF, &OrigF, VMap,
+ CloneFunctionChangeType::LocalChangesOnly, Returns);
auto &Context = NewF->getContext();