[llvm] r226517 - IR: Simplify erasing from uniquing store, NFC
Duncan P. N. Exon Smith
dexonsmith at apple.com
Mon Jan 19 14:47:08 PST 2015
Author: dexonsmith
Date: Mon Jan 19 16:47:08 2015
New Revision: 226517
URL: http://llvm.org/viewvc/llvm-project?rev=226517&view=rev
Log:
IR: Simplify erasing from uniquing store, NFC
Modified:
llvm/trunk/include/llvm/IR/Metadata.h
llvm/trunk/lib/IR/Metadata.cpp
Modified: llvm/trunk/include/llvm/IR/Metadata.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Metadata.h?rev=226517&r1=226516&r2=226517&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/Metadata.h (original)
+++ llvm/trunk/include/llvm/IR/Metadata.h Mon Jan 19 16:47:08 2015
@@ -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();
};
//===----------------------------------------------------------------------===//
Modified: llvm/trunk/lib/IR/Metadata.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Metadata.cpp?rev=226517&r1=226516&r2=226517&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Metadata.cpp (original)
+++ llvm/trunk/lib/IR/Metadata.cpp Mon Jan 19 16:47:08 2015
@@ -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();
More information about the llvm-commits
mailing list