mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-02 16:36:40 +00:00
fix PR6589
adjusted unittest I have added some doxygen to OptionalOperandTraits, so hopefully there will be no confusion in the future. Incidentally OptionalOperandTraits is not used any more (IIUC), but the obvious client would be BranchInstr, and I plan to rearrange it that way. llvm-svn: 98624
This commit is contained in:
parent
7011013935
commit
f073ba6af8
@ -1984,7 +1984,7 @@ public:
|
||||
};
|
||||
|
||||
template <>
|
||||
struct OperandTraits<ReturnInst> : public OptionalOperandTraits<> {
|
||||
struct OperandTraits<ReturnInst> : public VariadicOperandTraits<> {
|
||||
};
|
||||
|
||||
DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ReturnInst, Value)
|
||||
|
@ -20,7 +20,7 @@
|
||||
namespace llvm {
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// FixedNumOperands Trait Class
|
||||
// FixedNumOperand Trait Class
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
/// FixedNumOperandTraits - determine the allocation regime of the Use array
|
||||
@ -51,9 +51,12 @@ struct FixedNumOperandTraits {
|
||||
};
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// OptionalOperands Trait Class
|
||||
// OptionalOperand Trait Class
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
/// OptionalOperandTraits - when the number of operands may change at runtime.
|
||||
/// Naturally it may only decrease, because the allocations may not change.
|
||||
|
||||
template <unsigned ARITY = 1>
|
||||
struct OptionalOperandTraits : public FixedNumOperandTraits<ARITY> {
|
||||
static unsigned operands(const User *U) {
|
||||
|
@ -14,12 +14,12 @@
|
||||
namespace llvm {
|
||||
namespace {
|
||||
|
||||
TEST(InstructionsTest, ReturnInst_0) {
|
||||
TEST(InstructionsTest, ReturnInst) {
|
||||
LLVMContext &C(getGlobalContext());
|
||||
|
||||
// reproduction recipe for PR6589
|
||||
// test for PR6589
|
||||
const ReturnInst* r0 = ReturnInst::Create(C);
|
||||
EXPECT_NE(r0->op_begin(), r0->op_end());
|
||||
EXPECT_EQ(r0->op_begin(), r0->op_end());
|
||||
}
|
||||
|
||||
} // end anonymous namespace
|
||||
|
Loading…
Reference in New Issue
Block a user