ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
GCCJIT.h
Go to the documentation of this file.
1 /*
2 
3  @copyright
4 
5  <pre>
6 
7  Copyright 2018 Infineon Technologies AG
8 
9  This file is part of ETISS tool, see <https://github.com/tum-ei-eda/etiss>.
10 
11  The initial version of this software has been created with the funding support by the German Federal
12  Ministry of Education and Research (BMBF) in the project EffektiV under grant 01IS13022.
13 
14  Redistribution and use in source and binary forms, with or without modification, are permitted
15  provided that the following conditions are met:
16 
17  1. Redistributions of source code must retain the above copyright notice, this list of conditions and
18  the following disclaimer.
19 
20  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions
21  and the following disclaimer in the documentation and/or other materials provided with the distribution.
22 
23  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse
24  or promote products derived from this software without specific prior written permission.
25 
26  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
27  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
28  PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
29  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
30  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33  POSSIBILITY OF SUCH DAMAGE.
34 
35  </pre>
36 
37  @author Chair of Electronic Design Automation, TUM
38 
39  @version 0.1
40 
41 */
42 
43 #include "etiss/JIT.h"
44 
49 class GCCJIT : public etiss::JIT
50 {
51  public:
52  GCCJIT(bool cleanup = true);
53  virtual ~GCCJIT();
54  virtual void *translate(std::string code, std::set<std::string> headerpaths, std::set<std::string> librarypaths,
55  std::set<std::string> libraries, std::string &error, bool debug = false);
56  virtual void *getFunction(void *handle, std::string name, std::string &error);
57  virtual void free(void *handle);
58 
59  private:
60  private:
61  unsigned id;
62  std::string path_;
63  bool cleanup_;
64 };
JIT compiler interface definition.
provides compilation via gcc and load the compilation result with dlopen/dlsym functions
Definition: GCCJIT.h:50
unsigned id
Definition: GCCJIT.h:61
bool cleanup_
Definition: GCCJIT.h:63
virtual void free(void *handle)
clean up handled returned by etiss::JIT::translate
Definition: GCCJIT.cpp:193
virtual void * translate(std::string code, std::set< std::string > headerpaths, std::set< std::string > librarypaths, std::set< std::string > libraries, std::string &error, bool debug=false)
translate C code to executable code and return a handle/pointer that identifies the compilation resul...
Definition: GCCJIT.cpp:87
std::string path_
Definition: GCCJIT.h:62
GCCJIT(bool cleanup=true)
Definition: GCCJIT.cpp:54
virtual void * getFunction(void *handle, std::string name, std::string &error)
returns a function pointer to a compiled function from the handle returned by etiss::JIT::translate
Definition: GCCJIT.cpp:183
virtual ~GCCJIT()
Definition: GCCJIT.cpp:79
compiler interface for just in time compilation of generated C code
Definition: JIT.h:67