mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-01 00:17:01 +00:00
IR: Move creation logic to MDNodeFwdDecl, NFC
Same as with `MDTuple`, factor out a `friend MDNode` by moving creation logic to the concrete subclass. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225690 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -813,7 +813,6 @@ MDNode *MDNode::getDistinct(LLVMContext &Context, ArrayRef<Metadata *> MDs) {
|
||||
/// uniqued, and is suitable for forward references.
|
||||
class MDNodeFwdDecl : public MDNode, ReplaceableMetadataImpl {
|
||||
friend class Metadata;
|
||||
friend class MDNode;
|
||||
friend class ReplaceableMetadataImpl;
|
||||
|
||||
MDNodeFwdDecl(LLVMContext &C, ArrayRef<Metadata *> Vals)
|
||||
@@ -823,6 +822,10 @@ public:
|
||||
~MDNodeFwdDecl() { dropAllReferences(); }
|
||||
using MDNode::operator delete;
|
||||
|
||||
static MDNodeFwdDecl *get(LLVMContext &Context, ArrayRef<Metadata *> MDs) {
|
||||
return new (MDs.size()) MDNodeFwdDecl(Context, MDs);
|
||||
}
|
||||
|
||||
static bool classof(const Metadata *MD) {
|
||||
return MD->getMetadataID() == MDNodeFwdDeclKind;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user