SHUFP* are two address code.
[oota-llvm.git] / lib / Target / SparcV9 / MappingInfo.h
1 //===- lib/Target/SparcV9/MappingInfo.h -------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // Data structures to support the Reoptimizer's Instruction-to-MachineInstr
11 // mapping information gatherer.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef MAPPINGINFO_H
16 #define MAPPINGINFO_H
17
18 #include <iosfwd>
19 #include <vector>
20 #include <string>
21
22 namespace llvm {
23
24 class ModulePass;
25
26 ModulePass *getMappingInfoAsmPrinterPass(std::ostream &out);
27 ModulePass *createInternalGlobalMapperPass();
28
29 class MappingInfo {
30   struct byteVector : public std::vector <unsigned char> {
31     void dumpAssembly (std::ostream &Out);
32   };
33   std::string comment;
34   std::string symbolPrefix;
35   unsigned functionNumber;
36   byteVector bytes;
37 public:
38   void outByte (unsigned char b) { bytes.push_back (b); }
39   MappingInfo (std::string Comment, std::string SymbolPrefix,
40                    unsigned FunctionNumber) : comment(Comment),
41                    symbolPrefix(SymbolPrefix), functionNumber(FunctionNumber) {}
42   void dumpAssembly (std::ostream &Out);
43   unsigned char *getBytes (unsigned &length) {
44         length = bytes.size(); return &bytes[0];
45   }
46 };
47
48 } // End llvm namespace
49
50 #endif