Instantiate a JITMemoryManager for MCJIT Dyld
[oota-llvm.git] / include / llvm / ExecutionEngine / RuntimeDyld.h
1 //===-- RuntimeDyld.h - Run-time dynamic linker for MC-JIT ------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // Interface for the runtime dynamic linker facilities of the MC-JIT.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef LLVM_RUNTIME_DYLD_H
15 #define LLVM_RUNTIME_DYLD_H
16
17 #include "llvm/ADT/StringRef.h"
18 #include "llvm/Support/Memory.h"
19
20 namespace llvm {
21
22 class RuntimeDyldImpl;
23 class MemoryBuffer;
24 class JITMemoryManager;
25
26 class RuntimeDyld {
27   RuntimeDyld(const RuntimeDyld &);     // DO NOT IMPLEMENT
28   void operator=(const RuntimeDyld &);  // DO NOT IMPLEMENT
29
30   // RuntimeDyldImpl is the actual class. RuntimeDyld is just the public
31   // interface.
32   RuntimeDyldImpl *Dyld;
33 public:
34   RuntimeDyld(JITMemoryManager*);
35   ~RuntimeDyld();
36
37   bool loadObject(MemoryBuffer *InputBuffer);
38   void *getSymbolAddress(StringRef Name);
39   // FIXME: Should be parameterized to get the memory block associated with
40   // a particular loaded object.
41   sys::MemoryBlock getMemoryBlock();
42   StringRef getErrorString();
43 };
44
45 } // end namespace llvm
46
47 #endif