Record *AsmParser = Target.getAsmParser();
StringRef ClassName = AsmParser->getValueAsString("AsmParserClassName");
+ emitSourceFileHeader("Assembly Matcher Source Fragment", OS);
+
// Compute the information on the instructions to match.
AsmMatcherInfo Info(AsmParser, Target, Records);
Info.buildInfo();
namespace llvm {
void EmitAsmMatcher(RecordKeeper &RK, raw_ostream &OS) {
- emitSourceFileHeader("Assembly Matcher Source Fragment", OS);
AsmMatcherEmitter(RK).run(OS);
}
std::vector<std::vector<std::string>> TableDrivenOperandPrinters;
unsigned BitsLeft = 0;
unsigned AsmStrBits = 0;
+ emitSourceFileHeader("Assembly Writer Source Fragment", O);
EmitGetMnemonic(O, TableDrivenOperandPrinters, BitsLeft, AsmStrBits);
EmitPrintInstruction(O, TableDrivenOperandPrinters, BitsLeft, AsmStrBits);
EmitGetRegisterName(O);
namespace llvm {
void EmitAsmWriter(RecordKeeper &RK, raw_ostream &OS) {
- emitSourceFileHeader("Assembly Writer Source Fragment", OS);
AsmWriterEmitter(RK).run(OS);
}
class Attributes {
public:
Attributes(RecordKeeper &R) : Records(R) {}
- void emit(raw_ostream &OS);
+ void run(raw_ostream &OS);
private:
void emitTargetIndependentNames(raw_ostream &OS);
OS << "#endif\n";
}
-void Attributes::emit(raw_ostream &OS) {
+void Attributes::run(raw_ostream &OS) {
emitTargetIndependentNames(OS);
emitFnAttrCompatCheck(OS, false);
emitAttributeProperties(OS);
namespace llvm {
void EmitAttributes(RecordKeeper &RK, raw_ostream &OS) {
- Attributes(RK).emit(OS);
+ Attributes(RK).run(OS);
}
} // namespace llvm
} // End anonymous namespace
void CallingConvEmitter::run(raw_ostream &O) {
+ emitSourceFileHeader("Calling Convention Implementation Fragment", O);
+
std::vector<Record *> CCs = Records.getAllDerivedDefinitions("CallingConv");
// Emit prototypes for all of the non-custom CC's so that they can forward ref
namespace llvm {
void EmitCallingConv(RecordKeeper &RK, raw_ostream &OS) {
- emitSourceFileHeader("Calling Convention Implementation Fragment", OS);
CallingConvEmitter(RK).run(OS);
}
}
void CodeEmitterGen::run(raw_ostream &o) {
+ emitSourceFileHeader("Machine Code Emitter", o);
+
CodeGenTarget Target(Records);
std::vector<Record*> Insts = Records.getAllDerivedDefinitions("Instruction");
namespace llvm {
void EmitCodeEmitter(RecordKeeper &RK, raw_ostream &OS) {
- emitSourceFileHeader("Machine Code Emitter", OS);
CodeEmitterGen(RK).run(OS);
}
void DAGISelEmitter::run(raw_ostream &OS) {
+ Records.startTimer("Parse patterns");
emitSourceFileHeader("DAG Instruction Selector for the " +
CGP.getTargetInfo().getName().str() + " target", OS);
namespace llvm {
void EmitDAGISel(RecordKeeper &RK, raw_ostream &OS) {
- RK.startTimer("Parse patterns");
DAGISelEmitter(RK).run(OS);
}
// Run the worklist algorithm to generate the DFA.
//
void DFAPacketizerEmitter::run(raw_ostream &OS) {
+ emitSourceFileHeader("Target DFA Packetizer Tables", OS);
OS << "\n"
<< "#include \"llvm/CodeGen/DFAPacketizer.h\"\n";
OS << "namespace llvm {\n";
namespace llvm {
void EmitDFAPacketizer(RecordKeeper &RK, raw_ostream &OS) {
- emitSourceFileHeader("Target DFA Packetizer Tables", OS);
DFAPacketizerEmitter(RK).run(OS);
}
}
};
- const CodeGenTarget &TGT;
+ CodeGenTarget TGT;
RecordKeeper &Records;
CodeGenSchedModels &SchedModels;
std::string Target;
void ParseFeaturesFunction(raw_ostream &OS);
public:
- SubtargetEmitter(RecordKeeper &R, CodeGenTarget &TGT)
- : TGT(TGT), Records(R), SchedModels(TGT.getSchedModels()),
+ SubtargetEmitter(RecordKeeper &R)
+ : TGT(R), Records(R), SchedModels(TGT.getSchedModels()),
Target(TGT.getName()) {}
void run(raw_ostream &o);
namespace llvm {
void EmitSubtarget(RecordKeeper &RK, raw_ostream &OS) {
- CodeGenTarget CGTarget(RK);
- SubtargetEmitter(RK, CGTarget).run(OS);
+ SubtargetEmitter(RK).run(OS);
}
} // end namespace llvm
X86FoldTablesEmitter(RecordKeeper &R) : Records(R), Target(R) {}
// run - Generate the 6 X86 memory fold tables.
- void run(formatted_raw_ostream &OS);
+ void run(raw_ostream &OS);
private:
// Decides to which table to add the entry with the given instructions.
}
}
-void X86FoldTablesEmitter::run(formatted_raw_ostream &OS) {
+void X86FoldTablesEmitter::run(raw_ostream &o) {
+ formatted_raw_ostream OS(o);
emitSourceFileHeader("X86 fold tables", OS);
// Holds all memory instructions
namespace llvm {
-void EmitX86FoldTables(RecordKeeper &RK, raw_ostream &o) {
- formatted_raw_ostream OS(o);
+void EmitX86FoldTables(RecordKeeper &RK, raw_ostream &OS) {
X86FoldTablesEmitter(RK).run(OS);
}
} // namespace llvm