summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Metadata.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-01-12 20:21:37 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-01-12 20:21:37 +0000
commit942623540b24fbd3df5df314ee2e02a98a0909de (patch)
tree323c2efbb4c23965f88156eb1bfafeb7c9606ef3 /llvm/lib/IR/Metadata.cpp
parentb565b10956ab80e83bf17b878c7866347010d627 (diff)
downloadbcm5719-llvm-942623540b24fbd3df5df314ee2e02a98a0909de.tar.gz
bcm5719-llvm-942623540b24fbd3df5df314ee2e02a98a0909de.zip
IR: Move creation logic to MDNodeFwdDecl, NFC
Same as with `MDTuple`, factor out a `friend MDNode` by moving creation logic to the concrete subclass. llvm-svn: 225690
Diffstat (limited to 'llvm/lib/IR/Metadata.cpp')
-rw-r--r--llvm/lib/IR/Metadata.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/llvm/lib/IR/Metadata.cpp b/llvm/lib/IR/Metadata.cpp
index 3d444660c67..9088a75156e 100644
--- a/llvm/lib/IR/Metadata.cpp
+++ b/llvm/lib/IR/Metadata.cpp
@@ -607,14 +607,10 @@ MDTuple *MDTuple::getDistinct(LLVMContext &Context, ArrayRef<Metadata *> MDs) {
MDNodeFwdDecl *MDNode::getTemporary(LLVMContext &Context,
ArrayRef<Metadata *> MDs) {
- MDNodeFwdDecl *N = new (MDs.size()) MDNodeFwdDecl(Context, MDs);
- return N;
+ return MDNodeFwdDecl::get(Context, MDs);
}
-void MDNode::deleteTemporary(MDNode *N) {
- assert(isa<MDNodeFwdDecl>(N) && "Expected forward declaration");
- delete cast<MDNodeFwdDecl>(N);
-}
+void MDNode::deleteTemporary(MDNode *N) { delete cast<MDNodeFwdDecl>(N); }
void UniquableMDNode::storeDistinctInContext() {
assert(!IsDistinctInContext && "Expected newly distinct metadata");
OpenPOWER on IntegriCloud