Chris Lattner | 48e6079 | 2003-08-13 02:38:16 +0000 | [diff] [blame] | 1 | //===- lib/Target/Sparc/MappingInfo.h ---------------------------*- C++ -*-===// |
John Criswell | 856ba76 | 2003-10-21 15:17:13 +0000 | [diff] [blame] | 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file was developed by the LLVM research group and is distributed under |
| 6 | // the University of Illinois Open Source License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
Brian Gaeke | c86b8d5 | 2003-06-04 22:02:47 +0000 | [diff] [blame] | 9 | // |
| 10 | // Data structures to support the Reoptimizer's Instruction-to-MachineInstr |
| 11 | // mapping information gatherer. |
| 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
Chris Lattner | 48e6079 | 2003-08-13 02:38:16 +0000 | [diff] [blame] | 15 | #ifndef MAPPINGINFO_H |
| 16 | #define MAPPINGINFO_H |
Mehwish Nagda | 5fb72ae | 2002-07-22 22:09:35 +0000 | [diff] [blame] | 17 | |
| 18 | #include <iosfwd> |
Brian Gaeke | c86b8d5 | 2003-06-04 22:02:47 +0000 | [diff] [blame] | 19 | #include <vector> |
| 20 | #include <string> |
Brian Gaeke | d0fde30 | 2003-11-11 22:41:34 +0000 | [diff] [blame] | 21 | |
| 22 | namespace llvm { |
| 23 | |
Mehwish Nagda | 5fb72ae | 2002-07-22 22:09:35 +0000 | [diff] [blame] | 24 | class Pass; |
| 25 | |
Brian Gaeke | b92c5c0 | 2003-09-18 17:37:35 +0000 | [diff] [blame] | 26 | Pass *getMappingInfoAsmPrinterPass(std::ostream &out); |
Brian Gaeke | c86b8d5 | 2003-06-04 22:02:47 +0000 | [diff] [blame] | 27 | |
| 28 | class MappingInfo { |
Chris Lattner | 48e6079 | 2003-08-13 02:38:16 +0000 | [diff] [blame] | 29 | struct byteVector : public std::vector <unsigned char> { |
| 30 | void dumpAssembly (std::ostream &Out); |
Brian Gaeke | c86b8d5 | 2003-06-04 22:02:47 +0000 | [diff] [blame] | 31 | }; |
| 32 | std::string comment; |
| 33 | std::string symbolPrefix; |
| 34 | unsigned functionNumber; |
| 35 | byteVector bytes; |
| 36 | public: |
| 37 | void outByte (unsigned char b) { bytes.push_back (b); } |
Chris Lattner | 48e6079 | 2003-08-13 02:38:16 +0000 | [diff] [blame] | 38 | MappingInfo (std::string Comment, std::string SymbolPrefix, |
| 39 | unsigned FunctionNumber) : comment(Comment), |
| 40 | symbolPrefix(SymbolPrefix), functionNumber(FunctionNumber) {} |
Brian Gaeke | c86b8d5 | 2003-06-04 22:02:47 +0000 | [diff] [blame] | 41 | void dumpAssembly (std::ostream &Out); |
Chris Lattner | 48e6079 | 2003-08-13 02:38:16 +0000 | [diff] [blame] | 42 | unsigned char *getBytes (unsigned &length) { |
Brian Gaeke | c86b8d5 | 2003-06-04 22:02:47 +0000 | [diff] [blame] | 43 | length = bytes.size(); return &bytes[0]; |
| 44 | } |
| 45 | }; |
Mehwish Nagda | 5fb72ae | 2002-07-22 22:09:35 +0000 | [diff] [blame] | 46 | |
Brian Gaeke | d0fde30 | 2003-11-11 22:41:34 +0000 | [diff] [blame] | 47 | } // End llvm namespace |
| 48 | |
Mehwish Nagda | 5fb72ae | 2002-07-22 22:09:35 +0000 | [diff] [blame] | 49 | #endif |