26 #ifndef CASADI_CLANG_COMPILER_HPP
27 #define CASADI_CLANG_COMPILER_HPP
29 #include "casadi/core/importer_internal.hpp"
30 #include <casadi/interfaces/clang/casadi_importer_clang_export.h>
32 #include <clang/CodeGen/CodeGenAction.h>
33 #include <clang/Basic/DiagnosticOptions.h>
34 #include <clang/Basic/TargetInfo.h>
35 #include <clang/Basic/Version.h>
36 #include <clang/Driver/Compilation.h>
37 #include <clang/Driver/Driver.h>
38 #include <clang/Driver/Tool.h>
39 #include <clang/Frontend/CompilerInstance.h>
40 #include <clang/Frontend/CompilerInvocation.h>
41 #include <clang/Frontend/FrontendDiagnostic.h>
42 #include <clang/Frontend/TextDiagnosticPrinter.h>
44 #include <llvm/ADT/SmallString.h>
45 #include <llvm/ExecutionEngine/ExecutionEngine.h>
46 #if (LLVM_VERSION_MAJOR>=4) || (LLVM_VERSION_MAJOR==3 && LLVM_VERSION_MINOR>=5)
47 #include <llvm/ExecutionEngine/MCJIT.h>
49 #include "llvm/ExecutionEngine/JIT.h"
51 #include <llvm/IR/Module.h>
52 #include "llvm/IR/LLVMContext.h"
54 #include <llvm/Support/FileSystem.h>
55 #include <llvm/Support/Host.h>
56 #include <llvm/Support/ManagedStatic.h>
57 #include <llvm/Support/Path.h>
58 #include <llvm/Support/TargetSelect.h>
59 #include <llvm/Support/raw_ostream.h>
60 #include <llvm/Support/raw_os_ostream.h>
104 void init(
const Dict& opts)
override;
113 std::string
class_name()
const override {
return "ClangCompiler";}
116 signal_t get_function(
const std::string& symname)
override;
119 static std::vector<std::pair<std::string, bool> >
120 getIncludes(
const std::string& file,
const std::string&
path);
127 clang::EmitLLVMOnlyAction*
act_;
'clang' plugin for Importer
const Options & get_options() const override
Options.
std::string include_path_
const char * plugin_name() const override
Get name of plugin.
clang::EmitLLVMOnlyAction * act_
static const Options options_
Options.
static const std::string meta_doc
A documentation string.
llvm::raw_ostream * myerr_
llvm::LLVMContext * context_
std::vector< std::string > flags_
static ImporterInternal * creator(const std::string &name)
Create a new JIT function.
llvm::ExecutionEngine * executionEngine_
std::string class_name() const override
Get type name.
GenericType::Dict Dict
C++ equivalent of Python's dict or MATLAB's struct.
void(* signal_t)(void)
Function pointer types for the C API.
std::vector< casadi_int > path(const std::vector< casadi_int > &map, casadi_int i_start)
Options metadata for a class.