LLVM API Documentation

MachineCodeInfo.h

Go to the documentation of this file.
00001 //===-- MachineCodeInfo.h - Class used to report JIT info -------*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file defines MachineCodeInfo, a class used by the JIT ExecutionEngine
00011 // to report information about the generated machine code.
00012 //
00013 // See JIT::runJITOnFunction for usage.
00014 //
00015 //===----------------------------------------------------------------------===//
00016 
00017 #ifndef EE_MACHINE_CODE_INFO_H
00018 #define EE_MACHINE_CODE_INFO_H
00019 
00020 namespace llvm {
00021 
00022 class MachineCodeInfo {
00023 private:
00024   size_t Size;   // Number of bytes in memory used
00025   void *Address; // The address of the function in memory
00026 
00027 public:
00028   MachineCodeInfo() : Size(0), Address(0) {}
00029 
00030   void setSize(size_t s) {
00031     Size = s;
00032   }
00033 
00034   void setAddress(void *a) {
00035     Address = a;
00036   }
00037 
00038   size_t size() const {
00039     return Size;
00040   }
00041 
00042   void *address() const {
00043     return Address;
00044   }
00045 
00046 };
00047 
00048 }
00049 
00050 #endif
00051