================ @@ -44,6 +45,14 @@ void appendToGlobalCtors(Module &M, Function *F, int Priority, void appendToGlobalDtors(Module &M, Function *F, int Priority, Constant *Data = nullptr); +/// Apply 'Fn' to the list of global ctors of module M and replace contructor +/// record with the one returned by `Fn`. If `nullptr` was returned, the +/// corresponding constructor will be removed from the array. For details see +/// https://llvm.org/docs/LangRef.html#the-llvm-global-ctors-global-variable +using GlobalCtorUpdateFn = llvm::function_ref<Constant *(Constant *)>; +void updateGlobalCtors(Module &M, const GlobalCtorUpdateFn &Fn); ---------------- thurstond wrote:
'updateGlobalCtors' is a very generic name - is there a name that could be descriptive? (e.g., it's somewhat similar to 'map' in Haskell/Python or std::transform.) https://github.com/llvm/llvm-project/pull/101757 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits