clang 19.0.0git
Classes | Macros | 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/ObjectFilePCHContainerOperations.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 "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"

Go to the source code of this file.

Classes

struct  __clang_Interpreter_NewTag
 

Macros

#define X(type, name)
 

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)
 
REPL_EXTERNAL_VISIBILITY void __clang_Interpreter_SetValueNoAlloc (void *This, void *OutVal, void *OpaqueType, void *Val)
 
REPL_EXTERNAL_VISIBILITY void __clang_Interpreter_SetValueNoAlloc (void *This, void *OutVal, void *OpaqueType)
 
static void SetValueDataBasedOnQualType (Value &V, unsigned long long Data)
 
REPL_EXTERNAL_VISIBILITY void __clang_Interpreter_SetValueNoAlloc (void *This, void *OutVal, void *OpaqueType, unsigned long long Val)
 
REPL_EXTERNAL_VISIBILITY void __clang_Interpreter_SetValueNoAlloc (void *This, void *OutVal, void *OpaqueType, float Val)
 
REPL_EXTERNAL_VISIBILITY void __clang_Interpreter_SetValueNoAlloc (void *This, void *OutVal, void *OpaqueType, double Val)
 
REPL_EXTERNAL_VISIBILITY void __clang_Interpreter_SetValueNoAlloc (void *This, void *OutVal, void *OpaqueType, long double Val)
 
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 []
 

Macro Definition Documentation

◆ X

#define X (   type,
  name 
)
Value:
case BuiltinType::name: \
V.set##name(Data); \
break;
#define V(N, I)
Definition: ASTContext.h:3284
const char * Data

Function Documentation

◆ __clang_Interpreter_SetValueNoAlloc() [1/6]

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

Definition at line 844 of file Interpreter.cpp.

◆ __clang_Interpreter_SetValueNoAlloc() [2/6]

REPL_EXTERNAL_VISIBILITY void __clang_Interpreter_SetValueNoAlloc ( void *  This,
void *  OutVal,
void *  OpaqueType,
double  Val 
)

Definition at line 884 of file Interpreter.cpp.

◆ __clang_Interpreter_SetValueNoAlloc() [3/6]

REPL_EXTERNAL_VISIBILITY void __clang_Interpreter_SetValueNoAlloc ( void *  This,
void *  OutVal,
void *  OpaqueType,
float  Val 
)

Definition at line 876 of file Interpreter.cpp.

◆ __clang_Interpreter_SetValueNoAlloc() [4/6]

REPL_EXTERNAL_VISIBILITY void __clang_Interpreter_SetValueNoAlloc ( void *  This,
void *  OutVal,
void *  OpaqueType,
long double  Val 
)

Definition at line 892 of file Interpreter.cpp.

◆ __clang_Interpreter_SetValueNoAlloc() [5/6]

REPL_EXTERNAL_VISIBILITY void __clang_Interpreter_SetValueNoAlloc ( void *  This,
void *  OutVal,
void *  OpaqueType,
unsigned long long  Val 
)

Definition at line 868 of file Interpreter.cpp.

References SetValueDataBasedOnQualType().

◆ __clang_Interpreter_SetValueNoAlloc() [6/6]

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

Definition at line 836 of file Interpreter.cpp.

References clang::Value::setPtr().

◆ __clang_Interpreter_SetValueWithAlloc()

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

Definition at line 827 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 778 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 376 of file Interpreter.cpp.

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

◆ operator new()

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

Definition at line 906 of file Interpreter.cpp.

References __p.

◆ SetValueDataBasedOnQualType()

static void SetValueDataBasedOnQualType ( Value V,
unsigned long long  Data 
)
static

Variable Documentation

◆ MagicRuntimeInterface

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

Definition at line 535 of file Interpreter.cpp.

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

◆ Runtimes

const char* const Runtimes
Initial value:
= R"(
#ifdef __cplusplus
void *__clang_Interpreter_SetValueWithAlloc(void*, void*, void*);
void __clang_Interpreter_SetValueNoAlloc(void*, void*, void*);
void __clang_Interpreter_SetValueNoAlloc(void*, void*, void*, void*);
void __clang_Interpreter_SetValueNoAlloc(void*, void*, void*, float);
void __clang_Interpreter_SetValueNoAlloc(void*, void*, void*, double);
void __clang_Interpreter_SetValueNoAlloc(void*, void*, void*, long double);
void __clang_Interpreter_SetValueNoAlloc(void*,void*,void*,unsigned long long);
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);
}
#endif // __cplusplus
)"

Definition at line 252 of file Interpreter.cpp.

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