2003-08-13 02:38:16 +00:00
|
|
|
//===- lib/Target/Sparc/MappingInfo.h ---------------------------*- C++ -*-===//
|
2003-10-21 15:17:13 +00: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-04 22:02:47 +00:00
|
|
|
//
|
|
|
|
// Data structures to support the Reoptimizer's Instruction-to-MachineInstr
|
|
|
|
// mapping information gatherer.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2003-08-13 02:38:16 +00:00
|
|
|
#ifndef MAPPINGINFO_H
|
|
|
|
#define MAPPINGINFO_H
|
2002-07-22 22:09:35 +00:00
|
|
|
|
|
|
|
#include <iosfwd>
|
2003-06-04 22:02:47 +00:00
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
2003-11-11 22:41:34 +00:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
2002-07-22 22:09:35 +00:00
|
|
|
class Pass;
|
|
|
|
|
2003-09-18 17:37:35 +00:00
|
|
|
Pass *getMappingInfoAsmPrinterPass(std::ostream &out);
|
2002-07-22 22:09:35 +00:00
|
|
|
|
2003-06-04 22:02:47 +00:00
|
|
|
class MappingInfo {
|
2003-08-13 02:38:16 +00:00
|
|
|
struct byteVector : public std::vector <unsigned char> {
|
|
|
|
void dumpAssembly (std::ostream &Out);
|
2003-06-04 22:02:47 +00:00
|
|
|
};
|
|
|
|
std::string comment;
|
|
|
|
std::string symbolPrefix;
|
|
|
|
unsigned functionNumber;
|
|
|
|
byteVector bytes;
|
|
|
|
public:
|
|
|
|
void outByte (unsigned char b) { bytes.push_back (b); }
|
2003-08-13 02:38:16 +00:00
|
|
|
MappingInfo (std::string Comment, std::string SymbolPrefix,
|
|
|
|
unsigned FunctionNumber) : comment(Comment),
|
|
|
|
symbolPrefix(SymbolPrefix), functionNumber(FunctionNumber) {}
|
2003-06-04 22:02:47 +00:00
|
|
|
void dumpAssembly (std::ostream &Out);
|
2003-08-13 02:38:16 +00:00
|
|
|
unsigned char *getBytes (unsigned &length) {
|
2003-06-04 22:02:47 +00:00
|
|
|
length = bytes.size(); return &bytes[0];
|
|
|
|
}
|
|
|
|
};
|
2002-07-22 22:09:35 +00:00
|
|
|
|
2003-11-11 22:41:34 +00:00
|
|
|
} // End llvm namespace
|
|
|
|
|
2003-06-04 22:02:47 +00:00
|
|
|
#endif
|