@@ -319,28 +319,6 @@ static std::string getStageMaskString(ArrayRef<const Record *> Recs) {
319
319
return MaskString;
320
320
}
321
321
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
-
344
322
// / Emit a list valid DXIL Version records
345
323
static void emitDXILVersions (const RecordKeeper &Records, raw_ostream &OS) {
346
324
OS << " #ifdef DXIL_VERSION\n " ;
@@ -429,36 +407,13 @@ static void emitDXILOpAttributes(const RecordKeeper &Records,
429
407
430
408
// / Emit a list of DXIL op properties and their query functions
431
409
static void emitDXILProperties (const RecordKeeper &Records, raw_ostream &OS) {
432
- // Generate their definitions
433
410
OS << " #ifdef DXIL_PROPERTY\n " ;
434
411
for (const Record *Prop : Records.getAllDerivedDefinitions (" DXILProperty" ))
435
412
OS << " DXIL_PROPERTY(" << Prop->getName () << " )\n " ;
436
413
OS << " #undef DXIL_PROPERTY\n " ;
437
414
OS << " #endif\n\n " ;
438
415
}
439
416
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
-
462
417
// / Emit a list of DXIL op function types
463
418
static void emitDXILOpFunctionTypes (ArrayRef<DXILOperationDesc> Ops,
464
419
raw_ostream &OS) {
@@ -555,7 +510,7 @@ static void emitDXILOperationTable(ArrayRef<DXILOperationDesc> Ops,
555
510
<< OpClassStrings.get (Op.OpClass .data ()) << " , "
556
511
<< getOverloadMaskString (Op.OverloadRecs ) << " , "
557
512
<< getStageMaskString (Op.StageRecs ) << " , "
558
- << getPropertyListString (Op. PropRecs ) << " , " << Op.OverloadParamIndex
513
+ << Op.OverloadParamIndex
559
514
<< " }" ;
560
515
Prefix = " ,\n " ;
561
516
}
@@ -672,10 +627,6 @@ static void emitDxilOperation(const RecordKeeper &Records, raw_ostream &OS) {
672
627
emitDXILOperationTable (DXILOps, OS);
673
628
OS << " #undef DXIL_OP_OPERATION_TABLE\n " ;
674
629
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 " ;
679
630
}
680
631
681
632
static TableGen::Emitter::Opt X (" gen-dxil-operation" , emitDxilOperation,
0 commit comments