John McCall
2009-May-17 07:33 UTC
[LLVMdev] [patch] Remove getType() overrides from extractvalue and insertvalue
Several instruction classes override getType() when the instruction always creates a particular type of value. For example, the result of insertelement is always a vector, so InsertElementInst overrides getType() to return a VectorType*. This makes perfect sense. However, ExtractValueInst and InsertValueInst override getType() to return a PointerType*, which does not make sense and is in fact never correct for the latter instruction; this is probably a relic of an oversight during class creation. So this patch simply removes these overrides, which I suppose is technically an API change. John. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: gettype.patch.txt URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090517/efccfd7a/attachment.txt>
Eric Christopher
2009-May-18 18:47 UTC
[LLVMdev] [patch] Remove getType() overrides from extractvalue and insertvalue
On May 17, 2009, at 12:33 AM, John McCall wrote:> Several instruction classes override getType() when the instruction > always creates a particular type of value. For example, the result > of insertelement is always a vector, so InsertElementInst overrides > getType() to return a VectorType*. This makes perfect sense. > However, ExtractValueInst and InsertValueInst override getType() to > return a PointerType*, which does not make sense and is in fact > never correct for the latter instruction; this is probably a relic > of an oversight during class creation. So this patch simply removes > these overrides, which I suppose is technically an API change.I've gone ahead and committed this - thanks John! -eric