|
CppInterOp
C++ Language Interoperability Layer
|
CppInterOp Interpreter. More...
#include "lib/CppInterOp/CppInterOpInterpreter.h"
Classes | |
| struct | FileDeleter |
| struct | IOContext |
Public Types | |
| enum | CompilationResult { kSuccess , kFailure , kMoreInputExpected } |
| Describes the return result of the different routines that do the incremental compilation. More... | |
Public Member Functions | |
| Interpreter (std::unique_ptr< clang::Interpreter > CI, std::unique_ptr< IOContext > ctx=nullptr, bool oop=false) | |
| ~Interpreter () | |
| operator const clang::Interpreter & () const | |
| operator clang::Interpreter & () | |
| bool | isOutOfProcess () const |
| FILE * | getRedirectionFileForOutOfProcess (int FD) |
| const clang::CompilerInstance * | getCompilerInstance () const |
| llvm::orc::LLJIT * | getExecutionEngine () const |
| llvm::Expected< clang::PartialTranslationUnit & > | Parse (llvm::StringRef Code) |
| llvm::Error | Execute (clang::PartialTranslationUnit &T) |
| llvm::Error | ParseAndExecute (llvm::StringRef Code, clang::Value *V=nullptr) |
| llvm::Error | Undo (unsigned N=1) |
| void | makeEngineOnce () const |
| llvm::Expected< llvm::orc::ExecutorAddr > | getSymbolAddress (clang::GlobalDecl GD) const |
| llvm::Expected< llvm::orc::ExecutorAddr > | getSymbolAddress (llvm::StringRef IRName) const |
| llvm::Expected< llvm::orc::ExecutorAddr > | getSymbolAddressFromLinkerName (llvm::StringRef LinkerName) const |
| bool | isInSyntaxOnlyMode () const |
| void * | getAddressOfGlobal (const clang::GlobalDecl &GD) const |
| void * | getAddressOfGlobal (llvm::StringRef SymName) const |
| CompilationResult | declare (const std::string &input, clang::PartialTranslationUnit **PTU=nullptr) |
| CompilationResult | process (const std::string &input, clang::Value *V=0, clang::PartialTranslationUnit **PTU=nullptr, bool disableValuePrinting=false) |
| Maybe transform the input line to implement cint command line semantics (declarations are global) and compile to produce a module. | |
| CompilationResult | evaluate (const std::string &input, clang::Value &V) |
| void * | compileFunction (llvm::StringRef name, llvm::StringRef code, bool ifUnique, bool withAccessControl) |
| const clang::CompilerInstance * | getCI () const |
| clang::Sema & | getSema () const |
| const DynamicLibraryManager * | getDynamicLibraryManager () const |
| DynamicLibraryManager * | getDynamicLibraryManager () |
| void | AddIncludePaths (llvm::StringRef PathsStr, const char *Delim=":") |
| Adds multiple include paths separated by a delimiter. | |
| void | AddIncludePath (llvm::StringRef PathsStr) |
| Adds a single include path (-I). | |
| void | GetIncludePaths (llvm::SmallVectorImpl< std::string > &incpaths, bool withSystem, bool withFlags) const |
| Get the current include paths that are used. | |
| CompilationResult | loadLibrary (const std::string &filename, bool lookup) |
| std::string | toString (const char *type, void *obj) |
| CompilationResult | undo (unsigned N=1) |
Static Public Member Functions | |
| static std::unique_ptr< Interpreter > | create (int argc, const char *const *argv, const char *llvmdir=nullptr, const std::vector< std::shared_ptr< clang::ModuleFileExtension > > &moduleExtensions={}, void *extraLibHandle=nullptr, bool noRuntime=true) |
Definition at line 149 of file CppInterOpInterpreter.h.
Describes the return result of the different routines that do the incremental compilation.
| Enumerator | |
|---|---|
| kSuccess | |
| kFailure | |
| kMoreInputExpected | |
Definition at line 284 of file CppInterOpInterpreter.h.
|
inline |
Definition at line 204 of file CppInterOpInterpreter.h.
Referenced by Cpp::InterpreterInfo::InterpreterInfo(), and Cpp::InterpreterInfo::operator=().
|
inline |
Definition at line 252 of file CppInterOpInterpreter.h.
|
inline |
Adds a single include path (-I).
Definition at line 499 of file CppInterOpInterpreter.h.
References AddIncludePaths().
Referenced by Cpp::AddIncludePath().
|
inline |
Adds multiple include paths separated by a delimiter.
| [in] | PathsStr | - Path(s) |
| [in] | Delim | - Delimiter to separate paths or NULL if a single path |
Definition at line 472 of file CppInterOpInterpreter.h.
References CppInternal::utils::AddIncludePaths(), and getCompilerInstance().
Referenced by AddIncludePath().
|
inline |
Definition at line 415 of file CppInterOpInterpreter.h.
References getAddressOfGlobal(), getCompilerInstance(), isInSyntaxOnlyMode(), and ParseAndExecute().
|
inlinestatic |
Definition at line 210 of file CppInterOpInterpreter.h.
Referenced by Cpp::CreateInterpreter().
|
inline |
Definition at line 377 of file CppInterOpInterpreter.h.
References process().
Referenced by Cpp::Declare().
|
inline |
Definition at line 406 of file CppInterOpInterpreter.h.
References kFailure, kSuccess, and ParseAndExecute().
Referenced by Cpp::Evaluate().
|
inline |
Definition at line 298 of file CppInterOpInterpreter.h.
Referenced by Cpp::ForceCodeGen(), and process().
|
inline |
Definition at line 355 of file CppInterOpInterpreter.h.
References getSymbolAddress().
Referenced by compileFunction(), and Cpp::GetVariableOffset().
|
inline |
Definition at line 364 of file CppInterOpInterpreter.h.
References getSymbolAddressFromLinkerName(), and isInSyntaxOnlyMode().
|
inline |
Definition at line 447 of file CppInterOpInterpreter.h.
References getCompilerInstance().
Referenced by Cpp::ForceCodeGen(), Cpp::GetDefaultConstructor(), GetIncludePaths(), Cpp::GetLanguage(), Cpp::GetLanguageStandard(), Cpp::getSema(), and getSema().
|
inline |
Definition at line 286 of file CppInterOpInterpreter.h.
Referenced by AddIncludePaths(), compileFunction(), getCI(), isInSyntaxOnlyMode(), and loadLibrary().
|
inline |
Definition at line 462 of file CppInterOpInterpreter.h.
References getDynamicLibraryManager().
|
inline |
Definition at line 451 of file CppInterOpInterpreter.h.
References compat::getExecutionEngine().
Referenced by Cpp::AddSearchPath(), getDynamicLibraryManager(), loadLibrary(), Cpp::SearchLibrariesForSymbol(), and Cpp::UnloadLibrary().
|
inline |
Definition at line 290 of file CppInterOpInterpreter.h.
References compat::getExecutionEngine().
|
inline |
Get the current include paths that are used.
| [out] | incpaths | - Pass in a llvm::SmallVector<std::string, N> with sufficiently sized N, to hold the result of the call. |
| [in] | withSystem | - if true, incpaths will also contain system include paths (framework, STL etc). |
| [in] | withFlags | - if true, each element in incpaths will be prefixed with a "-I" or similar, and some entries of incpaths will signal a new include path region (e.g. "-cxx-isystem"). Also, flags defining header search behavior will be included in incpaths, e.g. "-nostdinc". |
Definition at line 515 of file CppInterOpInterpreter.h.
References CppInternal::utils::CopyIncludePaths(), and getCI().
Referenced by Cpp::GetIncludePaths().
|
inline |
Definition at line 264 of file CppInterOpInterpreter.h.
|
inline |
Definition at line 449 of file CppInterOpInterpreter.h.
References getCI().
Referenced by Cpp::Declare(), Cpp::ForceCodeGen(), Cpp::GetVariableOffset(), compat::InstantiateClassTemplateSpecialization(), and Cpp::InstantiateTemplate().
|
inline |
ExecutorAddr of a GlobalDecl. This interface uses the CodeGenModule's internal mangling cache to avoid recomputing the mangled name. Definition at line 321 of file CppInterOpInterpreter.h.
References compat::getSymbolAddress(), and makeEngineOnce().
Referenced by getAddressOfGlobal().
|
inline |
ExecutorAddr of a given name as written in the IR. Definition at line 331 of file CppInterOpInterpreter.h.
References compat::getSymbolAddress(), and makeEngineOnce().
|
inline |
ExecutorAddr of a given name as written in the object file. Definition at line 342 of file CppInterOpInterpreter.h.
References compat::getSymbolAddressFromLinkerName().
Referenced by getAddressOfGlobal().
|
inline |
Definition at line 349 of file CppInterOpInterpreter.h.
References getCompilerInstance().
Referenced by compileFunction(), and getAddressOfGlobal().
|
inline |
Definition at line 257 of file CppInterOpInterpreter.h.
|
inline |
Definition at line 521 of file CppInterOpInterpreter.h.
References getCompilerInstance(), getDynamicLibraryManager(), kFailure, CppInternal::DynamicLibraryManager::kLoadLibAlreadyLoaded, CppInternal::DynamicLibraryManager::kLoadLibNotFound, CppInternal::DynamicLibraryManager::kLoadLibSuccess, kMoreInputExpected, kSuccess, CppInternal::DynamicLibraryManager::loadLibrary(), and CppInternal::DynamicLibraryManager::lookupLibrary().
Referenced by Cpp::LoadLibrary().
|
inline |
Definition at line 308 of file CppInterOpInterpreter.h.
Referenced by getSymbolAddress(), and getSymbolAddress().
|
inline |
Definition at line 255 of file CppInterOpInterpreter.h.
|
inline |
Definition at line 254 of file CppInterOpInterpreter.h.
|
inline |
Definition at line 294 of file CppInterOpInterpreter.h.
Referenced by Cpp::ForceCodeGen(), and process().
|
inline |
Definition at line 302 of file CppInterOpInterpreter.h.
Referenced by compileFunction(), and evaluate().
|
inline |
|
inline |
Definition at line 556 of file CppInterOpInterpreter.h.
|
inline |
Definition at line 306 of file CppInterOpInterpreter.h.
References compat::Undo().
Referenced by undo().
|
inline |
Definition at line 562 of file CppInterOpInterpreter.h.