clang 20.0.0git
Classes | Functions | Variables
Interpreter.cpp File Reference
#include "DeviceOffload.h"
#include "IncrementalExecutor.h"
#include "IncrementalParser.h"
#include "InterpreterUtils.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/Mangle.h"
#include "clang/AST/TypeVisitor.h"
#include "clang/Basic/DiagnosticSema.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/CodeGen/CodeGenAction.h"
#include "clang/CodeGen/ModuleBuilder.h"
#include "clang/CodeGen/ObjectFilePCHContainerWriter.h"
#include "clang/Driver/Compilation.h"
#include "clang/Driver/Driver.h"
#include "clang/Driver/Job.h"
#include "clang/Driver/Options.h"
#include "clang/Driver/Tool.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/TextDiagnosticBuffer.h"
#include "clang/Interpreter/Interpreter.h"
#include "clang/Interpreter/Value.h"
#include "clang/Lex/PreprocessorOptions.h"
#include "clang/Sema/Lookup.h"
#include "clang/Serialization/ObjectFilePCHContainerReader.h"
#include "llvm/ExecutionEngine/JITSymbol.h"
#include "llvm/ExecutionEngine/Orc/LLJIT.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/TargetParser/Host.h"
#include <cstdarg>

Go to the source code of this file.

Classes

struct  __clang_Interpreter_NewTag
 

Functions

static llvm::Expected< llvm::orc::JITTargetMachineBuilder > createJITTargetMachineBuilder (const std::string &TT)
 
static std::unique_ptr< RuntimeInterfaceBuildercreateInProcessRuntimeInterfaceBuilder (Interpreter &Interp, ASTContext &Ctx, Sema &S)
 
REPL_EXTERNAL_VISIBILITY void * __clang_Interpreter_SetValueWithAlloc (void *This, void *OutVal, void *OpaqueType)
 
void REPL_EXTERNAL_VISIBILITY __clang_Interpreter_SetValueNoAlloc (void *This, void *OutVal, void *OpaqueType,...)
 
REPL_EXTERNAL_VISIBILITY void * operator new (size_t __sz, void *__p, __clang_Interpreter_NewTag) noexcept
 

Variables

const char *const Runtimes
 
static constexpr llvm::StringRef MagicRuntimeInterface []
 

Function Documentation

◆ __clang_Interpreter_SetValueNoAlloc()

void REPL_EXTERNAL_VISIBILITY __clang_Interpreter_SetValueNoAlloc ( void *  This,
void *  OutVal,
void *  OpaqueType,
  ... 
)

◆ __clang_Interpreter_SetValueWithAlloc()

REPL_EXTERNAL_VISIBILITY void * __clang_Interpreter_SetValueWithAlloc ( void *  This,
void *  OutVal,
void *  OpaqueType 
)

Definition at line 872 of file Interpreter.cpp.

References clang::Value::getPtr().

◆ createInProcessRuntimeInterfaceBuilder()

static std::unique_ptr< RuntimeInterfaceBuilder > createInProcessRuntimeInterfaceBuilder ( Interpreter Interp,
ASTContext Ctx,
Sema S 
)
static

Definition at line 823 of file Interpreter.cpp.

Referenced by clang::Interpreter::FindRuntimeInterface().

◆ createJITTargetMachineBuilder()

static llvm::Expected< llvm::orc::JITTargetMachineBuilder > createJITTargetMachineBuilder ( const std::string &  TT)
static

Definition at line 409 of file Interpreter.cpp.

Referenced by clang::Interpreter::CreateExecutor().

◆ operator new()

REPL_EXTERNAL_VISIBILITY void * operator new ( size_t  __sz,
void *  __p,
__clang_Interpreter_NewTag   
)
noexcept

Definition at line 963 of file Interpreter.cpp.

References __p.

Variable Documentation

◆ MagicRuntimeInterface

constexpr llvm::StringRef MagicRuntimeInterface[]
staticconstexpr
Initial value:
= {
"__clang_Interpreter_SetValueNoAlloc",
"__clang_Interpreter_SetValueWithAlloc",
"__clang_Interpreter_SetValueCopyArr", "__ci_newtag"}

Definition at line 576 of file Interpreter.cpp.

Referenced by clang::Interpreter::FindRuntimeInterface().

◆ Runtimes

const char* const Runtimes
Initial value:
= R"(
#define __CLANG_REPL__ 1
#ifdef __cplusplus
#define EXTERN_C extern "C"
void *__clang_Interpreter_SetValueWithAlloc(void*, void*, void*);
struct __clang_Interpreter_NewTag{} __ci_newtag;
void* operator new(__SIZE_TYPE__, void* __p, __clang_Interpreter_NewTag) noexcept;
template <class T, class = T (*)() /*disable for arrays*/>
void __clang_Interpreter_SetValueCopyArr(T* Src, void* Placement, unsigned long Size) {
for (auto Idx = 0; Idx < Size; ++Idx)
new ((void*)(((T*)Placement) + Idx), __ci_newtag) T(Src[Idx]);
}
template <class T, unsigned long N>
void __clang_Interpreter_SetValueCopyArr(const T (*Src)[N], void* Placement, unsigned long Size) {
__clang_Interpreter_SetValueCopyArr(Src[0], Placement, Size);
}
#else
#define EXTERN_C extern
#endif // __cplusplus
EXTERN_C void __clang_Interpreter_SetValueNoAlloc(void *This, void *OutVal, void *OpaqueType, ...);
)"

Definition at line 285 of file Interpreter.cpp.

Referenced by clang::Interpreter::create().