Skip to content

[NFC][Cloning] Remove now unused CollectDebugInfoForCloning #129152

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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions llvm/include/llvm/Transforms/Utils/Cloning.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,20 +230,6 @@ void CloneAndPruneFunctionInto(Function *NewFunc, const Function *OldFunc,
const char *NameSuffix = "",
ClonedCodeInfo *CodeInfo = nullptr);

/// Collect debug information such as types, compile units, and other
/// subprograms that are reachable from \p F and can be considered global for
/// the purposes of cloning (and hence not needing to be cloned).
///
/// What debug information should be processed depends on \p Changes: when
/// cloning into the same module we process \p F's subprogram and instructions;
/// when into a cloned module, neither of those.
///
/// Returns DISubprogram of the cloned function when cloning into the same
/// module or nullptr otherwise.
DISubprogram *CollectDebugInfoForCloning(const Function &F,
CloneFunctionChangeType Changes,
DebugInfoFinder &DIFinder);

/// This class captures the data input to the InlineFunction call, and records
/// the auxiliary results produced by it.
class InlineFunctionInfo {
Expand Down
21 changes: 0 additions & 21 deletions llvm/lib/Transforms/Utils/CloneFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,27 +168,6 @@ void llvm::CloneFunctionAttributesInto(Function *NewFunc,
OldAttrs.getRetAttrs(), NewArgAttrs));
}

DISubprogram *llvm::CollectDebugInfoForCloning(const Function &F,
CloneFunctionChangeType Changes,
DebugInfoFinder &DIFinder) {
// CloneModule takes care of cloning debug info for ClonedModule. Cloning into
// DifferentModule is taken care of separately in ClonedFunctionInto as part
// of llvm.dbg.cu update.
if (Changes >= CloneFunctionChangeType::DifferentModule)
return nullptr;

DISubprogram *SPClonedWithinModule = nullptr;
if (Changes < CloneFunctionChangeType::DifferentModule) {
SPClonedWithinModule = F.getSubprogram();
}
if (SPClonedWithinModule)
DIFinder.processSubprogram(SPClonedWithinModule);

collectDebugInfoFromInstructions(F, DIFinder);

return SPClonedWithinModule;
}

void llvm::CloneFunctionMetadataInto(Function &NewFunc, const Function &OldFunc,
ValueToValueMapTy &VMap,
RemapFlags RemapFlag,
Expand Down
Loading