//===- lib/Target/Sparc/MappingInfo.h ---------------------------*- C++ -*-===// // // Data structures to support the Reoptimizer's Instruction-to-MachineInstr // mapping information gatherer. // //===----------------------------------------------------------------------===// #ifndef MAPPINGINFO_H #define MAPPINGINFO_H #include #include #include class Pass; Pass *getMappingInfoCollector(std::ostream &out); class MappingInfo { struct byteVector : public std::vector { void dumpAssembly (std::ostream &Out); }; std::string comment; std::string symbolPrefix; unsigned functionNumber; byteVector bytes; public: void outByte (unsigned char b) { bytes.push_back (b); } MappingInfo (std::string Comment, std::string SymbolPrefix, unsigned FunctionNumber) : comment(Comment), symbolPrefix(SymbolPrefix), functionNumber(FunctionNumber) {} void dumpAssembly (std::ostream &Out); unsigned char *getBytes (unsigned &length) { length = bytes.size(); return &bytes[0]; } }; #endif