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

Namespaces

namespace  detail
 

Classes

class  SynthesizingCodeRAII
 

Typedefs

using Interpreter = CppInternal::Interpreter
 
using Value = clang::Value
 

Functions

bool detectCudaInstallPath (const std::vector< const char * > &args, std::string &CudaPath)
 Detect the CUDA installation path using clang::Driver.
 
bool detectNVPTXArch (std::string &Arch)
 Detect GPU architecture via the CUDA Driver API, tweaked from clang's nvptx-arch tool (NVPTXArch.cpp)
 
std::unique_ptr< clang::Interpreter > createClangInterpreter (std::vector< const char * > &args, int stdin_fd=-1, int stdout_fd=-1, int stderr_fd=-1)
 
void maybeMangleDeclName (const clang::GlobalDecl &GD, std::string &mangledName)
 
llvm::orc::LLJIT * getExecutionEngine (clang::Interpreter &I)
 
llvm::Expected< llvm::JITTargetAddress > getSymbolAddress (clang::Interpreter &I, llvm::StringRef IRName)
 
llvm::Expected< llvm::JITTargetAddress > getSymbolAddress (clang::Interpreter &I, clang::GlobalDecl GD)
 
llvm::Expected< llvm::JITTargetAddress > getSymbolAddressFromLinkerName (clang::Interpreter &I, llvm::StringRef LinkerName)
 
llvm::Error Undo (clang::Interpreter &I, unsigned N=1)
 
void codeComplete (std::vector< std::string > &Results, clang::Interpreter &I, const char *code, unsigned complete_line=1U, unsigned complete_column=1U)
 
template<typename T >
convertTo (clang::Value V)
 
Cpp::Box MakeValueBox (const Value &V, void *qt) noexcept
 Wrap a compat::Value into a refcount-shared K_PtrOrObj Cpp::Box.
 
void InstantiateClassTemplateSpecialization (Interpreter &interp, clang::ClassTemplateSpecializationDecl *CTSD)
 

Typedef Documentation

◆ Interpreter

Definition at line 688 of file Compatibility.h.

◆ Value

using compat::Value = typedef clang::Value

Definition at line 707 of file Compatibility.h.

Function Documentation

◆ codeComplete()

void compat::codeComplete ( std::vector< std::string > &  Results,
clang::Interpreter &  I,
const char *  code,
unsigned  complete_line = 1U,
unsigned  complete_column = 1U 
)
inline

Definition at line 655 of file Compatibility.h.

Referenced by Cpp::CodeComplete().

◆ convertTo()

template<typename T >
T compat::convertTo ( clang::Value  V)
inline

Definition at line 716 of file Compatibility.h.

◆ createClangInterpreter()

std::unique_ptr< clang::Interpreter > compat::createClangInterpreter ( std::vector< const char * > &  args,
int  stdin_fd = -1,
int  stdout_fd = -1,
int  stderr_fd = -1 
)
inline

Definition at line 445 of file Compatibility.h.

References detectCudaInstallPath(), and detectNVPTXArch().

◆ detectCudaInstallPath()

bool compat::detectCudaInstallPath ( const std::vector< const char * > &  args,
std::string &  CudaPath 
)
inline

Detect the CUDA installation path using clang::Driver.

Parameters
argsuser-provided interpreter arguments (may contain –cuda-path).
[out]CudaPaththe detected CUDA installation path.
Returns
true on success, false if not found.

Definition at line 263 of file Compatibility.h.

Referenced by createClangInterpreter().

◆ detectNVPTXArch()

bool compat::detectNVPTXArch ( std::string &  Arch)
inline

Detect GPU architecture via the CUDA Driver API, tweaked from clang's nvptx-arch tool (NVPTXArch.cpp)

Parameters
[out]ArchSet to "sm_XX" on success, or clang's default fallback.
Returns
true on success, false on error (no CUDA driver available).

Definition at line 334 of file Compatibility.h.

Referenced by createClangInterpreter().

◆ getExecutionEngine()

llvm::orc::LLJIT * compat::getExecutionEngine ( clang::Interpreter &  I)
inline

◆ getSymbolAddress() [1/2]

llvm::Expected< llvm::JITTargetAddress > compat::getSymbolAddress ( clang::Interpreter &  I,
clang::GlobalDecl  GD 
)
inline

Definition at line 630 of file Compatibility.h.

References getSymbolAddress(), and maybeMangleDeclName().

◆ getSymbolAddress() [2/2]

llvm::Expected< llvm::JITTargetAddress > compat::getSymbolAddress ( clang::Interpreter &  I,
llvm::StringRef  IRName 
)
inline

◆ getSymbolAddressFromLinkerName()

llvm::Expected< llvm::JITTargetAddress > compat::getSymbolAddressFromLinkerName ( clang::Interpreter &  I,
llvm::StringRef  LinkerName 
)
inline

◆ InstantiateClassTemplateSpecialization()

void compat::InstantiateClassTemplateSpecialization ( Interpreter interp,
clang::ClassTemplateSpecializationDecl *  CTSD 
)
inline

Definition at line 757 of file Compatibility.h.

References CppInternal::Interpreter::getSema().

Referenced by Cpp::GetNumBases().

◆ MakeValueBox()

Cpp::Box compat::MakeValueBox ( const Value V,
void *  qt 
)
inlinenoexcept

Wrap a compat::Value into a refcount-shared K_PtrOrObj Cpp::Box.

qt is the opaque QualType (clang::QualType::getAsOpaquePtr()).

Definition at line 752 of file Compatibility.h.

References Cpp::Box::AdoptObject(), and compat::detail::ValueRefCount::Ops.

Referenced by Cpp::Evaluate().

◆ maybeMangleDeclName()

void compat::maybeMangleDeclName ( const clang::GlobalDecl &  GD,
std::string &  mangledName 
)
inline

◆ Undo()

llvm::Error compat::Undo ( clang::Interpreter &  I,
unsigned  N = 1 
)
inline

Definition at line 651 of file Compatibility.h.

Referenced by CppInternal::Interpreter::Undo().