@@ -319,28 +319,6 @@ static std::string getStageMaskString(ArrayRef<const Record *> Recs) {
319319 return MaskString;
320320}
321321
322- // / Return a string representation of valid property information denoted
323- // by input records
324- //
325- // / \param Recs A vector of records of TableGen Property records
326- // / \return std::string string representation of properties list string
327- // {Attr1, Attr2, ...}
328- static std::string getPropertyListString (ArrayRef<const Record *> Recs) {
329- std::string ListString = " " ;
330- std::string Prefix = " " ;
331- ListString.append (" {" );
332-
333- std::string CommaPrefix = " " ;
334- for (const auto *Rec : Recs) {
335- ListString.append (CommaPrefix)
336- .append (" dxil::Property::" )
337- .append (Rec->getName ());
338- CommaPrefix = " , " ;
339- }
340- ListString.append (" }" );
341- return ListString;
342- }
343-
344322// / Emit a list valid DXIL Version records
345323static void emitDXILVersions (const RecordKeeper &Records, raw_ostream &OS) {
346324 OS << " #ifdef DXIL_VERSION\n " ;
@@ -429,36 +407,13 @@ static void emitDXILOpAttributes(const RecordKeeper &Records,
429407
430408// / Emit a list of DXIL op properties and their query functions
431409static void emitDXILProperties (const RecordKeeper &Records, raw_ostream &OS) {
432- // Generate their definitions
433410 OS << " #ifdef DXIL_PROPERTY\n " ;
434411 for (const Record *Prop : Records.getAllDerivedDefinitions (" DXILProperty" ))
435412 OS << " DXIL_PROPERTY(" << Prop->getName () << " )\n " ;
436413 OS << " #undef DXIL_PROPERTY\n " ;
437414 OS << " #endif\n\n " ;
438415}
439416
440- static void emitDXILPropertyHelper (ArrayRef<DXILOperationDesc> Ops,
441- raw_ostream &OS) {
442- // Generate helper function to query all the functions
443- OS << " static llvm::SmallVector<dxil::Property> getProperties(dxil::OpCode "
444- " Op) {\n " ;
445- OS << " switch (Op) {\n " ;
446- for (const auto &Op : Ops) {
447- OS << " case dxil::OpCode::" << Op.OpName << " : return "
448- << getPropertyListString (Op.PropRecs ) << " ;\n " ;
449- }
450- OS << " }\n " ;
451- OS << " return {};\n " ;
452- OS << " }\n\n " ;
453- OS << " static bool hasProperty(dxil::OpCode Op, dxil::Property Prop) {\n " ;
454- OS << " auto Properties = getProperties(Op);\n " ;
455- OS << " for (auto CurProp : Properties)\n " ;
456- OS << " if (CurProp == Prop)\n " ;
457- OS << " return true;\n " ;
458- OS << " return false;\n " ;
459- OS << " }\n\n " ;
460- }
461-
462417// / Emit a list of DXIL op function types
463418static void emitDXILOpFunctionTypes (ArrayRef<DXILOperationDesc> Ops,
464419 raw_ostream &OS) {
@@ -555,7 +510,7 @@ static void emitDXILOperationTable(ArrayRef<DXILOperationDesc> Ops,
555510 << OpClassStrings.get (Op.OpClass .data ()) << " , "
556511 << getOverloadMaskString (Op.OverloadRecs ) << " , "
557512 << getStageMaskString (Op.StageRecs ) << " , "
558- << getPropertyListString (Op. PropRecs ) << " , " << Op.OverloadParamIndex
513+ << Op.OverloadParamIndex
559514 << " }" ;
560515 Prefix = " ,\n " ;
561516 }
@@ -672,10 +627,6 @@ static void emitDxilOperation(const RecordKeeper &Records, raw_ostream &OS) {
672627 emitDXILOperationTable (DXILOps, OS);
673628 OS << " #undef DXIL_OP_OPERATION_TABLE\n " ;
674629 OS << " #endif\n\n " ;
675- OS << " #ifdef DXIL_OP_PROPERTY_HELPER\n " ;
676- emitDXILPropertyHelper (DXILOps, OS);
677- OS << " #undef DXIL_OP_PROPERTY_HELPER\n " ;
678- OS << " #endif\n\n " ;
679630}
680631
681632static TableGen::Emitter::Opt X (" gen-dxil-operation" , emitDxilOperation,
0 commit comments