[llvm] [Utils] Identity map module-level debug info on first use in CloneFunction* (PR #118627)

Felipe de Azevedo Piovezan via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 22 08:34:11 PST 2025


================
@@ -242,13 +244,12 @@ DISubprogram *CollectDebugInfoForCloning(const Function &F,
                                          CloneFunctionChangeType Changes,
                                          DebugInfoFinder &DIFinder);
 
-/// Build a map of debug info to use during Metadata cloning.
-/// Returns true if cloning would need module level changes and false if there
-/// would only be local changes.
-bool BuildDebugInfoMDMap(DenseMap<const Metadata *, TrackingMDRef> &MD,
-                         CloneFunctionChangeType Changes,
-                         DebugInfoFinder &DIFinder,
-                         DISubprogram *SPClonedWithinModule);
+/// Based on \p Changes and \p DIFinder populate \p MD with debug info that
+/// needs to be identity mapped during Metadata cloning.
+void FindDebugInfoToIdentityMap(MetadataSetTy &MD,
----------------
felipepiovezan wrote:

Shouldn't MD be a return value instead of an out parameter? It's unclear why it has to be an outparameter from this description and usage of this function.

https://github.com/llvm/llvm-project/pull/118627


More information about the llvm-commits mailing list