37#include "cling/Interpreter/Value.h"
39#include <llvm/ADT/SmallVector.h>
69 std::unique_ptr<TClingMethodInfo>
fMethod;
71 const clang::FunctionDecl *
fDecl =
nullptr;
77 mutable llvm::SmallVector<cling::Value, 8>
fArgVals;
92 const std::string& wrapper,
93 bool withAccessControl =
true);
96 std::ostringstream& callbuf, std::string& type_name,
100 void make_narg_call(
const std::string &return_type,
const unsigned N, std::ostringstream &typedefbuf,
101 std::ostringstream &callbuf,
const std::string &class_name,
int indent_level);
104 std::ostringstream& callbuf,
105 const std::string& class_name,
int indent_level);
108 const std::string& class_name,
109 std::ostringstream& buf,
int indent_level);
112 const std::string& class_name,
113 std::ostringstream& buf,
int indent_level);
124 template <
typename T>
125 void execWithLL(
void* address, cling::Value* val);
126 template <
typename T>
127 void execWithULL(
void* address, cling::Value* val);
135 void exec(
void* address,
void* ret);
150 template <
typename T>
151 T
ExecT(
void* address);
183 const std::string &type_name,
184 void* address =
nullptr,
unsigned long nary = 0UL);
186 unsigned long nary = 0UL,
bool withFree =
true);
189 const void* args[] = 0,
200 void Init(std::unique_ptr<TClingMethodInfo>);
201 void Invoke(cling::Value* result = 0)
const;
217 return fMethod->GetTargetFunctionDecl();
224 void SetArg(
unsigned long arg);
227 void SetArg(
long long arg);
228 void SetArg(
unsigned long long arg);
230 void SetArgs(
const char* args);
232 const char* arglist,
Longptr_t* poffset);
234 const char* arglist,
bool objectIsConst,
Longptr_t* poffset);
243 const llvm::SmallVectorImpl<clang::QualType>&
proto,
247 const llvm::SmallVectorImpl<clang::QualType>&
proto,
typedef void(GLAPIENTRYP _GLUfuncptr)(void)
void(* tcling_callfunc_ctor_Wrapper_t)(void **, void *, unsigned long)
void(* tcling_callfunc_Wrapper_t)(void *, int, void **, void *)
void(* tcling_callfunc_dtor_Wrapper_t)(void *, unsigned long, int)
Emulation of the CINT CallFunc class.
void * ExecDefaultConstructor(const TClingClassInfo *info, ROOT::TMetaUtils::EIOCtorCategory kind, const std::string &type_name, void *address=nullptr, unsigned long nary=0UL)
void ExecWithReturn(void *address, void *ret=nullptr)
std::unique_ptr< TClingMethodInfo > fMethod
Current method, we own.
ExecWithRetFunc_t InitRetAndExec(const clang::FunctionDecl *FD, cling::Value &ret)
void collect_type_info(clang::QualType &QT, std::ostringstream &typedefbuf, std::ostringstream &callbuf, std::string &type_name, EReferenceType &refType, bool &isPointer, int indent_level, bool forArgument)
const clang::FunctionDecl * GetDecl() const
void SetArgs(const char *args)
size_t fMinRequiredArguments
Number of required arguments.
TClingCallFunc(cling::Interpreter *interp, const ROOT::TMetaUtils::TNormalizedCtxt &normCtxt)
size_t CalculateMinRequiredArguments()
double ExecDouble(void *address)
void SetArgArray(Longptr_t *argArr, int narg)
bool fIgnoreExtraArgs
If true, do not limit number of function arguments to declared number.
tcling_callfunc_Wrapper_t make_wrapper()
ExecWithRetFunc_t InitRetAndExecNoCtor(clang::QualType QT, cling::Value &ret)
tcling_callfunc_dtor_Wrapper_t make_dtor_wrapper(const TClingClassInfo *info)
~TClingCallFunc()=default
std::function< void(void *address, cling::Value &ret)> ExecWithRetFunc_t
void ExecDestructor(const TClingClassInfo *info, void *address=nullptr, unsigned long nary=0UL, bool withFree=true)
Longptr_t ExecInt(void *address)
void execWithLL(void *address, cling::Value *val)
const clang::DeclContext * GetDeclContext() const
void * compile_wrapper(const std::string &wrapper_name, const std::string &wrapper, bool withAccessControl=true)
void SetFuncProto(const TClingClassInfo *info, const char *method, const char *proto, Longptr_t *poffset, ROOT::EFunctionMatchMode mode=ROOT::kConversionMatch)
TInterpreter::CallFuncIFacePtr_t IFacePtr()
void exec(void *address, void *ret)
void exec_with_valref_return(void *address, cling::Value *ret)
void Invoke(cling::Value *result=0) const
void make_narg_ctor(const unsigned N, std::ostringstream &typedefbuf, std::ostringstream &callbuf, const std::string &class_name, int indent_level)
TClingCallFunc(const TClingMethodInfo &minfo, const ROOT::TMetaUtils::TNormalizedCtxt &normCtxt)
void SetFunc(const TClingClassInfo *info, const char *method, const char *arglist, Longptr_t *poffset)
const clang::FunctionDecl * GetDecl()
void execWithULL(void *address, cling::Value *val)
void EvaluateArgList(const std::string &ArgList)
const clang::Decl * GetFunctionOrShadowDecl() const
void ExecWithArgsAndReturn(void *address, const void *args[]=0, int nargs=0, void *ret=0)
TClingCallFunc(const TClingCallFunc &rhs)
void Exec(void *address, TInterpreterValue *interpVal=0)
TClingMethodInfo * FactoryMethod() const
ExecWithRetFunc_t InitRetAndExecIntegral(clang::QualType QT, cling::Value &ret)
int get_wrapper_code(std::string &wrapper_name, std::string &wrapper)
size_t GetMinRequiredArguments()
tcling_callfunc_ctor_Wrapper_t make_ctor_wrapper(const TClingClassInfo *, ROOT::TMetaUtils::EIOCtorCategory, const std::string &)
const ROOT::TMetaUtils::TNormalizedCtxt & fNormCtxt
ROOT normalized context for that interpreter.
void IgnoreExtraArgs(bool ignore)
tcling_callfunc_Wrapper_t fWrapper
Pointer to compiled wrapper, we do not own.
TClingCallFunc & operator=(const TClingCallFunc &rhs)=delete
long long ExecInt64(void *address)
cling::Interpreter * fInterp
Cling interpreter, we do not own.
void make_narg_call(const std::string &return_type, const unsigned N, std::ostringstream &typedefbuf, std::ostringstream &callbuf, const std::string &class_name, int indent_level)
const clang::FunctionDecl * fDecl
Decl for the method.
void make_narg_call_with_return(const unsigned N, const std::string &class_name, std::ostringstream &buf, int indent_level)
llvm::SmallVector< cling::Value, 8 > fArgVals
Stored function arguments, we own.
void make_narg_ctor_with_return(const unsigned N, const std::string &class_name, std::ostringstream &buf, int indent_level)
ExecWithRetFunc_t InitRetAndExecBuiltin(clang::QualType QT, const clang::BuiltinType *BT, cling::Value &ret)
Emulation of the CINT ClassInfo class.
Emulation of the CINT MethodInfo class.