2003-08-13 04:38:16 +02:00
|
|
|
//===- lib/Target/Sparc/MappingInfo.h ---------------------------*- C++ -*-===//
|
2003-10-21 17:17:13 +02:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file was developed by the LLVM research group and is distributed under
|
|
|
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
2003-06-05 00:02:47 +02:00
|
|
|
//
|
|
|
|
// Data structures to support the Reoptimizer's Instruction-to-MachineInstr
|
|
|
|
// mapping information gatherer.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2003-08-13 04:38:16 +02:00
|
|
|
#ifndef MAPPINGINFO_H
|
|
|
|
#define MAPPINGINFO_H
|
2002-07-23 00:09:35 +02:00
|
|
|
|
|
|
|
#include <iosfwd>
|
2003-06-05 00:02:47 +02:00
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
2002-07-23 00:09:35 +02:00
|
|
|
class Pass;
|
|
|
|
|
2003-09-18 19:37:35 +02:00
|
|
|
Pass *getMappingInfoAsmPrinterPass(std::ostream &out);
|
2002-07-23 00:09:35 +02:00
|
|
|
|
2003-06-05 00:02:47 +02:00
|
|
|
class MappingInfo {
|
2003-08-13 04:38:16 +02:00
|
|
|
struct byteVector : public std::vector <unsigned char> {
|
|
|
|
void dumpAssembly (std::ostream &Out);
|
2003-06-05 00:02:47 +02:00
|
|
|
};
|
|
|
|
std::string comment;
|
|
|
|
std::string symbolPrefix;
|
|
|
|
unsigned functionNumber;
|
|
|
|
byteVector bytes;
|
|
|
|
public:
|
|
|
|
void outByte (unsigned char b) { bytes.push_back (b); }
|
2003-08-13 04:38:16 +02:00
|
|
|
MappingInfo (std::string Comment, std::string SymbolPrefix,
|
|
|
|
unsigned FunctionNumber) : comment(Comment),
|
|
|
|
symbolPrefix(SymbolPrefix), functionNumber(FunctionNumber) {}
|
2003-06-05 00:02:47 +02:00
|
|
|
void dumpAssembly (std::ostream &Out);
|
2003-08-13 04:38:16 +02:00
|
|
|
unsigned char *getBytes (unsigned &length) {
|
2003-06-05 00:02:47 +02:00
|
|
|
length = bytes.size(); return &bytes[0];
|
|
|
|
}
|
|
|
|
};
|
2002-07-23 00:09:35 +02:00
|
|
|
|
2003-06-05 00:02:47 +02:00
|
|
|
#endif
|