template <typename Visitor> void enumerateFields_gen(DirectiveControl obj, Visitor & vis) { vis(obj.code(),"code"); vis(obj.control(),"control"); vis(obj.type(),"type"); vis(obj.elementCount(),"valueCount"); vis(obj.values(),"values"); }
template <typename Visitor> void enumerateFields_gen(DirectiveControl obj, Visitor & vis) { enumerateFields_gen(Directive(obj), vis); vis(obj.control(),"control"); vis(obj.operands(),"operands"); }
bool ValidatorImpl::ValidateBrigDirectiveFields(Directive item) const { unsigned kind = item.kind(); switch (kind) { case BRIG_KIND_DIRECTIVE_ARG_BLOCK_END: { DirectiveArgBlockEnd it = item; } break; case BRIG_KIND_DIRECTIVE_ARG_BLOCK_START: { DirectiveArgBlockStart it = item; } break; case BRIG_KIND_DIRECTIVE_COMMENT: { DirectiveComment it = item; validate_BrigDataOffsetString(item, it.brig()->name, "DirectiveComment", "name"); } break; case BRIG_KIND_DIRECTIVE_CONTROL: { DirectiveControl it = item; validate_BrigControlDirective(item, it.brig()->control, "DirectiveControl", "control"); validate_fld_Reserved(item, it.brig()->reserved, "DirectiveControl", "reserved"); validate_BrigDataOffsetOperandList(item, it.brig()->operands, "DirectiveControl", "operands"); } break; case BRIG_KIND_DIRECTIVE_FUNCTION: { DirectiveFunction it = item; validate_BrigDataOffsetString(item, it.brig()->name, "DirectiveFunction", "name"); validate_fld_OutArgCount(item, it.brig()->outArgCount, "DirectiveFunction", "outArgCount"); validate_fld_InArgCount(item, it.brig()->inArgCount, "DirectiveFunction", "inArgCount"); validate_BrigCodeOffset(item, it.brig()->firstInArg, "DirectiveFunction", "firstInArg"); validate_BrigCodeOffset(item, it.brig()->firstCodeBlockEntry, "DirectiveFunction", "firstCodeBlockEntry"); validate_BrigCodeOffset(item, it.brig()->nextModuleEntry, "DirectiveFunction", "nextModuleEntry"); validate_BrigExecutableModifier(item, it.brig()->modifier, "DirectiveFunction", "modifier"); validate_BrigLinkage(item, it.brig()->linkage, "DirectiveFunction", "linkage"); validate_fld_Reserved(item, it.brig()->reserved, "DirectiveFunction", "reserved"); } break; case BRIG_KIND_DIRECTIVE_INDIRECT_FUNCTION: { DirectiveIndirectFunction it = item; validate_BrigDataOffsetString(item, it.brig()->name, "DirectiveIndirectFunction", "name"); validate_fld_OutArgCount(item, it.brig()->outArgCount, "DirectiveIndirectFunction", "outArgCount"); validate_fld_InArgCount(item, it.brig()->inArgCount, "DirectiveIndirectFunction", "inArgCount"); validate_BrigCodeOffset(item, it.brig()->firstInArg, "DirectiveIndirectFunction", "firstInArg"); validate_BrigCodeOffset(item, it.brig()->firstCodeBlockEntry, "DirectiveIndirectFunction", "firstCodeBlockEntry"); validate_BrigCodeOffset(item, it.brig()->nextModuleEntry, "DirectiveIndirectFunction", "nextModuleEntry"); validate_BrigExecutableModifier(item, it.brig()->modifier, "DirectiveIndirectFunction", "modifier"); validate_BrigLinkage(item, it.brig()->linkage, "DirectiveIndirectFunction", "linkage"); validate_fld_Reserved(item, it.brig()->reserved, "DirectiveIndirectFunction", "reserved"); } break; case BRIG_KIND_DIRECTIVE_KERNEL: { DirectiveKernel it = item; validate_BrigDataOffsetString(item, it.brig()->name, "DirectiveKernel", "name"); validate_fld_OutArgCount(item, it.brig()->outArgCount, "DirectiveKernel", "outArgCount"); validate_fld_InArgCount(item, it.brig()->inArgCount, "DirectiveKernel", "inArgCount"); validate_BrigCodeOffset(item, it.brig()->firstInArg, "DirectiveKernel", "firstInArg"); validate_BrigCodeOffset(item, it.brig()->firstCodeBlockEntry, "DirectiveKernel", "firstCodeBlockEntry"); validate_BrigCodeOffset(item, it.brig()->nextModuleEntry, "DirectiveKernel", "nextModuleEntry"); validate_BrigExecutableModifier(item, it.brig()->modifier, "DirectiveKernel", "modifier"); validate_BrigLinkage(item, it.brig()->linkage, "DirectiveKernel", "linkage"); validate_fld_Reserved(item, it.brig()->reserved, "DirectiveKernel", "reserved"); } break; case BRIG_KIND_DIRECTIVE_SIGNATURE: { DirectiveSignature it = item; validate_BrigDataOffsetString(item, it.brig()->name, "DirectiveSignature", "name"); validate_fld_OutArgCount(item, it.brig()->outArgCount, "DirectiveSignature", "outArgCount"); validate_fld_InArgCount(item, it.brig()->inArgCount, "DirectiveSignature", "inArgCount"); validate_BrigCodeOffset(item, it.brig()->firstInArg, "DirectiveSignature", "firstInArg"); validate_BrigCodeOffset(item, it.brig()->firstCodeBlockEntry, "DirectiveSignature", "firstCodeBlockEntry"); validate_BrigCodeOffset(item, it.brig()->nextModuleEntry, "DirectiveSignature", "nextModuleEntry"); validate_BrigExecutableModifier(item, it.brig()->modifier, "DirectiveSignature", "modifier"); validate_BrigLinkage(item, it.brig()->linkage, "DirectiveSignature", "linkage"); validate_fld_Reserved(item, it.brig()->reserved, "DirectiveSignature", "reserved"); } break; case BRIG_KIND_DIRECTIVE_EXTENSION: { DirectiveExtension it = item; validate_BrigDataOffsetString(item, it.brig()->name, "DirectiveExtension", "name"); } break; case BRIG_KIND_DIRECTIVE_FBARRIER: { DirectiveFbarrier it = item; validate_BrigDataOffsetString(item, it.brig()->name, "DirectiveFbarrier", "name"); validate_BrigVariableModifier(item, it.brig()->modifier, "DirectiveFbarrier", "modifier"); validate_BrigLinkage(item, it.brig()->linkage, "DirectiveFbarrier", "linkage"); validate_fld_Reserved(item, it.brig()->reserved, "DirectiveFbarrier", "reserved"); } break; case BRIG_KIND_DIRECTIVE_LABEL: { DirectiveLabel it = item; validate_BrigDataOffsetString(item, it.brig()->name, "DirectiveLabel", "name"); } break; case BRIG_KIND_DIRECTIVE_LOC: { DirectiveLoc it = item; validate_BrigDataOffsetString(item, it.brig()->filename, "DirectiveLoc", "filename"); validate_fld_Line(item, it.brig()->line, "DirectiveLoc", "line"); validate_fld_Column(item, it.brig()->column, "DirectiveLoc", "column"); } break; case BRIG_KIND_DIRECTIVE_MODULE: { DirectiveModule it = item; validate_BrigDataOffsetString(item, it.brig()->name, "DirectiveModule", "name"); validate_BrigVersion(item, it.brig()->hsailMajor, "DirectiveModule", "hsailMajor"); validate_BrigVersion(item, it.brig()->hsailMinor, "DirectiveModule", "hsailMinor"); validate_BrigProfile(item, it.brig()->profile, "DirectiveModule", "profile"); validate_BrigMachineModel(item, it.brig()->machineModel, "DirectiveModule", "machineModel"); validate_BrigRound(item, it.brig()->defaultFloatRound, "DirectiveModule", "defaultFloatRound"); validate_fld_Reserved(item, it.brig()->reserved, "DirectiveModule", "reserved"); } break; case BRIG_KIND_NONE: { DirectiveNone it = item; } break; case BRIG_KIND_DIRECTIVE_PRAGMA: { DirectivePragma it = item; validate_BrigDataOffsetOperandList(item, it.brig()->operands, "DirectivePragma", "operands"); } break; case BRIG_KIND_DIRECTIVE_VARIABLE: { DirectiveVariable it = item; validate_BrigDataOffsetString(item, it.brig()->name, "DirectiveVariable", "name"); validate_BrigOperandOffset(item, it.brig()->init, "DirectiveVariable", "init"); validate_BrigType(item, it.brig()->type, "DirectiveVariable", "type"); validate_BrigSegment(item, it.brig()->segment, "DirectiveVariable", "segment"); validate_BrigAlignment(item, it.brig()->align, "DirectiveVariable", "align"); validate_fld_Dim(item, it.brig()->dim, "DirectiveVariable", "dim"); validate_BrigVariableModifier(item, it.brig()->modifier, "DirectiveVariable", "modifier"); validate_BrigLinkage(item, it.brig()->linkage, "DirectiveVariable", "linkage"); validate_BrigAllocation(item, it.brig()->allocation, "DirectiveVariable", "allocation"); validate_fld_Reserved(item, it.brig()->reserved, "DirectiveVariable", "reserved"); } break; default: return false; // not found } // switch return true; // found and validated }