LLVM API Documentation

MappingInfo.h

Go to the documentation of this file.
00001 //===- lib/Target/SparcV9/MappingInfo.h -------------------------*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file was developed by the LLVM research group and is distributed under
00006 // the University of Illinois Open Source License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // Data structures to support the Reoptimizer's Instruction-to-MachineInstr
00011 // mapping information gatherer.
00012 //
00013 //===----------------------------------------------------------------------===//
00014 
00015 #ifndef MAPPINGINFO_H
00016 #define MAPPINGINFO_H
00017 
00018 #include <iosfwd>
00019 #include <vector>
00020 #include <string>
00021 
00022 namespace llvm {
00023 
00024 class ModulePass;
00025 
00026 ModulePass *getMappingInfoAsmPrinterPass(std::ostream &out);
00027 ModulePass *createInternalGlobalMapperPass();
00028 
00029 class MappingInfo {
00030   struct byteVector : public std::vector <unsigned char> {
00031     void dumpAssembly (std::ostream &Out);
00032   };
00033   std::string comment;
00034   std::string symbolPrefix;
00035   unsigned functionNumber;
00036   byteVector bytes;
00037 public:
00038   void outByte (unsigned char b) { bytes.push_back (b); }
00039   MappingInfo (std::string Comment, std::string SymbolPrefix,
00040                    unsigned FunctionNumber) : comment(Comment),
00041                    symbolPrefix(SymbolPrefix), functionNumber(FunctionNumber) {}
00042   void dumpAssembly (std::ostream &Out);
00043   unsigned char *getBytes (unsigned &length) {
00044         length = bytes.size(); return &bytes[0];
00045   }
00046 };
00047 
00048 } // End llvm namespace
00049 
00050 #endif