-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[NFC][Cloning] Make ClonedModule case more obvious in CollectDebugInfoForCloning #129143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
artempyanykh
merged 1 commit into
main
from
users/artempyanykh/fast-coro-upstream-part2-take2/1
Mar 9, 2025
Merged
[NFC][Cloning] Make ClonedModule case more obvious in CollectDebugInfoForCloning #129143
artempyanykh
merged 1 commit into
main
from
users/artempyanykh/fast-coro-upstream-part2-take2/1
Mar 9, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@llvm/pr-subscribers-llvm-transforms Author: Artem Pianykh (artempyanykh) Changes[NFC][Cloning] Make ClonedModule case more obvious in CollectDebugInfoForCloning Summary: Test Plan: Full diff: https://github.com/llvm/llvm-project/pull/129143.diff 1 Files Affected:
diff --git a/llvm/lib/Transforms/Utils/CloneFunction.cpp b/llvm/lib/Transforms/Utils/CloneFunction.cpp
index 58d400ac396be..9267930027c04 100644
--- a/llvm/lib/Transforms/Utils/CloneFunction.cpp
+++ b/llvm/lib/Transforms/Utils/CloneFunction.cpp
@@ -135,6 +135,10 @@ void llvm::CloneFunctionAttributesInto(Function *NewFunc,
DISubprogram *llvm::CollectDebugInfoForCloning(const Function &F,
CloneFunctionChangeType Changes,
DebugInfoFinder &DIFinder) {
+ // CloneModule takes care of cloning debug info.
+ if (Changes == CloneFunctionChangeType::ClonedModule)
+ return nullptr;
+
DISubprogram *SPClonedWithinModule = nullptr;
if (Changes < CloneFunctionChangeType::DifferentModule) {
SPClonedWithinModule = F.getSubprogram();
@@ -143,7 +147,7 @@ DISubprogram *llvm::CollectDebugInfoForCloning(const Function &F,
DIFinder.processSubprogram(SPClonedWithinModule);
const Module *M = F.getParent();
- if (Changes != CloneFunctionChangeType::ClonedModule && M) {
+ if (M) {
// Inspect instructions to process e.g. DILexicalBlocks of inlined functions
for (const auto &I : instructions(F))
DIFinder.processInstruction(*M, I);
|
6fc0fa0
to
25c4652
Compare
This was referenced Feb 27, 2025
Merged
jollaitbot
pushed a commit
to sailfishos-mirror/llvm-project
that referenced
this pull request
Feb 28, 2025
…oForCloning Summary: The code's behavior is unchanged, but it's more obvious right now. Test Plan: ninja check-llvm-unit check-llvm stack-info: PR: llvm/llvm-project#129143, branch: users/artempyanykh/fast-coro-upstream-part2-take2/1
felipepiovezan
approved these changes
Mar 4, 2025
…oForCloning Summary: The code's behavior is unchanged, but it's more obvious right now. Test Plan: ninja check-llvm-unit check-llvm stack-info: PR: #129143, branch: users/artempyanykh/fast-coro-upstream-part2-take2/1
25c4652
to
336c020
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Stacked PRs:
[NFC][Cloning] Make ClonedModule case more obvious in CollectDebugInfoForCloning
Summary:
The code's behavior is unchanged, but it's more obvious right now.
Test Plan:
ninja check-llvm-unit check-llvm