mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
IR: Make temporary nodes distinct
Change the return of `MDNode::isDistinct()` for `MDNode::getTemporary()` to `true`. They aren't uniqued. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225646 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5512415ade
commit
28184c10c9
@ -651,7 +651,9 @@ public:
|
||||
///
|
||||
/// Distinct nodes are not uniqued, and will not be returned by \a
|
||||
/// MDNode::get().
|
||||
bool isDistinct() const { return IsDistinctInContext; }
|
||||
bool isDistinct() const {
|
||||
return isStoredDistinctInContext() || isa<MDNodeFwdDecl>(this);
|
||||
}
|
||||
|
||||
protected:
|
||||
/// \brief Set an operand.
|
||||
|
@ -269,6 +269,12 @@ TEST_F(MDNodeTest, getDistinct) {
|
||||
ASSERT_EQ(Empty, MDNode::get(Context, None));
|
||||
}
|
||||
|
||||
TEST_F(MDNodeTest, TempIsDistinct) {
|
||||
MDNode *T = MDNode::getTemporary(Context, None);
|
||||
EXPECT_TRUE(T->isDistinct());
|
||||
MDNode::deleteTemporary(T);
|
||||
}
|
||||
|
||||
TEST_F(MDNodeTest, getDistinctWithUnresolvedOperands) {
|
||||
// temporary !{}
|
||||
MDNodeFwdDecl *Temp = MDNode::getTemporary(Context, None);
|
||||
|
Loading…
Reference in New Issue
Block a user