Generates the implementations of the individual op writer functions.
| 657 | |
| 658 | /// Generates the implementations of the individual op writer functions. |
| 659 | static void generateOpWriterImplementations(const RecordKeeper &records, |
| 660 | raw_ostream &os) { |
| 661 | |
| 662 | emitSourceFileHeader("Generated Bytecode Writers", os); |
| 663 | auto opDefs = records.getAllDerivedDefinitions("Op"); |
| 664 | os << "//" |
| 665 | "===-------------------------------------------------------------------" |
| 666 | "---===//\n" |
| 667 | << "// Writer Functions\n" |
| 668 | << "//" |
| 669 | "===-------------------------------------------------------------------" |
| 670 | "---===//\n\n"; |
| 671 | for (const Record *opDef : opDefs) |
| 672 | generateOpWriter(Operator(opDef), os); |
| 673 | os << "//" |
| 674 | "===-------------------------------------------------------------------" |
| 675 | "---===//\n" |
| 676 | << "// End of generated functions.\n" |
| 677 | << "//" |
| 678 | "===-------------------------------------------------------------------" |
| 679 | "---===//\n"; |
| 680 | } |
| 681 | |
| 682 | /// Generates the TypeSwitch statement for dispatching to op-specific writers. |
| 683 | /// Returns FailureOr<size_t> where size_t is the number of serialized results. |
no test coverage detected