Skip to content

Commit

Permalink
[NFC][Cloning] Remove now unused CollectDebugInfoForCloning
Browse files Browse the repository at this point in the history
Summary:
This function is no longer used, let's remove it from the header and
impl.

Test Plan:
ninja check-llvm-unit
  • Loading branch information
artempyanykh committed Feb 27, 2025
1 parent 23375fb commit e841dd1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 35 deletions.
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

0 comments on commit e841dd1

Please sign in to comment.