[llvm] [MergeFunctions] Add support to run the pass over a set of function pointers (PR #111045)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 27 07:51:44 PST 2024


================
@@ -467,9 +488,17 @@ bool MergeFunctions::runOnModule(Module &M) {
   return Changed;
 }
 
+DenseMap<Function *, Function *>
+MergeFunctions::runOnFunctions(ArrayRef<Function *> F) {
+  bool MergeResult = this->run(F);
+  if (!MergeResult)
+    this->DelToNewMap = DenseMap<Function *, Function *>();
----------------
nikic wrote:

Can this be
```suggestion
  assert(MergeResult == !DelToNewMap.empty());
```
to ensure consistency?

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


More information about the llvm-commits mailing list