IR: Add MDNode::isDistinct()

Add API to indicate whether an `MDNode` is distinct.  A distinct node is
not stored in the MDNode uniquing tables, and will never be returned by
`MDNode::get()`.

Although distinct nodes are only currently created by uniquing
collisions (when operands change), PR22111 will allow these nodes to be
explicitly created.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225401 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith
2015-01-07 21:35:38 +00:00
parent 699e5d7bc9
commit ee06e126b7
2 changed files with 33 additions and 0 deletions

View File

@@ -642,6 +642,12 @@ public:
/// \brief Check if node is fully resolved.
bool isResolved() const;
/// \brief Check if node is distinct.
///
/// Distinct nodes are not uniqued, and will not be returned by \a
/// MDNode::get().
bool isDistinct() const { return IsDistinctInContext; }
protected:
/// \brief Set an operand.
///