[llvm] [IR] Remove variants of dropUnknownNonDebugMetadata (PR #98854)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 14 19:49:04 PDT 2024


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/98854

This patch removes:

- dropUnknownNonDebugMetadata()
- dropUnknownNonDebugMetadata(ID1)
- dropUnknownNonDebugMetadata(ID1, ID2)

The first variant has existing uses, but we can accommodate those by
adding a default parameter to the main variant.

The second and third variant do not have any existing use AFAICT.


>From ab6f151e2957e2965246880ff6d823d779c161d7 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Sun, 14 Jul 2024 19:27:35 -0700
Subject: [PATCH] [IR] Remove variants of dropUnknownNonDebugMetadata

This patch removes:

- dropUnknownNonDebugMetadata()
- dropUnknownNonDebugMetadata(ID1)
- dropUnknownNonDebugMetadata(ID1, ID2)

The first variant has existing uses, but we can accommodate those by
adding a default parameter to the main variant.

The second and third variant do not have any existing use AFAICT.
---
 llvm/include/llvm/IR/Instruction.h | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/llvm/include/llvm/IR/Instruction.h b/llvm/include/llvm/IR/Instruction.h
index 7a9b95f23465c..c27572300d506 100644
--- a/llvm/include/llvm/IR/Instruction.h
+++ b/llvm/include/llvm/IR/Instruction.h
@@ -433,17 +433,7 @@ class Instruction : public User,
   /// convenience method for passes to do so.
   /// dropUBImplyingAttrsAndUnknownMetadata should be used instead of
   /// this API if the Instruction being modified is a call.
-  void dropUnknownNonDebugMetadata(ArrayRef<unsigned> KnownIDs);
-  void dropUnknownNonDebugMetadata() {
-    return dropUnknownNonDebugMetadata(std::nullopt);
-  }
-  void dropUnknownNonDebugMetadata(unsigned ID1) {
-    return dropUnknownNonDebugMetadata(ArrayRef(ID1));
-  }
-  void dropUnknownNonDebugMetadata(unsigned ID1, unsigned ID2) {
-    unsigned IDs[] = {ID1, ID2};
-    return dropUnknownNonDebugMetadata(IDs);
-  }
+  void dropUnknownNonDebugMetadata(ArrayRef<unsigned> KnownIDs = std::nullopt);
   /// @}
 
   /// Adds an !annotation metadata node with \p Annotation to this instruction.



More information about the llvm-commits mailing list