-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[NFC][Cloning] Add a helper to collect debug info from instructions #129145
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/3
Mar 9, 2025
Merged
[NFC][Cloning] Add a helper to collect debug info from instructions #129145
artempyanykh
merged 1 commit into
main
from
users/artempyanykh/fast-coro-upstream-part2-take2/3
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
Summary: Just moving around. This helper will be used for further refactoring. Test Plan: ninja check-llvm-unit check-llvm stack-info: PR: #129145, branch: users/artempyanykh/fast-coro-upstream-part2-take2/3
@llvm/pr-subscribers-llvm-transforms Author: Artem Pianykh (artempyanykh) Changes[NFC][Cloning] Add a helper to collect debug info from instructions Summary: Test Plan: Full diff: https://github.com/llvm/llvm-project/pull/129145.diff 1 Files Affected:
diff --git a/llvm/lib/Transforms/Utils/CloneFunction.cpp b/llvm/lib/Transforms/Utils/CloneFunction.cpp
index 5a5b84c8e0a3c..9ea4e64671c7e 100644
--- a/llvm/lib/Transforms/Utils/CloneFunction.cpp
+++ b/llvm/lib/Transforms/Utils/CloneFunction.cpp
@@ -40,6 +40,18 @@ using namespace llvm;
#define DEBUG_TYPE "clone-function"
+namespace {
+void collectDebugInfoFromInstructions(const Function &F,
+ DebugInfoFinder &DIFinder) {
+ const Module *M = F.getParent();
+ if (M) {
+ // Inspect instructions to process e.g. DILexicalBlocks of inlined functions
+ for (const auto &I : instructions(F))
+ DIFinder.processInstruction(*M, I);
+ }
+}
+} // namespace
+
/// See comments in Cloning.h.
BasicBlock *llvm::CloneBasicBlock(const BasicBlock *BB, ValueToValueMapTy &VMap,
const Twine &NameSuffix, Function *F,
@@ -146,12 +158,7 @@ DISubprogram *llvm::CollectDebugInfoForCloning(const Function &F,
if (SPClonedWithinModule)
DIFinder.processSubprogram(SPClonedWithinModule);
- const Module *M = F.getParent();
- if (M) {
- // Inspect instructions to process e.g. DILexicalBlocks of inlined functions
- for (const auto &I : instructions(F))
- DIFinder.processInstruction(*M, I);
- }
+ collectDebugInfoFromInstructions(F, DIFinder);
return SPClonedWithinModule;
}
|
7cc5e27
to
eefce02
Compare
36b445a
to
dd91189
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
Summary: Just moving around. This helper will be used for further refactoring. Test Plan: ninja check-llvm-unit check-llvm stack-info: PR: llvm/llvm-project#129145, branch: users/artempyanykh/fast-coro-upstream-part2-take2/3
felipepiovezan
approved these changes
Mar 4, 2025
dd91189
to
33b79c9
Compare
7888809
to
36480c7
Compare
artempyanykh
added a commit
that referenced
this pull request
Mar 9, 2025
Summary: Just moving around. This helper will be used for further refactoring. Test Plan: ninja check-llvm-unit check-llvm stack-info: PR: #129145, branch: users/artempyanykh/fast-coro-upstream-part2-take2/3
33b79c9
to
181b126
Compare
Base automatically changed from
users/artempyanykh/fast-coro-upstream-part2-take2/2
to
main
March 9, 2025 17:49
181b126
to
e370743
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] Add a helper to collect debug info from instructions
Summary:
Just moving around. This helper will be used for further refactoring.
Test Plan:
ninja check-llvm-unit check-llvm