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