summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-01-13 00:34:21 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-01-13 00:34:21 +0000
commit2cc792b1d11f73fb7845e67eae2633644adbaec2 (patch)
tree180962aef3767ddc9e4cbdbb84d3a76413f9378d /llvm
parentc4b8e79396014a41527dfc3ecc1c1a16ba2f946f (diff)
downloadbcm5719-llvm-2cc792b1d11f73fb7845e67eae2633644adbaec2.tar.gz
bcm5719-llvm-2cc792b1d11f73fb7845e67eae2633644adbaec2.zip
Revert "IR: Fix an inverted assertion when replacing resolved operands"
This reverts commit r225738. Maybe the assertion is just plain wrong, but this version fails on WAY more bots. I'll make sure both ways work in a follow-up but I want to get bots green in the meantime. llvm-svn: 225742
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/IR/Metadata.cpp2
-rw-r--r--llvm/unittests/IR/MetadataTest.cpp23
2 files changed, 1 insertions, 24 deletions
diff --git a/llvm/lib/IR/Metadata.cpp b/llvm/lib/IR/Metadata.cpp
index 0132bab82c6..13844313925 100644
--- a/llvm/lib/IR/Metadata.cpp
+++ b/llvm/lib/IR/Metadata.cpp
@@ -444,7 +444,7 @@ void UniquableMDNode::resolveAfterOperandChange(Metadata *Old, Metadata *New) {
// Check if an operand was resolved.
if (!isOperandUnresolved(Old))
- assert(!isOperandUnresolved(New) && "Operand just became unresolved");
+ assert(isOperandUnresolved(New) && "Operand just became unresolved");
else if (!isOperandUnresolved(New))
decrementUnresolvedOperandCount();
}
diff --git a/llvm/unittests/IR/MetadataTest.cpp b/llvm/unittests/IR/MetadataTest.cpp
index c364aeacba1..af110742dd7 100644
--- a/llvm/unittests/IR/MetadataTest.cpp
+++ b/llvm/unittests/IR/MetadataTest.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-#include "llvm/ADT/STLExtras.h"
#include "llvm/IR/Metadata.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Instructions.h"
@@ -362,28 +361,6 @@ TEST_F(MDNodeTest, handleChangedOperandRecursion) {
EXPECT_EQ(N4, N6->getOperand(0));
}
-TEST_F(MDNodeTest, replaceResolvedOperand) {
- // Check code for replacing one resolved operand with another. If doing this
- // directly (via replaceOperandWith()) becomes illegal, change the operand to
- // a global value that gets RAUW'ed.
- //
- // Use a temporary node to keep N from being resolved.
- std::unique_ptr<MDNodeFwdDecl> Temp(MDNodeFwdDecl::get(Context, None));
- Metadata *Ops[] = {nullptr, Temp.get()};
-
- MDNode *Empty = MDTuple::get(Context, {});
- MDNode *N = MDTuple::get(Context, Ops);
- EXPECT_EQ(nullptr, N->getOperand(0));
- ASSERT_FALSE(N->isResolved());
-
- // Check code for replacing resolved nodes.
- N->replaceOperandWith(0, Empty);
- EXPECT_EQ(Empty, N->getOperand(0));
-
- // Remove the reference to Temp; required for teardown.
- N->replaceOperandWith(1, nullptr);
-}
-
typedef MetadataTest MetadataAsValueTest;
TEST_F(MetadataAsValueTest, MDNode) {
OpenPOWER on IntegriCloud