aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/SparcV9/MappingInfo.h
blob: e1bbcc0fa1647c712b49437b57e94446bed83bc3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//===- lib/Target/Sparc/MappingInfo.h ---------------------------*- C++ -*-===//
//
// Data structures to support the Reoptimizer's Instruction-to-MachineInstr
// mapping information gatherer.
//
//===----------------------------------------------------------------------===//

#ifndef MAPPINGINFO_H
#define MAPPINGINFO_H

#include <iosfwd>
#include <vector>
#include <string>
class Pass;

Pass *getMappingInfoAsmPrinterPass(std::ostream &out);

class MappingInfo {
  struct byteVector : public std::vector <unsigned char> {
    void dumpAssembly (std::ostream &Out);
  };
  std::string comment;
  std::string symbolPrefix;
  unsigned functionNumber;
  byteVector bytes;
public:
  void outByte (unsigned char b) { bytes.push_back (b); }
  MappingInfo (std::string Comment, std::string SymbolPrefix,
	           unsigned FunctionNumber) : comment(Comment),
        	   symbolPrefix(SymbolPrefix), functionNumber(FunctionNumber) {}
  void dumpAssembly (std::ostream &Out);
  unsigned char *getBytes (unsigned &length) {
	length = bytes.size(); return &bytes[0];
  }
};

#endif