1818#include " clang/AST/GlobalDecl.h"
1919#include " clang/AST/Mangle.h"
2020#include " clang/AST/RecordLayout.h"
21+ #include " clang/Basic/Version.h"
22+ #include " clang/Config/config.h"
2123#include " clang/Frontend/CompilerInstance.h"
2224#include " clang/Sema/Sema.h"
2325#include " clang/Sema/Lookup.h"
@@ -1828,6 +1830,21 @@ namespace InterOp {
18281830 return 0 ;
18291831 }
18301832
1833+ TInterp_t CreateInterpreter (const char *resource_dir) {
1834+ std::string MainExecutableName =
1835+ llvm::sys::fs::getMainExecutable (nullptr , nullptr );
1836+ std::vector<const char *> InterpArgv = {" -resource-dir" , resource_dir,
1837+ " -std=c++14" };
1838+ InterpArgv.insert (InterpArgv.begin (), MainExecutableName.c_str ());
1839+ return (TInterp_t) new cling::Interpreter (InterpArgv.size (), &InterpArgv[0 ]);
1840+ }
1841+
1842+ TCppSema_t GetSema (TInterp_t interp) {
1843+ auto * I = (cling::Interpreter*)interp;
1844+
1845+ return (TCppSema_t) &I->getSema ();
1846+ }
1847+
18311848 void AddSearchPath (TInterp_t interp, const char *dir, bool isUser,
18321849 bool prepend) {
18331850 auto * I = (cling::Interpreter*)interp;
@@ -1870,6 +1887,13 @@ namespace InterOp {
18701887
18711888 return I->declare (code);
18721889 }
1890+
1891+ void Process (TInterp_t interp, const char *code) {
1892+ auto * I = (cling::Interpreter*)interp;
1893+
1894+ I->process (code);
1895+ }
1896+
18731897 const std::string LookupLibrary (TInterp_t interp, const char *lib_name) {
18741898 auto * I = (cling::Interpreter*)interp;
18751899
@@ -1884,6 +1908,11 @@ namespace InterOp {
18841908 return res == cling::Interpreter::kSuccess ;
18851909 }
18861910
1911+ std::string ObjToString (TInterp_t interp, const char *type, void *obj) {
1912+ auto * I = (cling::Interpreter*)interp;
1913+ return I->toString (type, obj);
1914+ }
1915+
18871916 TCppScope_t InstantiateClassTemplate (TInterp_t interp, const char *tmpl_name) {
18881917 auto * I = (cling::Interpreter*)interp;
18891918
0 commit comments