Brian Gaeke | c86b8d5 | 2003-06-04 22:02:47 +0000 | [diff] [blame^] | 1 | //===- llvm/Reoptimizer/Mapping/MappingInfo.h ------------------*- C++ -*--=//// |
| 2 | // |
| 3 | // Data structures to support the Reoptimizer's Instruction-to-MachineInstr |
| 4 | // mapping information gatherer. |
| 5 | // |
| 6 | //===----------------------------------------------------------------------===// |
| 7 | |
| 8 | #ifndef LLVM_REOPTIMIZER_MAPPING_MAPPINGINFO_H |
| 9 | #define LLVM_REOPTIMIZER_MAPPING_MAPPINGINFO_H |
Mehwish Nagda | 5fb72ae | 2002-07-22 22:09:35 +0000 | [diff] [blame] | 10 | |
| 11 | #include <iosfwd> |
Brian Gaeke | c86b8d5 | 2003-06-04 22:02:47 +0000 | [diff] [blame^] | 12 | #include <vector> |
| 13 | #include <string> |
Mehwish Nagda | 5fb72ae | 2002-07-22 22:09:35 +0000 | [diff] [blame] | 14 | class Pass; |
| 15 | |
Brian Gaeke | c86b8d5 | 2003-06-04 22:02:47 +0000 | [diff] [blame^] | 16 | Pass *getMappingInfoCollector(std::ostream &out); |
| 17 | |
| 18 | class MappingInfo { |
| 19 | class byteVector : public std::vector <unsigned char> { |
| 20 | public: |
| 21 | void dumpAssembly (std::ostream &Out); |
| 22 | }; |
| 23 | std::string comment; |
| 24 | std::string symbolPrefix; |
| 25 | unsigned functionNumber; |
| 26 | byteVector bytes; |
| 27 | public: |
| 28 | void outByte (unsigned char b) { bytes.push_back (b); } |
| 29 | MappingInfo (std::string _comment, std::string _symbolPrefix, |
| 30 | unsigned _functionNumber) : comment(_comment), |
| 31 | symbolPrefix(_symbolPrefix), functionNumber(_functionNumber) { } |
| 32 | void dumpAssembly (std::ostream &Out); |
| 33 | unsigned char *getBytes (unsigned int &length) { |
| 34 | length = bytes.size(); return &bytes[0]; |
| 35 | } |
| 36 | }; |
Mehwish Nagda | 5fb72ae | 2002-07-22 22:09:35 +0000 | [diff] [blame] | 37 | |
| 38 | #endif |