diff options
author | Stephane Sezer <sas@cd80.net> | 2018-05-25 20:23:42 +0000 |
---|---|---|
committer | Stephane Sezer <sas@cd80.net> | 2018-05-25 20:23:42 +0000 |
commit | b6f6192db109fd549ac7d5211fd8b692291bb989 (patch) | |
tree | 8dc440618fb8ac2e3f3d4c47991999160ee6f3ba /clang/examples/clang-interpreter/Manager.h | |
parent | 0baba9e7287d5afc5bf163d954079bf2c4741fb3 (diff) | |
download | bcm5719-llvm-b6f6192db109fd549ac7d5211fd8b692291bb989.tar.gz bcm5719-llvm-b6f6192db109fd549ac7d5211fd8b692291bb989.zip |
Convert clang-interpreter to ORC JIT API
Summary: This mostly re-uses code from the KaleidoscopeJIT example.
Reviewers: ddunbar, lhames
Reviewed By: lhames
Subscribers: mgrang, alexshap, mgorny, xiaobai, cfe-commits
Differential Revision: https://reviews.llvm.org/D45897
llvm-svn: 333302
Diffstat (limited to 'clang/examples/clang-interpreter/Manager.h')
-rw-r--r-- | clang/examples/clang-interpreter/Manager.h | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/clang/examples/clang-interpreter/Manager.h b/clang/examples/clang-interpreter/Manager.h deleted file mode 100644 index 013bbbccfd7..00000000000 --- a/clang/examples/clang-interpreter/Manager.h +++ /dev/null @@ -1,59 +0,0 @@ -//===-- examples/clang-interpreter/Manager.h - Clang C Interpreter Example -==// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef CLANG_EXAMPLE_INTERPRETER_MANAGER_H -#define CLANG_EXAMPLE_INTERPRETER_MANAGER_H - -#include "llvm/ExecutionEngine/SectionMemoryManager.h" - -#if defined(_WIN32) && defined(_WIN64) -#define CLANG_INTERPRETER_COFF_FORMAT -#define CLANG_INTERPRETER_WIN_EXCEPTIONS -#endif - -namespace interpreter { - -class SingleSectionMemoryManager : public llvm::SectionMemoryManager { - struct Block { - uint8_t *Addr = nullptr, *End = nullptr; - void Reset(uint8_t *Ptr, uintptr_t Size); - uint8_t *Next(uintptr_t Size, unsigned Alignment); - }; - Block Code, ROData, RWData; - -public: - uint8_t *allocateCodeSection(uintptr_t Size, unsigned Align, unsigned ID, - llvm::StringRef Name) final; - - uint8_t *allocateDataSection(uintptr_t Size, unsigned Align, unsigned ID, - llvm::StringRef Name, bool RO) final; - - void reserveAllocationSpace(uintptr_t CodeSize, uint32_t CodeAlign, - uintptr_t ROSize, uint32_t ROAlign, - uintptr_t RWSize, uint32_t RWAlign) final; - - bool needsToReserveAllocationSpace() override { return true; } - -#ifdef CLANG_INTERPRETER_WIN_EXCEPTIONS - using llvm::SectionMemoryManager::EHFrameInfos; - - SingleSectionMemoryManager(); - - void deregisterEHFrames() override; - - bool finalizeMemory(std::string *ErrMsg) override; - -private: - uintptr_t ImageBase = 0; -#endif -}; - -} - -#endif // CLANG_EXAMPLE_INTERPRETER_MANAGER_H |