Brian Gaeke | 03cac37 | 2004-04-25 07:04:49 +0000 | [diff] [blame] | 1 | //===- lib/Target/SparcV9/MappingInfo.h -------------------------*- C++ -*-===// |
John Criswell | 29265fe | 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 | 44b2d7a | 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 | ec611ae | 2003-08-13 02:38:16 +0000 | [diff] [blame] | 15 | #ifndef MAPPINGINFO_H |
| 16 | #define MAPPINGINFO_H |
Mehwish Nagda | f6f772b | 2002-07-22 22:09:35 +0000 | [diff] [blame] | 17 | |
| 18 | #include <iosfwd> |
Brian Gaeke | 44b2d7a | 2003-06-04 22:02:47 +0000 | [diff] [blame] | 19 | #include <vector> |
| 20 | #include <string> |
Brian Gaeke | 960707c | 2003-11-11 22:41:34 +0000 | [diff] [blame] | 21 | |
| 22 | namespace llvm { |
| 23 | |
Chris Lattner | 4f2cf03 | 2004-09-20 04:48:05 +0000 | [diff] [blame] | 24 | class ModulePass; |
Mehwish Nagda | f6f772b | 2002-07-22 22:09:35 +0000 | [diff] [blame] | 25 | |
Chris Lattner | 4f2cf03 | 2004-09-20 04:48:05 +0000 | [diff] [blame] | 26 | ModulePass *getMappingInfoAsmPrinterPass(std::ostream &out); |
| 27 | ModulePass *createInternalGlobalMapperPass(); |
Brian Gaeke | 44b2d7a | 2003-06-04 22:02:47 +0000 | [diff] [blame] | 28 | |
| 29 | class MappingInfo { |
Chris Lattner | ec611ae | 2003-08-13 02:38:16 +0000 | [diff] [blame] | 30 | struct byteVector : public std::vector <unsigned char> { |
| 31 | void dumpAssembly (std::ostream &Out); |
Brian Gaeke | 44b2d7a | 2003-06-04 22:02:47 +0000 | [diff] [blame] | 32 | }; |
| 33 | std::string comment; |
| 34 | std::string symbolPrefix; |
| 35 | unsigned functionNumber; |
| 36 | byteVector bytes; |
| 37 | public: |
| 38 | void outByte (unsigned char b) { bytes.push_back (b); } |
Chris Lattner | ec611ae | 2003-08-13 02:38:16 +0000 | [diff] [blame] | 39 | MappingInfo (std::string Comment, std::string SymbolPrefix, |
| 40 | unsigned FunctionNumber) : comment(Comment), |
| 41 | symbolPrefix(SymbolPrefix), functionNumber(FunctionNumber) {} |
Brian Gaeke | 44b2d7a | 2003-06-04 22:02:47 +0000 | [diff] [blame] | 42 | void dumpAssembly (std::ostream &Out); |
Chris Lattner | ec611ae | 2003-08-13 02:38:16 +0000 | [diff] [blame] | 43 | unsigned char *getBytes (unsigned &length) { |
Brian Gaeke | 44b2d7a | 2003-06-04 22:02:47 +0000 | [diff] [blame] | 44 | length = bytes.size(); return &bytes[0]; |
| 45 | } |
| 46 | }; |
Mehwish Nagda | f6f772b | 2002-07-22 22:09:35 +0000 | [diff] [blame] | 47 | |
Brian Gaeke | 960707c | 2003-11-11 22:41:34 +0000 | [diff] [blame] | 48 | } // End llvm namespace |
| 49 | |
Mehwish Nagda | f6f772b | 2002-07-22 22:09:35 +0000 | [diff] [blame] | 50 | #endif |