blob: c3177dec370758d4091c2cd33ee61bce08c58332 [file] [log] [blame]
Brian Gaekec86b8d52003-06-04 22:02:47 +00001//===- 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
Mehwish Nagda5fb72ae2002-07-22 22:09:35 +000010
11#include <iosfwd>
Brian Gaekec86b8d52003-06-04 22:02:47 +000012#include <vector>
13#include <string>
Mehwish Nagda5fb72ae2002-07-22 22:09:35 +000014class Pass;
15
Brian Gaekec86b8d52003-06-04 22:02:47 +000016Pass *getMappingInfoCollector(std::ostream &out);
17
18class 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;
27public:
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};
Mehwish Nagda5fb72ae2002-07-22 22:09:35 +000037
38#endif