[llvm-branch-commits] [llvm] [NFC][Utils] Extract CloneFunctionMetadataInto from CloneFunctionInto (PR #118623)

Felipe de Azevedo Piovezan via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Dec 9 09:40:19 PST 2024


================
@@ -182,6 +182,18 @@ void CloneFunctionAttributesInto(Function *NewFunc, const Function *OldFunc,
                                  ValueMapTypeRemapper *TypeMapper = nullptr,
                                  ValueMaterializer *Materializer = nullptr);
 
+/// Clone OldFunc's metadata into NewFunc.
+///
+/// The caller is expected to populate \p VMap beforehand and set an appropriate
+/// \p RemapFlag.
+///
+/// NOTE: This function doesn't clone !llvm.dbg.cu when cloning into a different
+/// module. Use CloneFunctionInto for that behavior.
+void CloneFunctionMetadataInto(Function *NewFunc, const Function *OldFunc,
----------------
felipepiovezan wrote:

Can `NewFunc` or `OldFunc` be null? If not, we should make them references

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


More information about the llvm-branch-commits mailing list