2003-06-04 22:02:47 +00:00
|
|
|
//===- llvm/Reoptimizer/Mapping/MappingInfo.h ------------------*- C++ -*--=////
|
|
|
|
//
|
|
|
|
// Data structures to support the Reoptimizer's Instruction-to-MachineInstr
|
|
|
|
// mapping information gatherer.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_REOPTIMIZER_MAPPING_MAPPINGINFO_H
|
|
|
|
#define LLVM_REOPTIMIZER_MAPPING_MAPPINGINFO_H
|
2002-07-22 22:09:35 +00:00
|
|
|
|
|
|
|
#include <iosfwd>
|
2003-06-04 22:02:47 +00:00
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
2002-07-22 22:09:35 +00:00
|
|
|
class Pass;
|
|
|
|
|
2003-06-04 22:02:47 +00:00
|
|
|
Pass *getMappingInfoCollector(std::ostream &out);
|
2002-07-22 22:09:35 +00:00
|
|
|
|
2003-06-04 22:02:47 +00:00
|
|
|
class MappingInfo {
|
|
|
|
class byteVector : public std::vector <unsigned char> {
|
|
|
|
public:
|
|
|
|
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 int &length) {
|
|
|
|
length = bytes.size(); return &bytes[0];
|
|
|
|
}
|
|
|
|
};
|
2002-07-22 22:09:35 +00:00
|
|
|
|
2003-06-04 22:02:47 +00:00
|
|
|
#endif
|