IR: Simplify erasing from uniquing store, NFC
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 19 Jan 2015 22:47:08 +0000 (22:47 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 19 Jan 2015 22:47:08 +0000 (22:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226517 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/IR/Metadata.h
lib/IR/Metadata.cpp

index 5bd31c411c9bea0b4c6bcaddc8eac3ecd94bc59c..8ce2726899645ffbf268c401f32c48605d12a8f5 100644 (file)
@@ -959,7 +959,6 @@ public:
 
 private:
   MDTuple *uniquifyImpl();
-  void eraseFromStoreImpl();
 };
 
 MDTuple *MDNode::get(LLVMContext &Context, ArrayRef<Metadata *> MDs) {
@@ -1037,7 +1036,6 @@ public:
 
 private:
   MDLocation *uniquifyImpl();
-  void eraseFromStoreImpl();
 };
 
 //===----------------------------------------------------------------------===//
index 822a9f5237c8f652a163e08cb566b94369ed82e7..5f327fad06a02b9612fc1afae2850ccd7e581f1a 100644 (file)
@@ -631,7 +631,7 @@ void UniquableMDNode::eraseFromStore() {
     llvm_unreachable("Invalid subclass of UniquableMDNode");
 #define HANDLE_UNIQUABLE_LEAF(CLASS)                                           \
   case CLASS##Kind:                                                            \
-    cast<CLASS>(this)->eraseFromStoreImpl();                                   \
+    getContext().pImpl->CLASS##s.erase(cast<CLASS>(this));                     \
     break;
 #include "llvm/IR/Metadata.def"
   }
@@ -687,8 +687,6 @@ MDTuple *MDTuple::uniquifyImpl() {
   return this;
 }
 
-void MDTuple::eraseFromStoreImpl() { getContext().pImpl->MDTuples.erase(this); }
-
 MDLocation::MDLocation(LLVMContext &C, StorageType Storage, unsigned Line,
                        unsigned Column, ArrayRef<Metadata *> MDs)
     : UniquableMDNode(C, MDLocationKind, Storage, MDs) {
@@ -752,10 +750,6 @@ MDLocation *MDLocation::uniquifyImpl() {
   return this;
 }
 
-void MDLocation::eraseFromStoreImpl() {
-  getContext().pImpl->MDLocations.erase(this);
-}
-
 void MDNode::deleteTemporary(MDNode *N) {
   assert(N->isTemporary() && "Expected temporary node");
   cast<UniquableMDNode>(N)->deleteAsSubclass();