void NVPTXAsmPrinter::printVecModifiedImmediate(const MachineOperand &MO,
const char *Modifier,
raw_ostream &O) {
-char vecelem[] = {'0', '1', '2', '3', '0', '1', '2', '3'};
+ static const char vecelem[] = {'0', '1', '2', '3', '0', '1', '2', '3'};
int Imm = (int)MO.getImm();
if(0 == strcmp(Modifier, "vecelem"))
O << "_" << vecelem[Imm];
// Check to see if the kernel argument is image*_t or sampler_t
bool llvm::isImageOrSamplerVal(const Value *arg, const Module *context) {
- const char *specialTypes[] = {
- "struct._image2d_t",
- "struct._image3d_t",
- "struct._sampler_t"
+ static const char *const specialTypes[] = {
+ "struct._image2d_t",
+ "struct._image3d_t",
+ "struct._sampler_t"
};
const Type *Ty = arg->getType();
const StructType *STy = dyn_cast<StructType>(PTy->getElementType());
const std::string TypeName = STy ? STy->getName() : "";
- for (int i=0, e=sizeof(specialTypes)/sizeof(specialTypes[0]); i!=e; ++i)
+ for (int i = 0, e = array_lengthof(specialTypes); i != e; ++i)
if (TypeName == specialTypes[i])
return true;