From 668bd8ccfeb3dd8cdb19b1a07bc35d6b95dccff2 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Mon, 19 Jan 2015 22:47:08 +0000 Subject: [PATCH] IR: Simplify erasing from uniquing store, NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226517 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/IR/Metadata.h | 2 -- lib/IR/Metadata.cpp | 8 +------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/include/llvm/IR/Metadata.h b/include/llvm/IR/Metadata.h index 5bd31c411c9..8ce27268996 100644 --- a/include/llvm/IR/Metadata.h +++ b/include/llvm/IR/Metadata.h @@ -959,7 +959,6 @@ public: private: MDTuple *uniquifyImpl(); - void eraseFromStoreImpl(); }; MDTuple *MDNode::get(LLVMContext &Context, ArrayRef MDs) { @@ -1037,7 +1036,6 @@ public: private: MDLocation *uniquifyImpl(); - void eraseFromStoreImpl(); }; //===----------------------------------------------------------------------===// diff --git a/lib/IR/Metadata.cpp b/lib/IR/Metadata.cpp index 822a9f5237c..5f327fad06a 100644 --- a/lib/IR/Metadata.cpp +++ b/lib/IR/Metadata.cpp @@ -631,7 +631,7 @@ void UniquableMDNode::eraseFromStore() { llvm_unreachable("Invalid subclass of UniquableMDNode"); #define HANDLE_UNIQUABLE_LEAF(CLASS) \ case CLASS##Kind: \ - cast(this)->eraseFromStoreImpl(); \ + getContext().pImpl->CLASS##s.erase(cast(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 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(N)->deleteAsSubclass();