A def. operand of a machine instruction may be an ordinary Value*,
[oota-llvm.git] / lib / Target / SparcV9 / MappingInfo.h
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
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   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 };
37
38 #endif