On Tue, Jun 11, 2013 at 9:44 PM, Marc Glisse <marc.gli...@inria.fr> wrote: > On Tue, 11 Jun 2013, Jeff Law wrote: > >> On 06/09/13 13:43, Marc Glisse wrote: >>> >>> Hello, >>> >>> just adapting yet another function so it also works with vectors. >>> >>> It seemed convenient to add a new macro. The name sucks (it doesn't >>> match the semantics of INTEGRAL_TYPE_P), but I didn't want to name it >>> INTEGER_SCALAR_OR_VECTOR_CONSTANT_P and didn't have any good idea for a >>> short name. >> >> I'd just use a long name. I can easily see someone getting easily not >> being aware that INTEGRAL_CST_P returns true for vectors and as a result >> doing something inappropriate. >> >> INTEGER_CST_OR_VECTOR_INTEGER_TYPE_P? > > > Having TYPE in there seems confusing, and > INTEGER_SCALAR_OR_VECTOR_CONSTANT_P is at least one character shorter ;-) > Oh, you probably meant INTEGER_CST_OR_VECTOR_INTEGER_CST_P? > > Compacting could give INT_OR_VECINT_CST_P (or INTVEC instead of VECINT, I > don't know which order sounds best). > > I don't really mind the name, so if you want > INTEGER_CST_OR_VECTOR_INTEGER_CST_P that's ok with me.
How about just adding VECTOR_INTEGER_CST_P and using TREE_CODE (x) == INTEGER_CST || VECTOR_INTEGER_CST_P (x) in the code? I suppose it's explicitely not allowing complex integer constants? Richard. > Thanks for the comments on the 2 patches, > > -- > Marc Glisse