2004-04-25 07:04:49 +00:00
|
|
|
//===- lib/Target/SparcV9/MappingInfo.h -------------------------*- C++ -*-===//
|
2005-04-21 23:30:14 +00:00
|
|
|
//
|
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.
|
2005-04-21 23:30:14 +00:00
|
|
|
//
|
2003-10-21 15:17:13 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
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 {
|
|
|
|
|
2004-09-20 04:48:05 +00:00
|
|
|
class ModulePass;
|
2002-07-22 22:09:35 +00:00
|
|
|
|
2004-09-20 04:48:05 +00:00
|
|
|
ModulePass *getMappingInfoAsmPrinterPass(std::ostream &out);
|
|
|
|
ModulePass *createInternalGlobalMapperPass();
|
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
|