[llvm-commits] [PATCH] ExtractValueInst < UnaryInstruction
Dan Gohman
gohman at apple.com
Fri Jun 6 11:41:34 PDT 2008
On Fri, 2008-06-06 at 20:13 +0200, Gabor Greif wrote:
> This patch makes a slight change to the inheritance
> graph, by deriving ExtractValueInst from UnaryInstruction.
>
> Dan, Mathiijs, OK to commit?
Looks good to me. Please also update UnaryInstruction's classof to
reflect that ExtractValueInst isa UnaryInstruction.
Does this patch make this code:
template <>
struct OperandTraits<ExtractValueInst> : FixedNumOperandTraits<1> {
};
in Instructions.h redundant? If so, please remove it.
And one more question below...
> Index: include/llvm/Instructions.h
> ===================================================================
> --- include/llvm/Instructions.h (Revision 52051)
> +++ include/llvm/Instructions.h (Arbeitskopie)
> @@ -1453,7 +1453,7 @@
> /// ExtractValueInst - This instruction extracts a struct member or
> array
> /// element value from an aggregate value.
> ///
> -class ExtractValueInst : public Instruction {
> +class ExtractValueInst : public UnaryInstruction {
> SmallVector<unsigned, 4> Indices;
>
> ExtractValueInst(const ExtractValueInst &EVI);
> @@ -1526,12 +1526,13 @@
> Instruction *InsertBefore = 0);
> ExtractValueInst(Value *Agg, unsigned Idx,
> const std::string &Name, BasicBlock *InsertAtEnd);
> -public:
> +
> // allocate space for exactly one operand
> void *operator new(size_t s) {
> return User::operator new(s, 1);
> }
>
> +public:
With ExtractValueInst being a UnaryInstruction, can we just get rid
of this operator new, and just use the one inherited from
UnaryInstruction?
Dan
More information about the llvm-commits
mailing list