diff --git a/lib/Target/Sparc/MappingInfo.h b/lib/Target/Sparc/MappingInfo.h index aa8efaf893e..c3177dec370 100644 --- a/lib/Target/Sparc/MappingInfo.h +++ b/lib/Target/Sparc/MappingInfo.h @@ -1,11 +1,38 @@ -#ifndef LLVM_CODEGEN_MAPPINGINFO_H -#define LLVM_CODEGEN_MAPPINGINFO_H +//===- 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 #include +#include +#include class Pass; -Pass *MappingInfoForFunction(std::ostream &out); +Pass *getMappingInfoCollector(std::ostream &out); + +class MappingInfo { + class byteVector : public std::vector { + 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]; + } +}; #endif - -