-};
-
-/// \brief Uniquable metadata node.
-///
-/// A uniquable metadata node. This contains the basic functionality
-/// for implementing sub-types of \a MDNode that can be uniqued like
-/// constants.
-///
-/// There is limited support for RAUW at construction time. At construction
-/// time, if any operand is a temporary node (or an unresolved uniqued node,
-/// which indicates a transitive temporary operand), the node itself will be
-/// unresolved. As soon as all operands become resolved, it will drop RAUW
-/// support permanently.
-///
-/// If an unresolved node is part of a cycle, \a resolveCycles() needs
-/// to be called on some member of the cycle once all temporary nodes have been
-/// replaced.
-class UniquableMDNode : public MDNode {
- friend class ReplaceableMetadataImpl;
- friend class MDNode;
- friend class LLVMContextImpl;
-
-protected:
- /// \brief Create a new node.
- ///
- /// If \c AllowRAUW, then if any operands are unresolved support RAUW. RAUW
- /// will be dropped once all operands have been resolved (or if \a
- /// resolveCycles() is called).
- UniquableMDNode(LLVMContext &C, unsigned ID, StorageType Storage,
- ArrayRef<Metadata *> Vals);
- ~UniquableMDNode() {}
-
- void storeDistinctInContext();
- template <class T, class StoreT>
- static T *storeImpl(T *N, StorageType Storage, StoreT &Store);
-
-public:
- static bool classof(const Metadata *MD) {
- return MD->getMetadataID() == MDTupleKind ||
- MD->getMetadataID() == MDLocationKind;
- }
-
- /// \brief Resolve cycles.
- ///
- /// Once all forward declarations have been resolved, force cycles to be
- /// resolved.
- ///
- /// \pre No operands (or operands' operands, etc.) have \a isTemporary().
- void resolveCycles();
-
-private:
- void handleChangedOperand(void *Ref, Metadata *New);