Added LLVM copyright header.
[oota-llvm.git] / lib / Target / SparcV9 / MappingInfo.h
1 //===- lib/Target/Sparc/MappingInfo.h ---------------------------*- C++ -*-===//
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 //===----------------------------------------------------------------------===//
9 //
10 // Data structures to support the Reoptimizer's Instruction-to-MachineInstr
11 // mapping information gatherer.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef MAPPINGINFO_H
16 #define MAPPINGINFO_H
17
18 #include <iosfwd>
19 #include <vector>
20 #include <string>
21 class Pass;
22
23 Pass *getMappingInfoAsmPrinterPass(std::ostream &out);
24
25 class MappingInfo {
26   struct byteVector : public std::vector <unsigned char> {
27     void dumpAssembly (std::ostream &Out);
28   };
29   std::string comment;
30   std::string symbolPrefix;
31   unsigned functionNumber;
32   byteVector bytes;
33 public:
34   void outByte (unsigned char b) { bytes.push_back (b); }
35   MappingInfo (std::string Comment, std::string SymbolPrefix,
36                    unsigned FunctionNumber) : comment(Comment),
37                    symbolPrefix(SymbolPrefix), functionNumber(FunctionNumber) {}
38   void dumpAssembly (std::ostream &Out);
39   unsigned char *getBytes (unsigned &length) {
40         length = bytes.size(); return &bytes[0];
41   }
42 };
43
44 #endif