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  ErrorSlice
 Body of a slice-encoded error: drained diagnostics, producer attribution, refcount. More...
 
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  StatusError
 
struct  StoredDiagView
 Owning record for one captured diagnostic. More...
 
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)
 
InterpreterInfoGetInterpInfo (InterpRef I=nullptr)
 Resolve an InterpRef to the impl-side struct.
 
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)
 
static DeclarationName getCXXOperatorDeclName (ASTContext &Ctx, llvm::StringRef name)
 
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)
 
static const StoredDiagViewAsView (DiagnosticRef D)
 
DiagnosticSeverity GetDiagnosticSeverity (DiagnosticRef D)
 
const char * GetDiagnosticMessage (DiagnosticRef D)
 
const char * GetDiagnosticFile (DiagnosticRef D)
 
unsigned GetDiagnosticLine (DiagnosticRef D)
 
unsigned GetDiagnosticColumn (DiagnosticRef D)
 
Status GetStatus (ErrorRef E)
 
ArrayView< DiagnosticRef > GetDiagnostics (ErrorRef E)
 
void RetainErrorRef (ErrorRef E)
 
void ReleaseErrorRef (ErrorRef E)
 
ErrorSliceAllocSlice (InterpreterInfo *Owner)
 Allocate a fresh slice on the heap, refcount 0.
 
ErrorRef makeError (Status S)
 Build an inline-status ErrorRef (no diagnostics, no payload).
 
ErrorRef makeError (InterpreterInfo *II, Status S, std::string Message, const char *Producer, const char *ProducerSig)
 Build a slice-encoded error carrying a Clang-derived message + the interp's pending diagnostics + producer attribution.
 
ErrorRef drainError (InterpreterInfo *II, llvm::Error E, const char *Producer, const char *ProducerSig)
 Drain E into a fresh slice, returning the slice via ErrorRef.
 
void InstallDiagConsumer (InterpreterInfo *II)
 Wire CppInterOp's DiagnosticConsumer into the interpreter's DiagnosticsEngine so parser/sema diagnostics flow into II->StoredDiags and continue forwarding to whatever consumer Clang already had.
 
void DrainPendingInto (InterpreterInfo *II, ErrorSlice *S)
 Drain the consumer's per-interp buffer into a slice on failure.
 
void ClearPending (InterpreterInfo *II)
 
unsigned GetPendingDiagnosticCount (InterpRef I)
 
DiagnosticRef GetPendingDiagnostic (unsigned Idx, InterpRef I)
 
void ClearPendingDiagnostics (InterpRef I)
 
void ResultAbort_ValueOnError (const ErrorRef &)
 
void ResultAbort_UncheckedOnDtor (const ErrorRef &)
 
template<typename T >
Result< T > makeResult (InterpreterInfo *II, llvm::Expected< T > E, const char *Producer, const char *ProducerSig)
 Convert llvm::Expected<T> into Result<T>.
 
Result< void > makeResult (InterpreterInfo *II, llvm::Error E, const char *Producer, const char *ProducerSig)
 
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 315 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 2806 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ Allocate()

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

Definition at line 5340 of file CppInterOp.cpp.

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

Referenced by Allocate().

◆ AllocSlice()

ErrorSlice * Cpp::AllocSlice ( InterpreterInfo Owner)

Allocate a fresh slice on the heap, refcount 0.

Caller bumps the refcount on first use (the boundary translator does this when wrapping the slice into a returned ErrorRef).

Definition at line 165 of file ErrorInternal.cpp.

References AllocSlice().

Referenced by AllocSlice(), drainError(), and makeError().

◆ 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

◆ AsView()

static const StoredDiagView * Cpp::AsView ( DiagnosticRef  D)
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 
)

◆ CheckMethodAccess()

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

Definition at line 1913 of file CppInterOp.cpp.

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

◆ CheckVariableAccess()

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

Definition at line 2579 of file CppInterOp.cpp.

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

◆ classifyByQualType()

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

◆ ClearPending()

void Cpp::ClearPending ( InterpreterInfo II)

Definition at line 330 of file ErrorInternal.cpp.

References ClearPending().

Referenced by ClearPending().

◆ ClearPendingDiagnostics()

void Cpp::ClearPendingDiagnostics ( InterpRef  I)

◆ 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 1293 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 5380 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 463 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 442 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 487 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 5345 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 4725 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 335 of file CppInterOp.cpp.

References GetInterpreters(), INTEROP_RETURN, and INTEROP_TRACE.

◆ Demangle()

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

Definition at line 533 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ DestroyVTableOverlay()

void Cpp::DestroyVTableOverlay ( VTableOverlay overlay)

Definition at line 2335 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 5386 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 5396 of file CppInterOp.cpp.

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

◆ DetectResourceDir()

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

Definition at line 4644 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 4662 of file CppInterOp.cpp.

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

◆ drainError()

ErrorRef Cpp::drainError ( InterpreterInfo II,
llvm::Error  E,
const char *  Producer,
const char *  ProducerSig 
)

Drain E into a fresh slice, returning the slice via ErrorRef.

Handles StatusError; any other llvm::Error is stringified via llvm::ErrorInfoBase::log into the slice's first diagnostic.

Definition at line 192 of file ErrorInternal.cpp.

References AllocSlice(), Cpp::StatusError::Code, drainError(), DrainPendingInto(), Cpp::StoredDiagView::Message, Cpp::StatusError::Message, and Cpp::StoredDiagView::Sev.

Referenced by drainError(), makeResult(), and makeResult().

◆ DrainPendingInto()

void Cpp::DrainPendingInto ( InterpreterInfo II,
ErrorSlice S 
)

Drain the consumer's per-interp buffer into a slice on failure.

Success paths just clear via ClearPending – callers don't surface Ok-path warnings today.

Definition at line 324 of file ErrorInternal.cpp.

References DrainPendingInto().

Referenced by drainError(), DrainPendingInto(), and makeError().

◆ DumpScope()

void Cpp::DumpScope ( ConstDeclRef  DRef)

Definition at line 1481 of file CppInterOp.cpp.

References INTEROP_TRACE, and INTEROP_VOID_RETURN.

◆ EnableDebugOutput()

void Cpp::EnableDebugOutput ( bool  value)

Definition at line 548 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 4616 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 2919 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 5108 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 1253 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 520 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

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

◆ GetCanonicalType()

TypeRef Cpp::GetCanonicalType ( ConstTypeRef  TyRef)

Definition at line 2762 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 1374 of file CppInterOp.cpp.

References getInterp(), GetScopeFromType(), getSema(), and compat::GetTypeFromDecl().

◆ GetClassMethods()

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

Definition at line 1431 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 5053 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 5064 of file CppInterOp.cpp.

References INTEROP_OUT, and INTEROP_TRACE.

◆ GetCompleteName()

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

Definition at line 925 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 883 of file CppInterOp.cpp.

References getSema(), and compat::GetTypeFromDecl().

Referenced by GetCompleteName(), and GetQualifiedCompleteName().

◆ GetComplexType()

TypeRef Cpp::GetComplexType ( ConstTypeRef  TyRef)

Definition at line 2957 of file CppInterOp.cpp.

References getASTContext(), INTEROP_RETURN, and INTEROP_TRACE.

◆ getCXXOperatorDeclName()

static DeclarationName Cpp::getCXXOperatorDeclName ( ASTContext &  Ctx,
llvm::StringRef  name 
)
static

Definition at line 1493 of file CppInterOp.cpp.

Referenced by GetFunctionsUsingName().

◆ GetDatamembers()

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

Definition at line 2341 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 1463 of file CppInterOp.cpp.

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

◆ GetDestructor()

FuncRef Cpp::GetDestructor ( ConstDeclRef  DRef)

Definition at line 1468 of file CppInterOp.cpp.

References getSema(), INTEROP_RETURN, and INTEROP_TRACE.

◆ GetDiagnosticColumn()

unsigned Cpp::GetDiagnosticColumn ( DiagnosticRef  D)

Definition at line 62 of file ErrorInternal.cpp.

References AsView().

◆ GetDiagnosticFile()

const char * Cpp::GetDiagnosticFile ( DiagnosticRef  D)

Definition at line 50 of file ErrorInternal.cpp.

References AsView().

◆ GetDiagnosticLine()

unsigned Cpp::GetDiagnosticLine ( DiagnosticRef  D)

Definition at line 56 of file ErrorInternal.cpp.

References AsView().

◆ GetDiagnosticMessage()

const char * Cpp::GetDiagnosticMessage ( DiagnosticRef  D)

Definition at line 44 of file ErrorInternal.cpp.

References AsView().

◆ GetDiagnostics()

ArrayView< DiagnosticRef > Cpp::GetDiagnostics ( ErrorRef  E)

Definition at line 89 of file ErrorInternal.cpp.

◆ GetDiagnosticSeverity()

DiagnosticSeverity Cpp::GetDiagnosticSeverity ( DiagnosticRef  D)

Definition at line 38 of file ErrorInternal.cpp.

References AsView(), and Cpp::StoredDiagView::Sev.

◆ GetDimensions()

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

Definition at line 5164 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 949 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 2391 of file CppInterOp.cpp.

References INTEROP_OUT, INTEROP_TRACE, and INTEROP_VOID_RETURN.

◆ GetEnumConstants()

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

Definition at line 812 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ GetEnumConstantType()

TypeRef Cpp::GetEnumConstantType ( ConstDeclRef  DRef)

Definition at line 828 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ GetEnumConstantValue()

size_t Cpp::GetEnumConstantValue ( ConstDeclRef  DRef)

Definition at line 840 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ GetEnums()

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

Definition at line 5138 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 1588 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 2007 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 5201 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 5253 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 1630 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ GetFunctionNumArgs()

size_t Cpp::GetFunctionNumArgs ( ConstFuncRef  func)

Definition at line 1605 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ GetFunctionRequiredArgs()

size_t Cpp::GetFunctionRequiredArgs ( ConstFuncRef  func)

Definition at line 1617 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 1653 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 1437 of file CppInterOp.cpp.

References INTEROP_OUT, INTEROP_TRACE, and INTEROP_VOID_RETURN.

◆ GetGlobalScope()

DeclRef Cpp::GetGlobalScope ( )

Definition at line 987 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 790 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ GetIntegerTypeFromEnumType()

TypeRef Cpp::GetIntegerTypeFromEnumType ( ConstTypeRef  enum_type)

Definition at line 800 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 277 of file CppInterOp.cpp.

References GetInterpreters().

Referenced by getInterp(), and GetInterpInfo().

◆ GetInterpInfo()

InterpreterInfo * Cpp::GetInterpInfo ( InterpRef  I = nullptr)

Resolve an InterpRef to the impl-side struct.

When I is null, returns the active (last-created) interpreter.

Definition at line 295 of file CppInterOp.cpp.

References getInterpInfo().

Referenced by ClearPendingDiagnostics(), GetPendingDiagnostic(), and GetPendingDiagnosticCount().

◆ GetInterpreter()

InterpRef Cpp::GetInterpreter ( )

Definition at line 299 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 868 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 2722 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 5283 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 5273 of file CppInterOp.cpp.

References GetOperatorFromSpelling(), INTEROP_RETURN, and INTEROP_TRACE.

Referenced by GetOperatorFromSpelling().

◆ GetParentScope()

DeclRef Cpp::GetParentScope ( ConstDeclRef  DRef)

Definition at line 1213 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ GetPendingDiagnostic()

DiagnosticRef Cpp::GetPendingDiagnostic ( unsigned  Idx,
InterpRef  I 
)

Definition at line 338 of file ErrorInternal.cpp.

References GetInterpInfo(), and GetPendingDiagnostic().

Referenced by GetPendingDiagnostic().

◆ GetPendingDiagnosticCount()

unsigned Cpp::GetPendingDiagnosticCount ( InterpRef  I)

◆ GetPointeeType()

TypeRef Cpp::GetPointeeType ( ConstTypeRef  TyRef)

Definition at line 2682 of file CppInterOp.cpp.

References INTEROP_RETURN, INTEROP_TRACE, and IsPointerType().

◆ GetPointerType()

TypeRef Cpp::GetPointerType ( ConstTypeRef  TyRef)

Definition at line 2706 of file CppInterOp.cpp.

References getASTContext(), INTEROP_RETURN, and INTEROP_TRACE.

◆ GetQualifiedCompleteName()

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

Definition at line 944 of file CppInterOp.cpp.

References GetCompleteNameImpl(), INTEROP_RETURN, and INTEROP_TRACE.

◆ GetQualifiedName()

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

Definition at line 930 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 2712 of file CppInterOp.cpp.

References getASTContext(), INTEROP_RETURN, and INTEROP_TRACE.

◆ GetResourceDir()

const char * Cpp::GetResourceDir ( )

Definition at line 4609 of file CppInterOp.cpp.

References getInterp(), INTEROP_RETURN, and INTEROP_TRACE.

◆ GetScope()

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

Definition at line 1035 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 1057 of file CppInterOp.cpp.

References GetScope(), INTEROP_RETURN, and INTEROP_TRACE.

◆ GetScopeFromType() [1/2]

DeclRef Cpp::GetScopeFromType ( ConstTypeRef  TyRef)

Definition at line 1006 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 850 of file CppInterOp.cpp.

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

◆ GetSpellingFromOperator()

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

Definition at line 5267 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 2384 of file CppInterOp.cpp.

References INTEROP_OUT, INTEROP_TRACE, and INTEROP_VOID_RETURN.

◆ GetStatus()

Status Cpp::GetStatus ( ErrorRef  E)

Definition at line 79 of file ErrorInternal.cpp.

◆ GetType()

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

◆ GetTypeAsString()

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

Definition at line 2751 of file CppInterOp.cpp.

References getASTContext(), INTEROP_RETURN, and INTEROP_TRACE.

Referenced by IsSmartPtrType().

◆ GetTypeFromScope()

TypeRef Cpp::GetTypeFromScope ( ConstDeclRef  DRef)

Definition at line 2964 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 2931 of file CppInterOp.cpp.

References compat::GetTypeFromDecl().

Referenced by GetTypeFromScope().

◆ GetUnderlyingScope()

DeclRef Cpp::GetUnderlyingScope ( ConstDeclRef  DRef)

◆ GetUnderlyingScopeImpl()

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

Definition at line 1012 of file CppInterOp.cpp.

References GetScopeFromType().

Referenced by GetUnderlyingScope().

◆ GetUnderlyingType()

TypeRef Cpp::GetUnderlyingType ( ConstTypeRef  TyRef)

Definition at line 2730 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ GetUsingNamespaces()

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

Definition at line 972 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ GetValidSLoc()

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

Definition at line 624 of file CppInterOp.cpp.

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

◆ GetValueKind()

ValueKind Cpp::GetValueKind ( ConstTypeRef  TyRef)

Definition at line 2696 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 2569 of file CppInterOp.cpp.

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

◆ GetVariableType()

TypeRef Cpp::GetVariableType ( ConstDeclRef  var)

Definition at line 2437 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 2108 of file CppInterOp.cpp.

Referenced by MakeVTableOverlay().

◆ HasDefaultConstructor()

bool Cpp::HasDefaultConstructor ( ConstDeclRef  DRef)

Definition at line 1444 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 2770 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 4844 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 
)

◆ InstallDiagConsumer()

void Cpp::InstallDiagConsumer ( InterpreterInfo II)

Wire CppInterOp's DiagnosticConsumer into the interpreter's DiagnosticsEngine so parser/sema diagnostics flow into II->StoredDiags and continue forwarding to whatever consumer Clang already had.

Definition at line 310 of file ErrorInternal.cpp.

References InstallDiagConsumer().

Referenced by InstallDiagConsumer(), and RegisterInterpreter().

◆ InstantiateFunctionDefinition()

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

Definition at line 559 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 5042 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 5035 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 4996 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 705 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsAggregate()

bool Cpp::IsAggregate ( ConstDeclRef  DRef)

Definition at line 575 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsBuiltin()

bool Cpp::IsBuiltin ( ConstTypeRef  TyRef)

Definition at line 669 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsClass()

bool Cpp::IsClass ( ConstDeclRef  DRef)

Definition at line 597 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

Referenced by Construct().

◆ IsClassPolymorphic()

bool Cpp::IsClassPolymorphic ( ConstDeclRef  DRef)

Definition at line 615 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsComplete()

bool Cpp::IsComplete ( ConstDeclRef  DRef)

Definition at line 630 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 5241 of file CppInterOp.cpp.

References INTEROP_RETURN, INTEROP_TRACE, and IsConstMethod().

Referenced by IsConstMethod().

◆ IsConstructor()

bool Cpp::IsConstructor ( ConstFuncRef  method)

Definition at line 1946 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 2610 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsDebugOutputEnabled()

bool Cpp::IsDebugOutputEnabled ( )

Definition at line 554 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsDestructor()

bool Cpp::IsDestructor ( ConstFuncRef  method)

Definition at line 1954 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsEnumConstant()

bool Cpp::IsEnumConstant ( ConstDeclRef  DRef)

Definition at line 720 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsEnumScope()

bool Cpp::IsEnumScope ( ConstDeclRef  DRef)

Definition at line 714 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsEnumType()

bool Cpp::IsEnumType ( ConstTypeRef  TyRef)

Definition at line 726 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsExplicit()

bool Cpp::IsExplicit ( ConstFuncRef  method)

Definition at line 1973 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsFloatingType()

bool Cpp::IsFloatingType ( ConstTypeRef  TyRef)

Definition at line 2651 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsFunction()

bool Cpp::IsFunction ( ConstDeclRef  DRef)

Definition at line 603 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsFunctionDeleted()

bool Cpp::IsFunctionDeleted ( ConstFuncRef  function)

Definition at line 1701 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsFunctionPointerType()

bool Cpp::IsFunctionPointerType ( ConstTypeRef  TyRef)

Definition at line 609 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsFunctionProtoType()

bool Cpp::IsFunctionProtoType ( ConstTypeRef  TyRef)

Definition at line 1581 of file CppInterOp.cpp.

References INTEROP_TRACE.

◆ IsIntegerType()

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

Definition at line 2637 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsLambdaClass()

bool Cpp::IsLambdaClass ( ConstTypeRef  TyRef)

Definition at line 2428 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsMethod()

bool Cpp::IsMethod ( ConstFuncRef  method)

Definition at line 1922 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsNamespace()

bool Cpp::IsNamespace ( ConstDeclRef  DRef)

Definition at line 591 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsPODType()

bool Cpp::IsPODType ( ConstTypeRef  TyRef)

Definition at line 2627 of file CppInterOp.cpp.

References getASTContext(), INTEROP_RETURN, and INTEROP_TRACE.

◆ IsPointerType()

bool Cpp::IsPointerType ( ConstTypeRef  TyRef)

Definition at line 2668 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

Referenced by GetPointeeType().

◆ IsPrivateMethod()

bool Cpp::IsPrivateMethod ( ConstFuncRef  method)

Definition at line 1941 of file CppInterOp.cpp.

References CheckMethodAccess(), INTEROP_RETURN, and INTEROP_TRACE.

◆ IsPrivateVariable()

bool Cpp::IsPrivateVariable ( ConstDeclRef  var)

Definition at line 2595 of file CppInterOp.cpp.

References CheckVariableAccess(), INTEROP_RETURN, and INTEROP_TRACE.

◆ IsProtectedMethod()

bool Cpp::IsProtectedMethod ( ConstFuncRef  method)

Definition at line 1935 of file CppInterOp.cpp.

References CheckMethodAccess(), INTEROP_RETURN, and INTEROP_TRACE.

◆ IsProtectedVariable()

bool Cpp::IsProtectedVariable ( ConstDeclRef  var)

Definition at line 2589 of file CppInterOp.cpp.

References CheckVariableAccess(), INTEROP_RETURN, and INTEROP_TRACE.

◆ IsPublicMethod()

bool Cpp::IsPublicMethod ( ConstFuncRef  method)

Definition at line 1930 of file CppInterOp.cpp.

References CheckMethodAccess(), INTEROP_RETURN, and INTEROP_TRACE.

◆ IsPublicVariable()

bool Cpp::IsPublicVariable ( ConstDeclRef  var)

Definition at line 2584 of file CppInterOp.cpp.

References CheckVariableAccess(), INTEROP_RETURN, and INTEROP_TRACE.

◆ IsRecordType()

bool Cpp::IsRecordType ( ConstTypeRef  TyRef)

Definition at line 2621 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsReferenceType()

bool Cpp::IsReferenceType ( ConstTypeRef  TyRef)

Definition at line 2690 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 2659 of file CppInterOp.cpp.

References getASTContext(), INTEROP_RETURN, and INTEROP_TRACE.

◆ isSmartPointer()

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

Definition at line 732 of file CppInterOp.cpp.

Referenced by IsSmartPtrType().

◆ IsSmartPtrType()

bool Cpp::IsSmartPtrType ( ConstTypeRef  TyRef)

Definition at line 774 of file CppInterOp.cpp.

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

◆ IsStaticMethod()

bool Cpp::IsStaticMethod ( ConstFuncRef  method)

Definition at line 1960 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsStaticVariable()

bool Cpp::IsStaticVariable ( ConstDeclRef  var)

Definition at line 2600 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 686 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 1647 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsTemplateSpecialization()

bool Cpp::IsTemplateSpecialization ( ConstDeclRef  DRef)

Definition at line 692 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

Referenced by GetFunctionReturnType().

◆ IsTypedefed()

bool Cpp::IsTypedefed ( ConstDeclRef  DRef)

Definition at line 699 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 862 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsVirtualMethod()

bool Cpp::IsVirtualMethod ( ConstFuncRef  method)

Definition at line 2049 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ IsVoidPointerType()

bool Cpp::IsVoidPointerType ( ConstTypeRef  TyRef)

Definition at line 2674 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 1739 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 4816 of file CppInterOp.cpp.

References getInterp(), INTEROP_RETURN, and INTEROP_TRACE.

◆ makeError() [1/2]

ErrorRef Cpp::makeError ( InterpreterInfo II,
Status  S,
std::string  Message,
const char *  Producer,
const char *  ProducerSig 
)

Build a slice-encoded error carrying a Clang-derived message + the interp's pending diagnostics + producer attribution.

Definition at line 173 of file ErrorInternal.cpp.

References AllocSlice(), Cpp::ErrorSlice::Code, Cpp::ErrorSlice::Diagnostics, DrainPendingInto(), makeError(), Cpp::StoredDiagView::Message, Cpp::ErrorSlice::Producer, Cpp::ErrorSlice::ProducerSignature, and Cpp::StoredDiagView::Sev.

◆ makeError() [2/2]

ErrorRef Cpp::makeError ( Status  S)

Build an inline-status ErrorRef (no diagnostics, no payload).

Definition at line 171 of file ErrorInternal.cpp.

References makeError().

Referenced by makeError(), and makeError().

◆ MakeFunctionCallable() [1/2]

JitCall Cpp::MakeFunctionCallable ( ConstFuncRef  func)

Definition at line 4320 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 4287 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

Referenced by Construct(), and MakeFunctionCallable().

◆ makeResult() [1/2]

Result< void > Cpp::makeResult ( InterpreterInfo II,
llvm::Error  E,
const char *  Producer,
const char *  ProducerSig 
)
inline

Definition at line 112 of file ErrorInternal.h.

References drainError().

◆ makeResult() [2/2]

template<typename T >
Result< T > Cpp::makeResult ( InterpreterInfo II,
llvm::Expected< T >  E,
const char *  Producer,
const char *  ProducerSig 
)

Convert llvm::Expected<T> into Result<T>.

On the error path, drain the carried llvm::Error into a slice.

Definition at line 105 of file ErrorInternal.h.

References drainError().

◆ 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 4930 of file CppInterOp.cpp.

References getInterp(), INTEROP_RETURN, and INTEROP_TRACE.

◆ PopulateBuiltinMap()

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

Definition at line 2842 of file CppInterOp.cpp.

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

Referenced by findBuiltinType().

◆ Process()

int Cpp::Process ( const char *  code)

Definition at line 4730 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 271 of file CppInterOp.cpp.

References GetInterpreters(), and InstallDiagConsumer().

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 2828 of file CppInterOp.cpp.

Referenced by PopulateBuiltinMap().

◆ ReleaseErrorRef()

void Cpp::ReleaseErrorRef ( ErrorRef  E)

Definition at line 148 of file ErrorInternal.cpp.

References ReleaseErrorRef().

Referenced by ReleaseErrorRef().

◆ RemoveTypeQualifier()

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

Definition at line 2791 of file CppInterOp.cpp.

References INTEROP_RETURN, and INTEROP_TRACE.

◆ ResultAbort_UncheckedOnDtor()

void Cpp::ResultAbort_UncheckedOnDtor ( const ErrorRef &  )

Definition at line 360 of file ErrorInternal.cpp.

References ResultAbort_UncheckedOnDtor().

Referenced by ResultAbort_UncheckedOnDtor().

◆ ResultAbort_ValueOnError()

void Cpp::ResultAbort_ValueOnError ( const ErrorRef &  )

Definition at line 350 of file ErrorInternal.cpp.

References ResultAbort_ValueOnError().

Referenced by ResultAbort_ValueOnError().

◆ RetainErrorRef()

void Cpp::RetainErrorRef ( ErrorRef  E)

Definition at line 141 of file ErrorInternal.cpp.

References RetainErrorRef().

Referenced by RetainErrorRef().

◆ SearchLibrariesForSymbol()

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

◆ SizeOf()

size_t Cpp::SizeOf ( ConstDeclRef  DRef)

Definition at line 654 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 2063 of file CppInterOp.cpp.

References getASTContext().

Referenced by MakeVTableOverlay().

◆ vtableMethodSlotCount()

static int Cpp::vtableMethodSlotCount ( ConstDeclRef  DRef)
static

Definition at line 2080 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 2129 of file CppInterOp.cpp.

Referenced by applyVTableOverlay().

◆ kDeletingDtorSlot

constexpr int Cpp::kDeletingDtorSlot = 1
constexpr

Definition at line 2277 of file CppInterOp.cpp.

Referenced by MakeVTableOverlay().

◆ kMinVTableMethodSlots

constexpr int Cpp::kMinVTableMethodSlots = 2
constexpr

Definition at line 2225 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 174 of file CppInterOp.cpp.

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