CppInterOp
C++ Language Interoperability Layer
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Functions | Variables
Cpp Namespace Reference

Namespaces

namespace  detail
 
namespace  Thunks
 

Classes

class  Box
 
struct  CurScope__LINE__
 
struct  InterpreterInfo
 
struct  InterpreterShutdown
 RAII guard whose dtor calls llvm_shutdown for the owned-interpreter case. More...
 
struct  Only_CurScope
 
struct  Only_CurScope< clang::Sema >
 
struct  Only_Types
 
struct  Only_Types< ASTContext >
 
class  StreamCaptureInfo
 
struct  Types__LINE__
 
struct  VTableOverlay
 
struct  VTableOverlayDeleter
 

Typedefs

using UniqueVTableOverlay = std::unique_ptr< VTableOverlay, VTableOverlayDeleter >
 

Functions

void *& VTableOverlayExtraSlot (void *inst, std::size_t i)
 Address of the i-th extra-prefix slot of an instance with an overlay installed via MakeVTableOverlay(..., n_extra_prefix_slots = N, ...).
 
UniqueVTableOverlay MakeUniqueVTableOverlay (void *inst, DeclRef base, std::initializer_list< std::pair< ConstFuncRef, void * > > overrides, std::size_t n_extra_prefix_slots=0, VTableOverlayDtorHook on_destroy=nullptr, void *cleanup_data=nullptr)
 Owning wrapper over MakeVTableOverlay: each pair maps a virtual method of polymorphic class base to its replacement function pointer.
 
bool LoadDispatchAPI (const char *customLibPath=nullptr)
 Initialize all CppInterOp API from the dynamically loaded library.
 
void UnloadDispatchAPI ()
 
static void DefaultProcessCrashHandler (void *)
 
static std::deque< InterpreterInfo > & GetInterpreters (bool SetCrashHandler=true)
 
static void RegisterInterpreter (compat::Interpreter *I, bool Owned)
 
static InterpreterInfogetInterpInfo (compat::Interpreter *I=nullptr)
 
static compat::InterpretergetInterp (InterpRef I=nullptr)
 
InterpRef GetInterpreter ()
 
void UseExternalInterpreter (InterpRef I)
 
bool ActivateInterpreter (InterpRef I)
 
bool DeleteInterpreter (InterpRef I)
 
static clang::Sema & getSema ()
 
static clang::ASTContext & getASTContext ()
 
static void ForceCodeGen (Decl *D, compat::Interpreter &I)
 
void CppInterOpTraceJitCallInvokeImpl (const JitCall *JC, void *result, void **args, std::size_t nargs, void *self)
 
void CppInterOpTraceJitCallInvokeDestructorImpl (const JitCall *JC, void *object, unsigned long nary, int withFree)
 
void CppInterOpTraceJitCallInvokeReturnImpl (const JitCall *JC, void *result)
 
std::string GetVersion ()
 
std::string GetBuildInfo ()
 
std::string Demangle (const std::string &mangled_name)
 
void EnableDebugOutput (bool value)
 
bool IsDebugOutputEnabled ()
 
static void InstantiateFunctionDefinition (Decl *D)
 
bool IsAggregate (ConstDeclRef DRef)
 
bool IsNamespace (ConstDeclRef DRef)
 
bool IsClass (ConstDeclRef DRef)
 
bool IsFunction (ConstDeclRef DRef)
 
bool IsFunctionPointerType (ConstTypeRef TyRef)
 
bool IsClassPolymorphic (ConstDeclRef DRef)
 
static SourceLocation GetValidSLoc (Sema &semaRef)
 
bool IsComplete (ConstDeclRef DRef)
 
size_t SizeOf (ConstDeclRef DRef)
 
bool IsBuiltin (ConstTypeRef TyRef)
 
bool IsTemplate (ConstDeclRef DRef)
 
bool IsTemplateSpecialization (ConstDeclRef DRef)
 
bool IsTypedefed (ConstDeclRef DRef)
 
bool IsAbstract (ConstDeclRef DRef)
 
bool IsEnumScope (ConstDeclRef DRef)
 
bool IsEnumConstant (ConstDeclRef DRef)
 
bool IsEnumType (ConstTypeRef TyRef)
 
static bool isSmartPointer (const RecordType *RT)
 
bool IsSmartPtrType (ConstTypeRef TyRef)
 
TypeRef GetIntegerTypeFromEnumScope (ConstDeclRef DRef)
 
TypeRef GetIntegerTypeFromEnumType (ConstTypeRef enum_type)
 
std::vector< DeclRef > GetEnumConstants (ConstDeclRef DRef)
 
TypeRef GetEnumConstantType (ConstDeclRef DRef)
 
size_t GetEnumConstantValue (ConstDeclRef DRef)
 
size_t GetSizeOfType (ConstTypeRef TyRef)
 
bool IsVariable (ConstDeclRef DRef)
 
std::string GetName (ConstDeclRef DRef)
 
static std::string GetCompleteNameImpl (ConstDeclRef DRef, bool qualified)
 
std::string GetCompleteName (ConstDeclRef DRef)
 
std::string GetQualifiedName (ConstDeclRef DRef)
 
std::string GetQualifiedCompleteName (ConstDeclRef DRef)
 
std::string GetDoxygenComment (ConstDeclRef DRef, bool strip_comment_markers)
 
std::vector< DeclRef > GetUsingNamespaces (ConstDeclRef DRef)
 
DeclRef GetGlobalScope ()
 
static Decl * GetScopeFromType (QualType QT)
 
DeclRef GetScopeFromType (ConstTypeRef TyRef)
 
static const clang::Decl * GetUnderlyingScopeImpl (const clang::Decl *D)
 
DeclRef GetUnderlyingScope (ConstDeclRef DRef)
 
DeclRef GetScope (const std::string &name, ConstDeclRef parent)
 
DeclRef GetScopeFromCompleteName (const std::string &name)
 
DeclRef GetNamed (const std::string &name, ConstDeclRef parent)
 
DeclRef GetParentScope (ConstDeclRef DRef)
 
size_t GetNumBases (ConstDeclRef DRef)
 
DeclRef GetBaseClass (ConstDeclRef DRef, size_t ibase)
 
bool IsSubclass (ConstDeclRef derived, ConstDeclRef base)
 
static unsigned ComputeBaseOffset (const ASTContext &Context, const CXXRecordDecl *DerivedRD, const CXXBasePath &Path)
 
int64_t GetBaseClassOffset (ConstDeclRef derived, ConstDeclRef base)
 
template<typename DeclType , typename HandleType >
static void GetClassDecls (ConstDeclRef DRef, std::vector< HandleType > &methods)
 
void GetClassMethods (ConstDeclRef DRef, std::vector< FuncRef > &methods)
 
void GetFunctionTemplatedDecls (ConstDeclRef DRef, std::vector< FuncRef > &methods)
 
bool HasDefaultConstructor (ConstDeclRef DRef)
 
FuncRef GetDefaultConstructor (compat::Interpreter &interp, DeclRef DRef)
 
FuncRef GetDefaultConstructor (DeclRef DRef)
 
FuncRef GetDestructor (ConstDeclRef DRef)
 
void DumpScope (ConstDeclRef DRef)
 
std::vector< FuncRef > GetFunctionsUsingName (ConstDeclRef DRef, const std::string &name)
 
TypeRef GetFunctionReturnType (ConstFuncRef func)
 
bool IsFunctionProtoType (ConstTypeRef TyRef)
 
void GetFnTypeSignature (ConstTypeRef fn_type, std::vector< TypeRef > &sig)
 
size_t GetFunctionNumArgs (ConstFuncRef func)
 
size_t GetFunctionRequiredArgs (ConstFuncRef func)
 
TypeRef GetFunctionArgType (ConstFuncRef func, size_t iarg)
 
bool IsTemplateParmType (ConstTypeRef TyRef)
 
std::string GetFunctionSignature (ConstFuncRef func)
 
bool IsFunctionDeleted (ConstFuncRef function)
 
bool IsTemplatedFunction (ConstFuncRef func)
 
bool ExistsFunctionTemplate (const std::string &name, ConstDeclRef parent)
 
void LookupConstructors (const std::string &name, ConstDeclRef parent, std::vector< FuncRef > &funcs)
 
bool GetClassTemplatedMethods (const std::string &name, ConstDeclRef parent, std::vector< FuncRef > &funcs)
 
FuncRef BestOverloadFunctionMatch (const std::vector< FuncRef > &candidates, const std::vector< TemplateArgInfo > &explicit_types, const std::vector< TemplateArgInfo > &arg_types)
 
bool CheckMethodAccess (ConstFuncRef method, AccessSpecifier AS)
 
bool IsMethod (ConstFuncRef method)
 
bool IsPublicMethod (ConstFuncRef method)
 
bool IsProtectedMethod (ConstFuncRef method)
 
bool IsPrivateMethod (ConstFuncRef method)
 
bool IsConstructor (ConstFuncRef method)
 
bool IsDestructor (ConstFuncRef method)
 
bool IsStaticMethod (ConstFuncRef method)
 
bool IsExplicit (ConstFuncRef method)
 
void * GetFunctionAddress (const char *mangled_name)
 
static void * GetFunctionAddress (const FunctionDecl *FD)
 
void * GetFunctionAddress (FuncRef method)
 
bool IsVirtualMethod (ConstFuncRef method)
 
static int virtualMethodSlot (ConstFuncRef method)
 
static int vtableMethodSlotCount (ConstDeclRef DRef)
 
static bool hasComplexVTableLayout (const CXXRecordDecl *RD)
 
void cppinteropVTableOverlayDtorWrapper (void *self)
 
static VTableOverlayapplyVTableOverlay (void *inst, int total_method_slots, const int *slots, void *const *fns, std::size_t n, std::size_t n_extra_prefix_slots)
 
VTableOverlayMakeVTableOverlay (void *inst, ConstDeclRef base, const ConstFuncRef *methods, void *const *overlay_fns, std::size_t n_overlays, std::size_t n_extra_prefix_slots, VTableOverlayDtorHook on_destroy, void *cleanup_data)
 
void DestroyVTableOverlay (VTableOverlay *overlay)
 
void GetDatamembers (DeclRef DRef, std::vector< DeclRef > &datamembers)
 
void GetStaticDatamembers (ConstDeclRef DRef, std::vector< DeclRef > &datamembers)
 
void GetEnumConstantDatamembers (ConstDeclRef DRef, std::vector< DeclRef > &datamembers, bool include_enum_class)
 
DeclRef LookupDatamember (const std::string &name, ConstDeclRef parent)
 
bool IsLambdaClass (ConstTypeRef TyRef)
 
TypeRef GetVariableType (ConstDeclRef var)
 
intptr_t GetVariableOffset (compat::Interpreter &I, Decl *D, CXXRecordDecl *BaseCXXRD)
 
intptr_t GetVariableOffset (ConstDeclRef var, ConstDeclRef parent)
 
bool CheckVariableAccess (ConstDeclRef var, AccessSpecifier AS)
 
bool IsPublicVariable (ConstDeclRef var)
 
bool IsProtectedVariable (ConstDeclRef var)
 
bool IsPrivateVariable (ConstDeclRef var)
 
bool IsStaticVariable (ConstDeclRef var)
 
bool IsConstVariable (ConstDeclRef var)
 
bool IsRecordType (ConstTypeRef TyRef)
 
bool IsPODType (ConstTypeRef TyRef)
 
bool IsIntegerType (ConstTypeRef TyRef, Signedness *s)
 
bool IsFloatingType (ConstTypeRef TyRef)
 
bool IsSameType (ConstTypeRef type_a, ConstTypeRef type_b)
 
bool IsPointerType (ConstTypeRef TyRef)
 
bool IsVoidPointerType (ConstTypeRef TyRef)
 
TypeRef GetPointeeType (ConstTypeRef TyRef)
 
bool IsReferenceType (ConstTypeRef TyRef)
 
ValueKind GetValueKind (ConstTypeRef TyRef)
 
TypeRef GetPointerType (ConstTypeRef TyRef)
 
TypeRef GetReferencedType (ConstTypeRef TyRef, bool rvalue)
 
TypeRef GetNonReferenceType (ConstTypeRef TyRef)
 
TypeRef GetUnderlyingType (ConstTypeRef TyRef)
 
std::string GetTypeAsString (ConstTypeRef var)
 
TypeRef GetCanonicalType (ConstTypeRef TyRef)
 
bool HasTypeQualifier (ConstTypeRef TyRef, QualKind qual)
 
TypeRef RemoveTypeQualifier (ConstTypeRef TyRef, QualKind qual)
 
TypeRef AddTypeQualifier (ConstTypeRef TyRef, QualKind qual)
 
static void RegisterPerms (llvm::StringMap< QualType > &Map, QualType QT, llvm::SmallVectorImpl< llvm::StringRef > &Words)
 
static void PopulateBuiltinMap (ASTContext &Context)
 
static QualType findBuiltinType (llvm::StringRef typeName, ASTContext &Context)
 
static std::optional< QualType > GetTypeInternal (const Decl *D)
 
TypeRef GetType (const std::string &name, ConstDeclRef parent)
 
TypeRef GetComplexType (ConstTypeRef TyRef)
 
TypeRef GetTypeFromScope (ConstDeclRef DRef)
 
JitCall MakeFunctionCallable (InterpRef I, ConstFuncRef func)
 
JitCall MakeFunctionCallable (ConstFuncRef func)
 
InterpRef CreateInterpreter (const std::vector< const char * > &Args, const std::vector< const char * > &GpuArgs)
 
InterpreterLanguage GetLanguage (InterpRef I)
 
InterpreterLanguageStandard GetLanguageStandard (InterpRef I)
 
void AddSearchPath (const char *dir, bool isUser, bool prepend)
 
const char * GetResourceDir ()
 
static bool exec (const char *cmd, std::vector< std::string > &outputs)
 
std::string DetectResourceDir (const char *ClangBinaryName)
 
void DetectSystemCompilerIncludePaths (std::vector< std::string > &Paths, const char *CompilerName)
 
void AddIncludePath (const char *dir)
 
void GetIncludePaths (std::vector< std::string > &IncludePaths, bool withSystem, bool withFlags)
 
int Declare (compat::Interpreter &I, const char *code, bool silent)
 
int Declare (const char *code, bool silent)
 
int Process (const char *code)
 
static Cpp::Box::Kind classifyByQualType (clang::QualType QT)
 
Box Evaluate (const char *code)
 
std::string LookupLibrary (const char *lib_name)
 
bool LoadLibrary (const char *lib_stem, bool lookup)
 
void UnloadLibrary (const char *lib_stem)
 
std::string SearchLibrariesForSymbol (const char *mangled_name, bool search_system)
 
bool InsertOrReplaceJitSymbol (compat::Interpreter &I, const char *linker_mangled_name, uint64_t address)
 
bool InsertOrReplaceJitSymbol (const char *linker_mangled_name, uint64_t address)
 
std::string ObjToString (const char *TyRef, void *obj)
 
static Decl * InstantiateTemplate (TemplateDecl *TemplateD, TemplateArgumentListInfo &TLI, Sema &S, bool instantiate_body)
 
Decl * InstantiateTemplate (TemplateDecl *TemplateD, ArrayRef< TemplateArgument > TemplateArgs, Sema &S, bool instantiate_body)
 
DeclRef InstantiateTemplate (compat::Interpreter &I, DeclRef tmpl, const TemplateArgInfo *template_args, size_t template_args_size, bool instantiate_body)
 
DeclRef InstantiateTemplate (DeclRef tmpl, const TemplateArgInfo *template_args, size_t template_args_size, bool instantiate_body)
 
DeclRef InstantiateTemplate (DeclRef tmpl, const std::vector< TemplateArgInfo > &template_args, bool instantiate_body)
 
void GetClassTemplateArgs (ConstDeclRef templ_instance, std::vector< TemplateArgInfo > &args)
 
void GetClassTemplateInstantiationArgs (ConstDeclRef templ_instance, std::vector< TemplateArgInfo > &args)
 
FuncRef InstantiateTemplateFunctionFromString (const char *function_template)
 
void GetAllCppNames (ConstDeclRef DRef, std::set< std::string > &names)
 
void GetEnums (ConstDeclRef DRef, std::vector< std::string > &Result)
 
std::vector< long int > GetDimensions (ConstTypeRef TyRef)
 
bool IsTypeDerivedFrom (ConstTypeRef derived, ConstTypeRef base)
 
std::string GetFunctionArgDefault (ConstFuncRef func, size_t param_index)
 
bool IsConstMethod (ConstFuncRef method)
 
std::string GetFunctionArgName (ConstFuncRef func, size_t param_index)
 
std::string GetSpellingFromOperator (Operator Operator)
 
Operator GetOperatorFromSpelling (const std::string &op)
 
OperatorArity GetOperatorArity (ConstFuncRef op)
 
void GetOperator (ConstDeclRef DRef, Operator op, std::vector< FuncRef > &operators, OperatorArity kind)
 
ObjectRef Allocate (DeclRef DRef, size_t count)
 
void Deallocate (DeclRef DRef, ObjectRef address, size_t count)
 
ObjectRef Construct (compat::Interpreter &interp, DeclRef DRef, void *arena, size_t count)
 
ObjectRef Construct (DeclRef DRef, void *arena, size_t count)
 
bool Destruct (compat::Interpreter &interp, ObjectRef This, const Decl *Class, bool withFree, size_t nary)
 
bool Destruct (ObjectRef This, DeclRef DRef, bool withFree, size_t count)
 
static std::stack< StreamCaptureInfo > & GetRedirectionStack ()
 
void BeginStdStreamCapture (CaptureStreamKind fd_kind)
 
std::string EndStdStreamCapture ()
 
void CodeComplete (std::vector< std::string > &Results, const char *code, unsigned complete_line, unsigned complete_column)
 
int Undo (unsigned N)
 
intptr_t Evaluate (const char *code, bool *HadError)
 
void ResultAbort_ValueOnError (const ErrorRef &)
 
void ResultAbort_UncheckedOnDtor (const ErrorRef &)
 
template<typename Handle >
Handle wrap (void *P)
 
template<typename Handle >
Handle wrap (const void *P)
 
template<typename T >
T * unwrap (DeclRef H)
 
template<typename T >
T * unwrap (TypeRef H)
 
template<typename T >
T * unwrap (FuncRef H)
 
template<typename T >
T * unwrap (ObjectRef H)
 
template<typename T >
T * unwrap (InterpRef H)
 
template<typename T >
const T * unwrap (ConstDeclRef H)
 
template<typename T >
const T * unwrap (ConstTypeRef H)
 
template<typename T >
const T * unwrap (ConstFuncRef H)
 

Variables

static bool SkipShutDown = false
 Set by UseExternalInterpreter to suppress llvm_shutdown at process exit – the client owns LLVM in that case.
 
constexpr int kABIPrefixSize = 2
 
constexpr int kMinVTableMethodSlots = 2
 
constexpr int kDeletingDtorSlot = 1
 

Typedef Documentation

◆ UniqueVTableOverlay

using Cpp::UniqueVTableOverlay = typedef std::unique_ptr<VTableOverlay, VTableOverlayDeleter>

Definition at line 69 of file CppInterOp.h.

Function Documentation

◆ ActivateInterpreter()

bool Cpp::ActivateInterpreter ( InterpRef  I)

Definition at line 350 of file CppInterOp.cpp.

References GetInterpreters(), INTEROP_RETURN, and INTEROP_TRACE.

◆ AddIncludePath()

void Cpp::AddIncludePath ( const char *  dir)

◆ AddSearchPath()

void Cpp::AddSearchPath ( const char *  dir,
bool  isUser,
bool  prepend 
)

◆ AddTypeQualifier()

TypeRef Cpp::AddTypeQualifier ( ConstTypeRef  TyRef,
QualKind  qual 
)

Definition at line 2795 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ Allocate()

ObjectRef Cpp::Allocate ( DeclRef  DRef,
size_t  count 
)

Definition at line 5312 of file CppInterOp.cpp.

References Allocate(), INTEROP_RETURN, INTEROP_TRACE, and SizeOf().

Referenced by Allocate().

◆ applyVTableOverlay()

static VTableOverlay * Cpp::applyVTableOverlay ( void *  inst,
int  total_method_slots,
const int *  slots,
void *const *  fns,
std::size_t  n,
std::size_t  n_extra_prefix_slots 
)
static

◆ BeginStdStreamCapture()

void Cpp::BeginStdStreamCapture ( CaptureStreamKind  fd_kind)

◆ BestOverloadFunctionMatch()

FuncRef Cpp::BestOverloadFunctionMatch ( const std::vector< FuncRef > &  candidates,
const std::vector< TemplateArgInfo > &  explicit_types,
const std::vector< TemplateArgInfo > &  arg_types 
)

Definition at line 1816 of file CppInterOp.cpp.

References getInterp(), getSema(), INTEROP_RETURN, and INTEROP_TRACE.

◆ CheckMethodAccess()

bool Cpp::CheckMethodAccess ( ConstFuncRef  method,
AccessSpecifier  AS 
)

Definition at line 1902 of file CppInterOp.cpp.

Referenced by IsPrivateMethod(), IsProtectedMethod(), and IsPublicMethod().

◆ CheckVariableAccess()

bool Cpp::CheckVariableAccess ( ConstDeclRef  var,
AccessSpecifier  AS 
)

Definition at line 2568 of file CppInterOp.cpp.

Referenced by IsPrivateVariable(), IsProtectedVariable(), and IsPublicVariable().

◆ classifyByQualType()

static Cpp::Box::Kind Cpp::classifyByQualType ( clang::QualType  QT)
static

◆ CodeComplete()

void Cpp::CodeComplete ( std::vector< std::string > &  Results,
const char *  code,
unsigned  complete_line,
unsigned  complete_column 
)

◆ ComputeBaseOffset()

static unsigned Cpp::ComputeBaseOffset ( const ASTContext &  Context,
const CXXRecordDecl *  DerivedRD,
const CXXBasePath &  Path 
)
static

Definition at line 1328 of file CppInterOp.cpp.

Referenced by GetBaseClassOffset().

◆ Construct() [1/2]

ObjectRef Cpp::Construct ( compat::Interpreter interp,
DeclRef  DRef,
void *  arena,
size_t  count 
)

◆ Construct() [2/2]

ObjectRef Cpp::Construct ( DeclRef  DRef,
void *  arena,
size_t  count 
)

Definition at line 5352 of file CppInterOp.cpp.

References Construct(), getInterp(), INTEROP_RETURN, and INTEROP_TRACE.

◆ CppInterOpTraceJitCallInvokeDestructorImpl()

void Cpp::CppInterOpTraceJitCallInvokeDestructorImpl ( const JitCall *  JC,
void *  object,
unsigned long  nary,
int  withFree 
)

Definition at line 498 of file CppInterOp.cpp.

References CppInterOp::Tracing::TheTraceInfo.

Referenced by CppInterOp::Tracing::InitTracing().

◆ CppInterOpTraceJitCallInvokeImpl()

void Cpp::CppInterOpTraceJitCallInvokeImpl ( const JitCall *  JC,
void *  result,
void **  args,
std::size_t  nargs,
void *  self 
)

Definition at line 477 of file CppInterOp.cpp.

References CppInterOp::Tracing::TheTraceInfo.

Referenced by CppInterOp::Tracing::InitTracing().

◆ CppInterOpTraceJitCallInvokeReturnImpl()

void Cpp::CppInterOpTraceJitCallInvokeReturnImpl ( const JitCall *  JC,
void *  result 
)

Definition at line 522 of file CppInterOp.cpp.

References CppInterOp::Tracing::TheTraceInfo.

Referenced by CppInterOp::Tracing::InitTracing().

◆ cppinteropVTableOverlayDtorWrapper()

void Cpp::cppinteropVTableOverlayDtorWrapper ( void *  self)

◆ CreateInterpreter()

InterpRef Cpp::CreateInterpreter ( const std::vector< const char * > &  Args,
const std::vector< const char * > &  GpuArgs 
)

◆ Deallocate()

void Cpp::Deallocate ( DeclRef  DRef,
ObjectRef  address,
size_t  count 
)

Definition at line 5317 of file CppInterOp.cpp.

References Deallocate(), INTEROP_TRACE, INTEROP_VOID_RETURN, and SizeOf().

Referenced by Deallocate().

◆ Declare() [1/2]

int Cpp::Declare ( compat::Interpreter I,
const char *  code,
bool  silent 
)

◆ Declare() [2/2]

int Cpp::Declare ( const char *  code,
bool  silent 
)

Definition at line 4697 of file CppInterOp.cpp.

References Declare(), getInterp(), INTEROP_RETURN, and INTEROP_TRACE.

◆ DefaultProcessCrashHandler()

static void Cpp::DefaultProcessCrashHandler ( void *  )
static

◆ DeleteInterpreter()

bool Cpp::DeleteInterpreter ( InterpRef  I)

Definition at line 370 of file CppInterOp.cpp.

References GetInterpreters(), INTEROP_RETURN, and INTEROP_TRACE.

◆ Demangle()

std::string Cpp::Demangle ( const std::string &  mangled_name)

Definition at line 568 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ DestroyVTableOverlay()

void Cpp::DestroyVTableOverlay ( VTableOverlay overlay)

Definition at line 2324 of file CppInterOp.cpp.

References INTEROP_TRACE, and INTEROP_VOID_RETURN.

Referenced by Cpp::VTableOverlayDeleter::operator()().

◆ Destruct() [1/2]

bool Cpp::Destruct ( compat::Interpreter interp,
ObjectRef  This,
const Decl *  Class,
bool  withFree,
size_t  nary 
)

Definition at line 5358 of file CppInterOp.cpp.

References Destruct().

Referenced by Destruct(), and Destruct().

◆ Destruct() [2/2]

bool Cpp::Destruct ( ObjectRef  This,
DeclRef  DRef,
bool  withFree,
size_t  count 
)

Definition at line 5368 of file CppInterOp.cpp.

References Destruct(), getInterp(), INTEROP_RETURN, and INTEROP_TRACE.

◆ DetectResourceDir()

std::string Cpp::DetectResourceDir ( const char *  ClangBinaryName)

Definition at line 4616 of file CppInterOp.cpp.

References exec(), INTEROP_RETURN, and INTEROP_TRACE.

Referenced by CreateInterpreter().

◆ DetectSystemCompilerIncludePaths()

void Cpp::DetectSystemCompilerIncludePaths ( std::vector< std::string > &  Paths,
const char *  CompilerName 
)

Definition at line 4634 of file CppInterOp.cpp.

References exec(), INTEROP_OUT, INTEROP_TRACE, and INTEROP_VOID_RETURN.

◆ DumpScope()

void Cpp::DumpScope ( ConstDeclRef  DRef)

Definition at line 1521 of file CppInterOp.cpp.

References INTEROP_TRACE, and INTEROP_VOID_RETURN.

◆ EnableDebugOutput()

void Cpp::EnableDebugOutput ( bool  value)

Definition at line 583 of file CppInterOp.cpp.

References INTEROP_TRACE, and INTEROP_VOID_RETURN.

◆ EndStdStreamCapture()

std::string Cpp::EndStdStreamCapture ( )

◆ Evaluate() [1/2]

Box Cpp::Evaluate ( const char *  code)

◆ Evaluate() [2/2]

intptr_t Cpp::Evaluate ( const char *  code,
bool *  HadError 
)

Definition at line 35 of file CXCppInterOp.cpp.

References CPPINTEROP_MSAN_UNPOISON_VALUE, and GetInterpreter().

◆ exec()

static bool Cpp::exec ( const char *  cmd,
std::vector< std::string > &  outputs 
)
static
Returns
0 on success.

Definition at line 4588 of file CppInterOp.cpp.

Referenced by DetectResourceDir(), and DetectSystemCompilerIncludePaths().

◆ ExistsFunctionTemplate()

bool Cpp::ExistsFunctionTemplate ( const std::string &  name,
ConstDeclRef  parent 
)

◆ findBuiltinType()

static QualType Cpp::findBuiltinType ( llvm::StringRef  typeName,
ASTContext &  Context 
)
static

Definition at line 2908 of file CppInterOp.cpp.

References GetInterpreters(), and PopulateBuiltinMap().

Referenced by GetType().

◆ ForceCodeGen()

static void Cpp::ForceCodeGen ( Decl *  D,
compat::Interpreter I 
)
static

◆ GetAllCppNames()

void Cpp::GetAllCppNames ( ConstDeclRef  DRef,
std::set< std::string > &  names 
)

Definition at line 5080 of file CppInterOp.cpp.

References GetAllCppNames(), getInterp(), INTEROP_OUT, INTEROP_TRACE, and INTEROP_VOID_RETURN.

Referenced by GetAllCppNames().

◆ getASTContext()

static clang::ASTContext & Cpp::getASTContext ( )
static

◆ GetBaseClass()

DeclRef Cpp::GetBaseClass ( ConstDeclRef  DRef,
size_t  ibase 
)

Definition at line 1288 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

Referenced by GetVariableOffset().

◆ GetBaseClassOffset()

int64_t Cpp::GetBaseClassOffset ( ConstDeclRef  derived,
ConstDeclRef  base 
)

◆ GetBuildInfo()

std::string Cpp::GetBuildInfo ( )

Definition at line 555 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

Referenced by CppInterOp::Tracing::WriteBuildContext().

◆ GetCanonicalType()

TypeRef Cpp::GetCanonicalType ( ConstTypeRef  TyRef)

Definition at line 2751 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ GetClassDecls()

template<typename DeclType , typename HandleType >
static void Cpp::GetClassDecls ( ConstDeclRef  DRef,
std::vector< HandleType > &  methods 
)
static

Definition at line 1409 of file CppInterOp.cpp.

References getInterp(), GetScopeFromType(), and getSema().

◆ GetClassMethods()

void Cpp::GetClassMethods ( ConstDeclRef  DRef,
std::vector< FuncRef > &  methods 
)

Definition at line 1471 of file CppInterOp.cpp.

References INTEROP_OUT, INTEROP_TRACE, and INTEROP_VOID_RETURN.

◆ GetClassTemplateArgs()

void Cpp::GetClassTemplateArgs ( ConstDeclRef  templ_instance,
std::vector< TemplateArgInfo > &  args 
)

Definition at line 5025 of file CppInterOp.cpp.

References INTEROP_OUT, INTEROP_TRACE, and INTEROP_VOID_RETURN.

◆ GetClassTemplatedMethods()

bool Cpp::GetClassTemplatedMethods ( const std::string &  name,
ConstDeclRef  parent,
std::vector< FuncRef > &  funcs 
)

◆ GetClassTemplateInstantiationArgs()

void Cpp::GetClassTemplateInstantiationArgs ( ConstDeclRef  templ_instance,
std::vector< TemplateArgInfo > &  args 
)

Definition at line 5036 of file CppInterOp.cpp.

References INTEROP_OUT, and INTEROP_TRACE.

◆ GetCompleteName()

std::string Cpp::GetCompleteName ( ConstDeclRef  DRef)

Definition at line 960 of file CppInterOp.cpp.

References GetCompleteNameImpl(), INTEROP_RETURN, and INTEROP_TRACE.

◆ GetCompleteNameImpl()

static std::string Cpp::GetCompleteNameImpl ( ConstDeclRef  DRef,
bool  qualified 
)
static

Definition at line 918 of file CppInterOp.cpp.

References getSema().

Referenced by GetCompleteName(), and GetQualifiedCompleteName().

◆ GetComplexType()

TypeRef Cpp::GetComplexType ( ConstTypeRef  TyRef)

Definition at line 2950 of file CppInterOp.cpp.

References getASTContext(), INTEROP_RETURN, and INTEROP_TRACE.

◆ GetDatamembers()

void Cpp::GetDatamembers ( DeclRef  DRef,
std::vector< DeclRef > &  datamembers 
)

Definition at line 2330 of file CppInterOp.cpp.

References getSema(), INTEROP_OUT, INTEROP_TRACE, and INTEROP_VOID_RETURN.

◆ GetDefaultConstructor() [1/2]

FuncRef Cpp::GetDefaultConstructor ( compat::Interpreter interp,
DeclRef  DRef 
)

◆ GetDefaultConstructor() [2/2]

FuncRef Cpp::GetDefaultConstructor ( DeclRef  DRef)

Definition at line 1503 of file CppInterOp.cpp.

References GetDefaultConstructor(), getInterp(), INTEROP_RETURN, and INTEROP_TRACE.

◆ GetDestructor()

FuncRef Cpp::GetDestructor ( ConstDeclRef  DRef)

Definition at line 1508 of file CppInterOp.cpp.

References getSema(), INTEROP_RETURN, and INTEROP_TRACE.

◆ GetDimensions()

std::vector< long int > Cpp::GetDimensions ( ConstTypeRef  TyRef)

Definition at line 5136 of file CppInterOp.cpp.

References GetDimensions(), INTEROP_RETURN, and INTEROP_TRACE.

Referenced by GetDimensions().

◆ GetDoxygenComment()

std::string Cpp::GetDoxygenComment ( ConstDeclRef  DRef,
bool  strip_comment_markers 
)

Definition at line 984 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ GetEnumConstantDatamembers()

void Cpp::GetEnumConstantDatamembers ( ConstDeclRef  DRef,
std::vector< DeclRef > &  datamembers,
bool  include_enum_class 
)

Definition at line 2380 of file CppInterOp.cpp.

References INTEROP_OUT, INTEROP_TRACE, and INTEROP_VOID_RETURN.

◆ GetEnumConstants()

std::vector< DeclRef > Cpp::GetEnumConstants ( ConstDeclRef  DRef)

Definition at line 847 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ GetEnumConstantType()

TypeRef Cpp::GetEnumConstantType ( ConstDeclRef  DRef)

Definition at line 863 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ GetEnumConstantValue()

size_t Cpp::GetEnumConstantValue ( ConstDeclRef  DRef)

Definition at line 875 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ GetEnums()

void Cpp::GetEnums ( ConstDeclRef  DRef,
std::vector< std::string > &  Result 
)

Definition at line 5110 of file CppInterOp.cpp.

References GetEnums(), INTEROP_OUT, INTEROP_TRACE, and INTEROP_VOID_RETURN.

Referenced by GetEnums().

◆ GetFnTypeSignature()

void Cpp::GetFnTypeSignature ( ConstTypeRef  fn_type,
std::vector< TypeRef > &  sig 
)

Definition at line 1601 of file CppInterOp.cpp.

References INTEROP_OUT, INTEROP_TRACE, and INTEROP_VOID_RETURN.

◆ GetFunctionAddress() [1/3]

void * Cpp::GetFunctionAddress ( const char *  mangled_name)

◆ GetFunctionAddress() [2/3]

static void * Cpp::GetFunctionAddress ( const FunctionDecl *  FD)
static

Definition at line 1996 of file CppInterOp.cpp.

References getASTContext(), and GetFunctionAddress().

◆ GetFunctionAddress() [3/3]

void * Cpp::GetFunctionAddress ( FuncRef  method)

◆ GetFunctionArgDefault()

std::string Cpp::GetFunctionArgDefault ( ConstFuncRef  func,
size_t  param_index 
)

Definition at line 5173 of file CppInterOp.cpp.

References GetFunctionArgDefault(), getInterp(), INTEROP_RETURN, and INTEROP_TRACE.

Referenced by GetFunctionArgDefault().

◆ GetFunctionArgName()

std::string Cpp::GetFunctionArgName ( ConstFuncRef  func,
size_t  param_index 
)

Definition at line 5225 of file CppInterOp.cpp.

References GetFunctionArgName(), INTEROP_RETURN, and INTEROP_TRACE.

Referenced by GetFunctionArgName().

◆ GetFunctionArgType()

TypeRef Cpp::GetFunctionArgType ( ConstFuncRef  func,
size_t  iarg 
)

Definition at line 1637 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ GetFunctionNumArgs()

size_t Cpp::GetFunctionNumArgs ( ConstFuncRef  func)

Definition at line 1613 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ GetFunctionRequiredArgs()

size_t Cpp::GetFunctionRequiredArgs ( ConstFuncRef  func)

Definition at line 1625 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ GetFunctionReturnType()

TypeRef Cpp::GetFunctionReturnType ( ConstFuncRef  func)

◆ GetFunctionSignature()

std::string Cpp::GetFunctionSignature ( ConstFuncRef  func)

Definition at line 1660 of file CppInterOp.cpp.

References getASTContext(), INTEROP_RETURN, and INTEROP_TRACE.

◆ GetFunctionsUsingName()

std::vector< FuncRef > Cpp::GetFunctionsUsingName ( ConstDeclRef  DRef,
const std::string &  name 
)

◆ GetFunctionTemplatedDecls()

void Cpp::GetFunctionTemplatedDecls ( ConstDeclRef  DRef,
std::vector< FuncRef > &  methods 
)

Definition at line 1477 of file CppInterOp.cpp.

References INTEROP_OUT, INTEROP_TRACE, and INTEROP_VOID_RETURN.

◆ GetGlobalScope()

DeclRef Cpp::GetGlobalScope ( )

Definition at line 1022 of file CppInterOp.cpp.

References getASTContext(), getSema(), INTEROP_RETURN, and INTEROP_TRACE.

Referenced by GetScope().

◆ GetIncludePaths()

void Cpp::GetIncludePaths ( std::vector< std::string > &  IncludePaths,
bool  withSystem,
bool  withFlags 
)

◆ GetIntegerTypeFromEnumScope()

TypeRef Cpp::GetIntegerTypeFromEnumScope ( ConstDeclRef  DRef)

Definition at line 825 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ GetIntegerTypeFromEnumType()

TypeRef Cpp::GetIntegerTypeFromEnumType ( ConstTypeRef  enum_type)

Definition at line 835 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ getInterp()

static compat::Interpreter & Cpp::getInterp ( InterpRef  I = nullptr)
static

◆ getInterpInfo()

static InterpreterInfo & Cpp::getInterpInfo ( compat::Interpreter I = nullptr)
static

Definition at line 316 of file CppInterOp.cpp.

References GetInterpreters().

Referenced by getInterp().

◆ GetInterpreter()

InterpRef Cpp::GetInterpreter ( )

Definition at line 334 of file CppInterOp.cpp.

References GetInterpreters(), INTEROP_RETURN, and INTEROP_TRACE.

Referenced by Evaluate(), and LoadDispatchAPI().

◆ GetInterpreters()

static std::deque< InterpreterInfo > & Cpp::GetInterpreters ( bool  SetCrashHandler = true)
static

◆ GetLanguage()

InterpreterLanguage Cpp::GetLanguage ( InterpRef  I)

◆ GetLanguageStandard()

InterpreterLanguageStandard Cpp::GetLanguageStandard ( InterpRef  I)

◆ GetName()

std::string Cpp::GetName ( ConstDeclRef  DRef)

Definition at line 903 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

Referenced by LookupConstructors().

◆ GetNamed()

DeclRef Cpp::GetNamed ( const std::string &  name,
ConstDeclRef  parent 
)

◆ GetNonReferenceType()

TypeRef Cpp::GetNonReferenceType ( ConstTypeRef  TyRef)

Definition at line 2711 of file CppInterOp.cpp.

References INTEROP_RETURN, INTEROP_TRACE, and IsReferenceType().

◆ GetNumBases()

size_t Cpp::GetNumBases ( ConstDeclRef  DRef)

◆ GetOperator()

void Cpp::GetOperator ( ConstDeclRef  DRef,
Operator  op,
std::vector< FuncRef > &  operators,
OperatorArity  kind 
)

◆ GetOperatorArity()

OperatorArity Cpp::GetOperatorArity ( ConstFuncRef  op)

Definition at line 5255 of file CppInterOp.cpp.

References GetOperatorArity(), INTEROP_RETURN, and INTEROP_TRACE.

Referenced by GetOperator(), and GetOperatorArity().

◆ GetOperatorFromSpelling()

Operator Cpp::GetOperatorFromSpelling ( const std::string &  op)

Definition at line 5245 of file CppInterOp.cpp.

References GetOperatorFromSpelling(), INTEROP_RETURN, and INTEROP_TRACE.

Referenced by GetOperatorFromSpelling().

◆ GetParentScope()

DeclRef Cpp::GetParentScope ( ConstDeclRef  DRef)

Definition at line 1248 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ GetPointeeType()

TypeRef Cpp::GetPointeeType ( ConstTypeRef  TyRef)

Definition at line 2671 of file CppInterOp.cpp.

References INTEROP_RETURN, INTEROP_TRACE, and IsPointerType().

◆ GetPointerType()

TypeRef Cpp::GetPointerType ( ConstTypeRef  TyRef)

Definition at line 2695 of file CppInterOp.cpp.

References getASTContext(), INTEROP_RETURN, and INTEROP_TRACE.

◆ GetQualifiedCompleteName()

std::string Cpp::GetQualifiedCompleteName ( ConstDeclRef  DRef)

Definition at line 979 of file CppInterOp.cpp.

References GetCompleteNameImpl(), INTEROP_RETURN, and INTEROP_TRACE.

◆ GetQualifiedName()

std::string Cpp::GetQualifiedName ( ConstDeclRef  DRef)

Definition at line 965 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ GetRedirectionStack()

static std::stack< StreamCaptureInfo > & Cpp::GetRedirectionStack ( )
static

◆ GetReferencedType()

TypeRef Cpp::GetReferencedType ( ConstTypeRef  TyRef,
bool  rvalue 
)

Definition at line 2701 of file CppInterOp.cpp.

References getASTContext(), INTEROP_RETURN, and INTEROP_TRACE.

◆ GetResourceDir()

const char * Cpp::GetResourceDir ( )

Definition at line 4581 of file CppInterOp.cpp.

References getInterp(), INTEROP_RETURN, and INTEROP_TRACE.

◆ GetScope()

DeclRef Cpp::GetScope ( const std::string &  name,
ConstDeclRef  parent 
)

Definition at line 1070 of file CppInterOp.cpp.

References GetGlobalScope(), GetNamed(), INTEROP_RETURN, and INTEROP_TRACE.

Referenced by GetScopeFromCompleteName().

◆ GetScopeFromCompleteName()

DeclRef Cpp::GetScopeFromCompleteName ( const std::string &  name)

Definition at line 1092 of file CppInterOp.cpp.

References GetScope(), INTEROP_RETURN, and INTEROP_TRACE.

◆ GetScopeFromType() [1/2]

DeclRef Cpp::GetScopeFromType ( ConstTypeRef  TyRef)

Definition at line 1041 of file CppInterOp.cpp.

References GetScopeFromType(), INTEROP_RETURN, and INTEROP_TRACE.

◆ GetScopeFromType() [2/2]

static Decl * Cpp::GetScopeFromType ( QualType  QT)
static

◆ getSema()

static clang::Sema & Cpp::getSema ( )
static

◆ GetSizeOfType()

size_t Cpp::GetSizeOfType ( ConstTypeRef  TyRef)

Definition at line 885 of file CppInterOp.cpp.

References getSema(), INTEROP_RETURN, INTEROP_TRACE, and SizeOf().

◆ GetSpellingFromOperator()

std::string Cpp::GetSpellingFromOperator ( Operator  Operator)

Definition at line 5239 of file CppInterOp.cpp.

References GetSpellingFromOperator(), INTEROP_RETURN, and INTEROP_TRACE.

Referenced by GetSpellingFromOperator().

◆ GetStaticDatamembers()

void Cpp::GetStaticDatamembers ( ConstDeclRef  DRef,
std::vector< DeclRef > &  datamembers 
)

Definition at line 2373 of file CppInterOp.cpp.

References INTEROP_OUT, INTEROP_TRACE, and INTEROP_VOID_RETURN.

◆ GetType()

TypeRef Cpp::GetType ( const std::string &  name,
ConstDeclRef  parent 
)

◆ GetTypeAsString()

std::string Cpp::GetTypeAsString ( ConstTypeRef  var)

Definition at line 2740 of file CppInterOp.cpp.

References getASTContext(), INTEROP_RETURN, and INTEROP_TRACE.

Referenced by IsSmartPtrType().

◆ GetTypeFromScope()

TypeRef Cpp::GetTypeFromScope ( ConstDeclRef  DRef)

Definition at line 2957 of file CppInterOp.cpp.

References GetTypeInternal(), INTEROP_RETURN, and INTEROP_TRACE.

Referenced by GetType(), IsComplete(), and IsSubclass().

◆ GetTypeInternal()

static std::optional< QualType > Cpp::GetTypeInternal ( const Decl *  D)
static

Definition at line 2920 of file CppInterOp.cpp.

References getASTContext().

Referenced by GetTypeFromScope().

◆ GetUnderlyingScope()

DeclRef Cpp::GetUnderlyingScope ( ConstDeclRef  DRef)

◆ GetUnderlyingScopeImpl()

static const clang::Decl * Cpp::GetUnderlyingScopeImpl ( const clang::Decl *  D)
static

Definition at line 1047 of file CppInterOp.cpp.

References GetScopeFromType().

Referenced by GetUnderlyingScope().

◆ GetUnderlyingType()

TypeRef Cpp::GetUnderlyingType ( ConstTypeRef  TyRef)

Definition at line 2719 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ GetUsingNamespaces()

std::vector< DeclRef > Cpp::GetUsingNamespaces ( ConstDeclRef  DRef)

Definition at line 1007 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ GetValidSLoc()

static SourceLocation Cpp::GetValidSLoc ( Sema &  semaRef)
static

Definition at line 659 of file CppInterOp.cpp.

Referenced by InstantiateTemplate(), IsComplete(), and IsTypeDerivedFrom().

◆ GetValueKind()

ValueKind Cpp::GetValueKind ( ConstTypeRef  TyRef)

Definition at line 2685 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ GetVariableOffset() [1/2]

intptr_t Cpp::GetVariableOffset ( compat::Interpreter I,
Decl *  D,
CXXRecordDecl *  BaseCXXRD 
)

◆ GetVariableOffset() [2/2]

intptr_t Cpp::GetVariableOffset ( ConstDeclRef  var,
ConstDeclRef  parent 
)

Definition at line 2558 of file CppInterOp.cpp.

References getInterp(), GetVariableOffset(), INTEROP_RETURN, and INTEROP_TRACE.

◆ GetVariableType()

TypeRef Cpp::GetVariableType ( ConstDeclRef  var)

Definition at line 2426 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ GetVersion()

std::string Cpp::GetVersion ( )

◆ hasComplexVTableLayout()

static bool Cpp::hasComplexVTableLayout ( const CXXRecordDecl *  RD)
static

Definition at line 2097 of file CppInterOp.cpp.

Referenced by MakeVTableOverlay().

◆ HasDefaultConstructor()

bool Cpp::HasDefaultConstructor ( ConstDeclRef  DRef)

Definition at line 1484 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

Referenced by Construct(), and GetDefaultConstructor().

◆ HasTypeQualifier()

bool Cpp::HasTypeQualifier ( ConstTypeRef  TyRef,
QualKind  qual 
)

Definition at line 2759 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ InsertOrReplaceJitSymbol() [1/2]

bool Cpp::InsertOrReplaceJitSymbol ( compat::Interpreter I,
const char *  linker_mangled_name,
uint64_t  address 
)

Definition at line 4816 of file CppInterOp.cpp.

References compat::getExecutionEngine(), and compat::getSymbolAddress().

Referenced by InsertOrReplaceJitSymbol().

◆ InsertOrReplaceJitSymbol() [2/2]

bool Cpp::InsertOrReplaceJitSymbol ( const char *  linker_mangled_name,
uint64_t  address 
)

◆ InstantiateFunctionDefinition()

static void Cpp::InstantiateFunctionDefinition ( Decl *  D)
static

Definition at line 594 of file CppInterOp.cpp.

References getInterp(), and getSema().

Referenced by GetFunctionAddress(), GetFunctionReturnType(), and InstantiateTemplate().

◆ InstantiateTemplate() [1/5]

DeclRef Cpp::InstantiateTemplate ( compat::Interpreter I,
DeclRef  tmpl,
const TemplateArgInfo template_args,
size_t  template_args_size,
bool  instantiate_body 
)

◆ InstantiateTemplate() [2/5]

DeclRef Cpp::InstantiateTemplate ( DeclRef  tmpl,
const std::vector< TemplateArgInfo > &  template_args,
bool  instantiate_body 
)

Definition at line 5014 of file CppInterOp.cpp.

References getInterp(), InstantiateTemplate(), INTEROP_RETURN, and INTEROP_TRACE.

◆ InstantiateTemplate() [3/5]

DeclRef Cpp::InstantiateTemplate ( DeclRef  tmpl,
const TemplateArgInfo template_args,
size_t  template_args_size,
bool  instantiate_body 
)

Definition at line 5007 of file CppInterOp.cpp.

References getInterp(), InstantiateTemplate(), INTEROP_RETURN, and INTEROP_TRACE.

◆ InstantiateTemplate() [4/5]

Decl * Cpp::InstantiateTemplate ( TemplateDecl *  TemplateD,
ArrayRef< TemplateArgument >  TemplateArgs,
Sema &  S,
bool  instantiate_body 
)

Definition at line 4968 of file CppInterOp.cpp.

References InstantiateTemplate().

◆ InstantiateTemplate() [5/5]

static Decl * Cpp::InstantiateTemplate ( TemplateDecl *  TemplateD,
TemplateArgumentListInfo &  TLI,
Sema &  S,
bool  instantiate_body 
)
static

◆ InstantiateTemplateFunctionFromString()

FuncRef Cpp::InstantiateTemplateFunctionFromString ( const char *  function_template)

◆ IsAbstract()

bool Cpp::IsAbstract ( ConstDeclRef  DRef)

Definition at line 740 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsAggregate()

bool Cpp::IsAggregate ( ConstDeclRef  DRef)

Definition at line 610 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsBuiltin()

bool Cpp::IsBuiltin ( ConstTypeRef  TyRef)

Definition at line 704 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsClass()

bool Cpp::IsClass ( ConstDeclRef  DRef)

Definition at line 632 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

Referenced by Construct().

◆ IsClassPolymorphic()

bool Cpp::IsClassPolymorphic ( ConstDeclRef  DRef)

Definition at line 650 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsComplete()

bool Cpp::IsComplete ( ConstDeclRef  DRef)

Definition at line 665 of file CppInterOp.cpp.

References getInterp(), getSema(), GetTypeFromScope(), GetValidSLoc(), INTEROP_RETURN, and INTEROP_TRACE.

Referenced by SizeOf().

◆ IsConstMethod()

bool Cpp::IsConstMethod ( ConstFuncRef  method)

Definition at line 5213 of file CppInterOp.cpp.

References INTEROP_RETURN, INTEROP_TRACE, and IsConstMethod().

Referenced by IsConstMethod().

◆ IsConstructor()

bool Cpp::IsConstructor ( ConstFuncRef  method)

Definition at line 1935 of file CppInterOp.cpp.

References INTEROP_RETURN, INTEROP_TRACE, and IsConstructor().

Referenced by Construct(), and IsConstructor().

◆ IsConstVariable()

bool Cpp::IsConstVariable ( ConstDeclRef  var)

Definition at line 2599 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsDebugOutputEnabled()

bool Cpp::IsDebugOutputEnabled ( )

Definition at line 589 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsDestructor()

bool Cpp::IsDestructor ( ConstFuncRef  method)

Definition at line 1943 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsEnumConstant()

bool Cpp::IsEnumConstant ( ConstDeclRef  DRef)

Definition at line 755 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsEnumScope()

bool Cpp::IsEnumScope ( ConstDeclRef  DRef)

Definition at line 749 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsEnumType()

bool Cpp::IsEnumType ( ConstTypeRef  TyRef)

Definition at line 761 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsExplicit()

bool Cpp::IsExplicit ( ConstFuncRef  method)

Definition at line 1962 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsFloatingType()

bool Cpp::IsFloatingType ( ConstTypeRef  TyRef)

Definition at line 2640 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsFunction()

bool Cpp::IsFunction ( ConstDeclRef  DRef)

Definition at line 638 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsFunctionDeleted()

bool Cpp::IsFunctionDeleted ( ConstFuncRef  function)

Definition at line 1708 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsFunctionPointerType()

bool Cpp::IsFunctionPointerType ( ConstTypeRef  TyRef)

Definition at line 644 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsFunctionProtoType()

bool Cpp::IsFunctionProtoType ( ConstTypeRef  TyRef)

Definition at line 1594 of file CppInterOp.cpp.

References INTEROP_TRACE.

◆ IsIntegerType()

bool Cpp::IsIntegerType ( ConstTypeRef  TyRef,
Signedness *  s 
)

Definition at line 2626 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsLambdaClass()

bool Cpp::IsLambdaClass ( ConstTypeRef  TyRef)

Definition at line 2417 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsMethod()

bool Cpp::IsMethod ( ConstFuncRef  method)

Definition at line 1911 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsNamespace()

bool Cpp::IsNamespace ( ConstDeclRef  DRef)

Definition at line 626 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsPODType()

bool Cpp::IsPODType ( ConstTypeRef  TyRef)

Definition at line 2616 of file CppInterOp.cpp.

References getASTContext(), INTEROP_RETURN, and INTEROP_TRACE.

◆ IsPointerType()

bool Cpp::IsPointerType ( ConstTypeRef  TyRef)

Definition at line 2657 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

Referenced by GetPointeeType().

◆ IsPrivateMethod()

bool Cpp::IsPrivateMethod ( ConstFuncRef  method)

Definition at line 1930 of file CppInterOp.cpp.

References CheckMethodAccess(), INTEROP_RETURN, and INTEROP_TRACE.

◆ IsPrivateVariable()

bool Cpp::IsPrivateVariable ( ConstDeclRef  var)

Definition at line 2584 of file CppInterOp.cpp.

References CheckVariableAccess(), INTEROP_RETURN, and INTEROP_TRACE.

◆ IsProtectedMethod()

bool Cpp::IsProtectedMethod ( ConstFuncRef  method)

Definition at line 1924 of file CppInterOp.cpp.

References CheckMethodAccess(), INTEROP_RETURN, and INTEROP_TRACE.

◆ IsProtectedVariable()

bool Cpp::IsProtectedVariable ( ConstDeclRef  var)

Definition at line 2578 of file CppInterOp.cpp.

References CheckVariableAccess(), INTEROP_RETURN, and INTEROP_TRACE.

◆ IsPublicMethod()

bool Cpp::IsPublicMethod ( ConstFuncRef  method)

Definition at line 1919 of file CppInterOp.cpp.

References CheckMethodAccess(), INTEROP_RETURN, and INTEROP_TRACE.

◆ IsPublicVariable()

bool Cpp::IsPublicVariable ( ConstDeclRef  var)

Definition at line 2573 of file CppInterOp.cpp.

References CheckVariableAccess(), INTEROP_RETURN, and INTEROP_TRACE.

◆ IsRecordType()

bool Cpp::IsRecordType ( ConstTypeRef  TyRef)

Definition at line 2610 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsReferenceType()

bool Cpp::IsReferenceType ( ConstTypeRef  TyRef)

Definition at line 2679 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

Referenced by GetNonReferenceType().

◆ IsSameType()

bool Cpp::IsSameType ( ConstTypeRef  type_a,
ConstTypeRef  type_b 
)

Definition at line 2648 of file CppInterOp.cpp.

References getASTContext(), INTEROP_RETURN, and INTEROP_TRACE.

◆ isSmartPointer()

static bool Cpp::isSmartPointer ( const RecordType *  RT)
static

Definition at line 767 of file CppInterOp.cpp.

Referenced by IsSmartPtrType().

◆ IsSmartPtrType()

bool Cpp::IsSmartPtrType ( ConstTypeRef  TyRef)

Definition at line 809 of file CppInterOp.cpp.

References GetTypeAsString(), INTEROP_RETURN, INTEROP_TRACE, and isSmartPointer().

◆ IsStaticMethod()

bool Cpp::IsStaticMethod ( ConstFuncRef  method)

Definition at line 1949 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsStaticVariable()

bool Cpp::IsStaticVariable ( ConstDeclRef  var)

Definition at line 2589 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsSubclass()

bool Cpp::IsSubclass ( ConstDeclRef  derived,
ConstDeclRef  base 
)

◆ IsTemplate()

bool Cpp::IsTemplate ( ConstDeclRef  DRef)

Definition at line 721 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsTemplatedFunction()

bool Cpp::IsTemplatedFunction ( ConstFuncRef  func)

◆ IsTemplateParmType()

bool Cpp::IsTemplateParmType ( ConstTypeRef  TyRef)

Definition at line 1654 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsTemplateSpecialization()

bool Cpp::IsTemplateSpecialization ( ConstDeclRef  DRef)

Definition at line 727 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

Referenced by GetFunctionReturnType().

◆ IsTypedefed()

bool Cpp::IsTypedefed ( ConstDeclRef  DRef)

Definition at line 734 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsTypeDerivedFrom()

bool Cpp::IsTypeDerivedFrom ( ConstTypeRef  derived,
ConstTypeRef  base 
)

◆ IsVariable()

bool Cpp::IsVariable ( ConstDeclRef  DRef)

Definition at line 897 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsVirtualMethod()

bool Cpp::IsVirtualMethod ( ConstFuncRef  method)

Definition at line 2038 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsVoidPointerType()

bool Cpp::IsVoidPointerType ( ConstTypeRef  TyRef)

Definition at line 2663 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ LoadDispatchAPI()

bool Cpp::LoadDispatchAPI ( const char *  customLibPath = nullptr)
inline

Initialize all CppInterOp API from the dynamically loaded library.

Definition at line 129 of file Dispatch.h.

References CreateInterpreter(), dlGetProcAddress(), and GetInterpreter().

◆ LoadLibrary()

bool Cpp::LoadLibrary ( const char *  lib_stem,
bool  lookup 
)

◆ LookupConstructors()

void Cpp::LookupConstructors ( const std::string &  name,
ConstDeclRef  parent,
std::vector< FuncRef > &  funcs 
)

Definition at line 1746 of file CppInterOp.cpp.

References GetName(), getSema(), INTEROP_OUT, INTEROP_TRACE, and INTEROP_VOID_RETURN.

Referenced by GetClassTemplatedMethods().

◆ LookupDatamember()

DeclRef Cpp::LookupDatamember ( const std::string &  name,
ConstDeclRef  parent 
)

◆ LookupLibrary()

std::string Cpp::LookupLibrary ( const char *  lib_name)

Definition at line 4788 of file CppInterOp.cpp.

References getInterp(), INTEROP_RETURN, and INTEROP_TRACE.

◆ MakeFunctionCallable() [1/2]

JitCall Cpp::MakeFunctionCallable ( ConstFuncRef  func)

Definition at line 4293 of file CppInterOp.cpp.

References getInterp(), INTEROP_RETURN, INTEROP_TRACE, and MakeFunctionCallable().

◆ MakeFunctionCallable() [2/2]

JitCall Cpp::MakeFunctionCallable ( InterpRef  I,
ConstFuncRef  func 
)

Definition at line 4260 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

Referenced by Construct(), and MakeFunctionCallable().

◆ MakeUniqueVTableOverlay()

UniqueVTableOverlay Cpp::MakeUniqueVTableOverlay ( void *  inst,
DeclRef  base,
std::initializer_list< std::pair< ConstFuncRef, void * > >  overrides,
std::size_t  n_extra_prefix_slots = 0,
VTableOverlayDtorHook  on_destroy = nullptr,
void *  cleanup_data = nullptr 
)
inline

Owning wrapper over MakeVTableOverlay: each pair maps a virtual method of polymorphic class base to its replacement function pointer.

The overlay is installed on construction and the original vptr restored when the handle is destroyed. The caller works in reflected methods, not ABI-specific slot indices – the common path for language bindings. n_extra_prefix_slots reserves nullptr-initialized slots immediately before the ABI prefix for the caller to write per-instance data into. on_destroy, when non-null, is invoked once after the C++ destructor of inst runs (operator-delete path). It receives the original inst pointer (which may be dangling at that point – do not deref) and cleanup_data verbatim; bindings use it to release any per-instance state (Python handles, closures) tied to the object's lifetime. The callback must not throw: it runs inside a C++ destructor, so an escaping exception is undefined behavior.

Definition at line 86 of file CppInterOp.h.

References MakeVTableOverlay().

◆ MakeVTableOverlay()

VTableOverlay * Cpp::MakeVTableOverlay ( void *  inst,
ConstDeclRef  base,
const ConstFuncRef *  methods,
void *const *  overlay_fns,
std::size_t  n_overlays,
std::size_t  n_extra_prefix_slots,
VTableOverlayDtorHook  on_destroy,
void *  cleanup_data 
)

◆ ObjToString()

std::string Cpp::ObjToString ( const char *  TyRef,
void *  obj 
)

Definition at line 4902 of file CppInterOp.cpp.

References getInterp(), INTEROP_RETURN, and INTEROP_TRACE.

◆ PopulateBuiltinMap()

static void Cpp::PopulateBuiltinMap ( ASTContext &  Context)
static

Definition at line 2831 of file CppInterOp.cpp.

References ACCESS, GetInterpreters(), and RegisterPerms().

Referenced by findBuiltinType().

◆ Process()

int Cpp::Process ( const char *  code)

Definition at line 4702 of file CppInterOp.cpp.

References getInterp(), INTEROP_RETURN, and INTEROP_TRACE.

◆ RegisterInterpreter()

static void Cpp::RegisterInterpreter ( compat::Interpreter I,
bool  Owned 
)
static

Definition at line 311 of file CppInterOp.cpp.

References GetInterpreters().

Referenced by CreateInterpreter(), and UseExternalInterpreter().

◆ RegisterPerms()

static void Cpp::RegisterPerms ( llvm::StringMap< QualType > &  Map,
QualType  QT,
llvm::SmallVectorImpl< llvm::StringRef > &  Words 
)
static

Definition at line 2817 of file CppInterOp.cpp.

Referenced by PopulateBuiltinMap().

◆ RemoveTypeQualifier()

TypeRef Cpp::RemoveTypeQualifier ( ConstTypeRef  TyRef,
QualKind  qual 
)

Definition at line 2780 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ ResultAbort_UncheckedOnDtor()

void Cpp::ResultAbort_UncheckedOnDtor ( const ErrorRef &  )

Definition at line 38 of file ErrorInternal.cpp.

◆ ResultAbort_ValueOnError()

void Cpp::ResultAbort_ValueOnError ( const ErrorRef &  )

Definition at line 28 of file ErrorInternal.cpp.

◆ SearchLibrariesForSymbol()

std::string Cpp::SearchLibrariesForSymbol ( const char *  mangled_name,
bool  search_system 
)

◆ SizeOf()

size_t Cpp::SizeOf ( ConstDeclRef  DRef)

Definition at line 689 of file CppInterOp.cpp.

References INTEROP_RETURN, INTEROP_TRACE, and IsComplete().

Referenced by Allocate(), Deallocate(), and GetSizeOfType().

◆ Undo()

int Cpp::Undo ( unsigned  N)

◆ UnloadDispatchAPI()

void Cpp::UnloadDispatchAPI ( )
inline

Definition at line 158 of file Dispatch.h.

References dlGetProcAddress().

◆ UnloadLibrary()

void Cpp::UnloadLibrary ( const char *  lib_stem)

◆ unwrap() [1/8]

template<typename T >
const T * Cpp::unwrap ( ConstDeclRef  H)

Definition at line 45 of file Unwrap.h.

◆ unwrap() [2/8]

template<typename T >
const T * Cpp::unwrap ( ConstFuncRef  H)

Definition at line 51 of file Unwrap.h.

◆ unwrap() [3/8]

template<typename T >
const T * Cpp::unwrap ( ConstTypeRef  H)

Definition at line 48 of file Unwrap.h.

◆ unwrap() [4/8]

template<typename T >
T * Cpp::unwrap ( DeclRef  H)

Definition at line 38 of file Unwrap.h.

◆ unwrap() [5/8]

template<typename T >
T * Cpp::unwrap ( FuncRef  H)

Definition at line 40 of file Unwrap.h.

◆ unwrap() [6/8]

template<typename T >
T * Cpp::unwrap ( InterpRef  H)

Definition at line 42 of file Unwrap.h.

◆ unwrap() [7/8]

template<typename T >
T * Cpp::unwrap ( ObjectRef  H)

Definition at line 41 of file Unwrap.h.

◆ unwrap() [8/8]

template<typename T >
T * Cpp::unwrap ( TypeRef  H)

Definition at line 39 of file Unwrap.h.

◆ UseExternalInterpreter()

void Cpp::UseExternalInterpreter ( InterpRef  I)

◆ virtualMethodSlot()

static int Cpp::virtualMethodSlot ( ConstFuncRef  method)
static

Definition at line 2052 of file CppInterOp.cpp.

References getASTContext().

Referenced by MakeVTableOverlay().

◆ vtableMethodSlotCount()

static int Cpp::vtableMethodSlotCount ( ConstDeclRef  DRef)
static

Definition at line 2069 of file CppInterOp.cpp.

References getASTContext().

Referenced by MakeVTableOverlay().

◆ VTableOverlayExtraSlot()

void *& Cpp::VTableOverlayExtraSlot ( void *  inst,
std::size_t  i 
)
inline

Address of the i-th extra-prefix slot of an instance with an overlay installed via MakeVTableOverlay(..., n_extra_prefix_slots = N, ...).

Returns a void*& so callers read and write through the same expression; this is the canonical access path – bindings should not synthesize the vptr arithmetic themselves. Behavior is undefined if inst has no overlay or i >= N.

Definition at line 61 of file CppInterOp.h.

References Cpp::detail::kVTableOverlayPrefixSize.

◆ wrap() [1/2]

template<typename Handle >
Handle Cpp::wrap ( const void *  P)

Definition at line 35 of file Unwrap.h.

◆ wrap() [2/2]

template<typename Handle >
Handle Cpp::wrap ( void *  P)

Definition at line 32 of file Unwrap.h.

Variable Documentation

◆ kABIPrefixSize

constexpr int Cpp::kABIPrefixSize = 2
constexpr

Definition at line 2118 of file CppInterOp.cpp.

Referenced by applyVTableOverlay().

◆ kDeletingDtorSlot

constexpr int Cpp::kDeletingDtorSlot = 1
constexpr

Definition at line 2266 of file CppInterOp.cpp.

Referenced by MakeVTableOverlay().

◆ kMinVTableMethodSlots

constexpr int Cpp::kMinVTableMethodSlots = 2
constexpr

Definition at line 2214 of file CppInterOp.cpp.

Referenced by applyVTableOverlay(), and MakeVTableOverlay().

◆ SkipShutDown

bool Cpp::SkipShutDown = false
static

Set by UseExternalInterpreter to suppress llvm_shutdown at process exit – the client owns LLVM in that case.

Definition at line 214 of file CppInterOp.cpp.

Referenced by UseExternalInterpreter(), and Cpp::InterpreterShutdown::~InterpreterShutdown().