2525#include " llvm/TableGen/Record.h"
2626#include " llvm/TableGen/TableGenBackend.h"
2727
28+ #include < cstddef>
2829#include < string>
2930#include < vector>
3031
@@ -108,7 +109,7 @@ DXILOperationDesc::DXILOperationDesc(const Record *R) {
108109 for (auto Ty : ArgTys) {
109110 ParamTypeRecs.push_back (Ty);
110111 }
111- unsigned ParamTypeRecsSize = ParamTypeRecs.size ();
112+ size_t ParamTypeRecsSize = ParamTypeRecs.size ();
112113 // Populate OpTypes with return type and parameter types
113114
114115 // Parameter indices of overloaded parameters.
@@ -120,23 +121,23 @@ DXILOperationDesc::DXILOperationDesc(const Record *R) {
120121 for (unsigned I = 0 ; I < ParamTypeRecsSize; I++) {
121122 auto TR = ParamTypeRecs[I];
122123 // Track operation parameter indices of any overload types
123- auto IsAny = TR->getValueAsInt (" isAny" );
124- if (IsAny == 1 ) {
125- // TODO: At present it is expected that all overload types in a DXIL Op
124+ auto isAny = TR->getValueAsInt (" isAny" );
125+ if (isAny == 1 ) {
126+ // It is expected that all overload types in a DXIL Op
126127 // are of the same type. Hence, OverloadParamIndices will have only one
127128 // element. This implies we do not need a vector. However, until more
128129 // (all?) DXIL Ops are added in DXIL.td, a vector is being used to flag
129130 // cases this assumption would not hold.
130131 if (!OverloadParamIndices.empty ()) {
131- bool KnownType = true ;
132+ bool knownType = true ;
132133 // Ensure that the same overload type registered earlier is being used
133134 for (auto Idx : OverloadParamIndices) {
134135 if (TR != ParamTypeRecs[Idx]) {
135- KnownType = false ;
136+ knownType = false ;
136137 break ;
137138 }
138139 }
139- assert (KnownType && " Specification of multiple differing overload "
140+ assert (knownType && " Specification of multiple differing overload "
140141 " parameter types not yet supported" );
141142 } else {
142143 OverloadParamIndices.push_back (I);
@@ -506,7 +507,6 @@ static void emitDXILOperationTable(std::vector<DXILOperationDesc> &Ops,
506507 << Op.OverloadParamIndex << " , " << Op.OpTypes .size () - 1 << " , "
507508 << Parameters.get (ParameterMap[Op.OpClass ]) << " }" ;
508509 Prefix = " ,\n " ;
509- // OS << "\n// " << getConstraintString(Op.Constraints) << "\n";
510510 }
511511 OS << " };\n " ;
512512
@@ -599,7 +599,7 @@ static void emitDXILOperationTableDataStructs(RecordKeeper &Records,
599599 // Emit enum OverloadKind with valid overload types.
600600 const SmallVector<std::string> OverloadKindList = {
601601 " VOID" , " HALF" , " FLOAT" , " DOUBLE" , " I1" , " I8" ,
602- " I16" , " I32" , " I64" , " UserDefinedType " , " ObjectType" };
602+ " I16" , " I32" , " I64" , " UserDefineType " , " ObjectType" };
603603 // Choose the type of enum OverloadKind based on the number of valid types in
604604 // OverloadKindList. This gives the flexibility to just add new supported
605605 // types to the list above, if needed, with no need to change this backend
@@ -667,7 +667,7 @@ static void emitDXILOperationTableDataStructs(RecordKeeper &Records,
667667 case OverloadKind::UNDEFINED: \n \
668668 return \" void\" ; \n \
669669 case OverloadKind::ObjectType: \n \
670- case OverloadKind::UserDefinedType : \n \
670+ case OverloadKind::UserDefineType : \n \
671671 break; \n \
672672 } \n \
673673 llvm_unreachable(\" invalid overload type for name\" ); \n \
0 commit comments