#include "TCling.h"#include "ROOT/FoundationUtils.hxx"#include "TClingBaseClassInfo.h"#include "TClingCallFunc.h"#include "TClingClassInfo.h"#include "TClingDataMemberInfo.h"#include "TClingMethodArgInfo.h"#include "TClingMethodInfo.h"#include "TClingRdictModuleFileExtension.h"#include "TClingTypedefInfo.h"#include "TClingTypeInfo.h"#include "TClingValue.h"#include "TROOT.h"#include "TApplication.h"#include "TGlobal.h"#include "TDataType.h"#include "TClass.h"#include "TClassEdit.h"#include "TClassTable.h"#include "TClingCallbacks.h"#include "TClingDiagnostics.h"#include "TBaseClass.h"#include "TDataMember.h"#include "TMemberInspector.h"#include "TMethod.h"#include "TMethodArg.h"#include "TFunctionTemplate.h"#include "TObjArray.h"#include "TObjString.h"#include "TString.h"#include "THashList.h"#include "TVirtualPad.h"#include "TSystem.h"#include "TVirtualMutex.h"#include "TError.h"#include "TEnv.h"#include "TEnum.h"#include "TEnumConstant.h"#include "THashTable.h"#include "RConversionRuleParser.h"#include "RConfigure.h"#include "compiledata.h"#include "strlcpy.h"#include "snprintf.h"#include "TClingUtils.h"#include "TVirtualCollectionProxy.h"#include "TVirtualStreamerInfo.h"#include "TListOfDataMembers.h"#include "TListOfEnums.h"#include "TListOfEnumsWithLock.h"#include "TListOfFunctions.h"#include "TListOfFunctionTemplates.h"#include "TMemFile.h"#include "TProtoClass.h"#include "TStreamerInfo.h"#include "ThreadLocalStorage.h"#include "TFile.h"#include "TKey.h"#include "ClingRAII.h"#include "clang/AST/ASTContext.h"#include "clang/AST/Decl.h"#include "clang/AST/DeclarationName.h"#include "clang/AST/GlobalDecl.h"#include "clang/AST/RecordLayout.h"#include "clang/AST/DeclVisitor.h"#include "clang/AST/RecursiveASTVisitor.h"#include "clang/AST/Type.h"#include "clang/Basic/SourceLocation.h"#include "clang/Basic/Specifiers.h"#include "clang/Basic/TargetInfo.h"#include "clang/CodeGen/ModuleBuilder.h"#include "clang/Frontend/CompilerInstance.h"#include "clang/Frontend/FrontendDiagnostic.h"#include "clang/Lex/HeaderSearch.h"#include "clang/Lex/Preprocessor.h"#include "clang/Lex/PreprocessorOptions.h"#include "clang/Parse/Parser.h"#include "clang/Sema/Lookup.h"#include "clang/Sema/Sema.h"#include "clang/Serialization/ASTReader.h"#include "clang/Serialization/GlobalModuleIndex.h"#include "cling/Interpreter/ClangInternalState.h"#include "cling/Interpreter/DynamicLibraryManager.h"#include "cling/Interpreter/Interpreter.h"#include "cling/Interpreter/LookupHelper.h"#include "cling/Interpreter/Value.h"#include "cling/Interpreter/Transaction.h"#include "cling/MetaProcessor/MetaProcessor.h"#include "cling/Utils/AST.h"#include "cling/Utils/ParserStateRAII.h"#include "cling/Utils/SourceNormalization.h"#include "cling/Interpreter/Exception.h"#include <CppInterOp/CppInterOp.h>#include "llvm/IR/GlobalValue.h"#include "llvm/IR/Module.h"#include "llvm/Support/DynamicLibrary.h"#include "llvm/Support/raw_ostream.h"#include "llvm/Support/Path.h"#include "llvm/Support/Process.h"#include "llvm/Object/ELFObjectFile.h"#include "llvm/Object/ObjectFile.h"#include "llvm/Object/SymbolicFile.h"#include "llvm/Support/FileSystem.h"#include <algorithm>#include <iostream>#include <cassert>#include <map>#include <set>#include <stdexcept>#include <cstdint>#include <fstream>#include <sstream>#include <string>#include <tuple>#include <typeinfo>#include <unordered_map>#include <unordered_set>#include <utility>#include <vector>#include <functional>#include <optional>#include <cxxabi.h>#include <sys/stat.h>#include <climits>#include <cstdio>Classes | |
| struct | AlternateTupleIntDoubleAsc |
| struct | AlternateTupleIntDoubleDes |
Macros | |
| #define | R__DLLEXPORT __attribute__ ((visibility ("default"))) |
Enumerations | |
| enum class | ETupleOrdering { kAscending , kDescending , kUnexpected } |
| Check in what order the member of a tuple are layout. More... | |
Functions | |
| static std::string | AlternateTuple (const char *classname, const cling::LookupHelper &lh, Bool_t silent) |
| static void | ConstructorName (std::string &name, const clang::Decl *decl, cling::Interpreter &interp, const ROOT::TMetaUtils::TNormalizedCtxt &normCtxt) |
| TInterpreter * | CreateInterpreter (void *interpLibHandle, const char *argv[]) |
| void | DestroyInterpreter (TInterpreter *interp) |
| static cling::Interpreter::CompilationResult | ExecAutoParse (const char *what, Bool_t header, cling::Interpreter *interpreter) |
| Parse the payload or header. | |
| static clang::ClassTemplateDecl * | FindTemplateInNamespace (clang::Decl *decl) |
| Find a template decl within N nested namespaces, 0<=N<inf Assumes 1 and only 1 template present and 1 and only 1 entity contained by the namespace. Example: ns1::ns2::..::nsN::myTemplate Returns nullptr in case of error. | |
| static std::string | GetClassSharedLibsForModule (const char *cls, cling::LookupHelper &LH, bool skipCore) |
| static std::string | GetSharedLibImmediateDepsSlow (std::string lib, cling::Interpreter *interp, bool skipLoadedLibs=true) |
| This interface returns a list of dependent libraries in the form: lib libA.so libB.so libC.so. | |
| static int | HandleInterpreterException (cling::MetaProcessor *metaProcessor, const char *input_line, cling::Interpreter::CompilationResult &compRes, cling::Value *result) |
| Let cling process a command line. | |
| static bool | HasASTFileOnDisk (clang::Module *M, const clang::Preprocessor &PP, std::string *FullFileName=nullptr) |
Checks if there is an ASTFile on disk for the given module M. | |
| static bool | hasParsedRootmapForLibrary (llvm::StringRef lib) |
| static bool | hasPrecomputedLibraryDeps (llvm::StringRef lib) |
| static bool | IsFromRootCling () |
| static ETupleOrdering | IsTupleAscending () |
| static GlobalModuleIndex * | loadGlobalModuleIndex (cling::Interpreter &interp) |
| static bool | LoadModule (const std::string &ModuleName, cling::Interpreter &interp) |
| static void | LoadModules (const std::vector< std::string > &modules, cling::Interpreter &interp) |
| Loads the C++ modules that we require to run any ROOT program. This is just supposed to make a C++ module from a modulemap available to the interpreter. | |
| static void | PrintDlError (const char *dyLibName, const char *modulename) |
| static bool | R__InitStreamerInfoFactory () |
| Helper to initialize TVirtualStreamerInfo's factor early. Use static initialization to insure only one TStreamerInfo is created. | |
| static void | RegisterCxxModules (cling::Interpreter &clingInterp) |
| static void | RegisterPreIncludedHeaders (cling::Interpreter &clingInterp) |
| static bool | requiresRootMap (const char *rootmapfile) |
| static Bool_t | s_IsLibraryLoaded (const char *libname, cling::Interpreter *fInterpreter) |
| int | TCling__AutoLoadCallback (const char *className) |
| int | TCling__AutoParseCallback (const char *className) |
| int | TCling__CompileMacro (const char *fileName, const char *options) |
| clang::NamespaceDecl * | TCling__DEBUG__DCtoNamespace (clang::DeclContext *DC) |
| clang::RecordDecl * | TCling__DEBUG__DCtoRecordDecl (clang::DeclContext *DC) |
| void | TCling__DEBUG__decl_dump (void *D) |
| void | TCling__DEBUG__dump (clang::Decl *D) |
| void | TCling__DEBUG__dump (clang::DeclContext *DC) |
| void | TCling__DEBUG__dump (clang::FunctionDecl *FD) |
| clang::DeclContext * | TCling__DEBUG__getDeclContext (clang::Decl *D) |
| void | TCling__DEBUG__printName (clang::Decl *D) |
| const char * | TCling__GetClassSharedLibs (const char *className, bool skipCore) |
| void | TCling__GetNormalizedContext (const ROOT::TMetaUtils::TNormalizedCtxt *&normCtxt) |
| TObject * | TCling__GetObjectAddress (const char *Name, void *&LookupCtx) |
| const Decl * | TCling__GetObjectDecl (TObject *obj) |
| void | TCling__InvalidateGlobal (const clang::Decl *D) |
| int | TCling__IsAutoLoadNamespaceCandidate (const clang::NamespaceDecl *nsDecl) |
| void | TCling__LibraryLoadedRTTI (const void *dyLibHandle, const char *canonicalName) |
| bool | TCling__LibraryLoadingFailed (const std::string &errmessage, const std::string &libStem, bool permanent, bool resolved) |
| Lookup libraries in LD_LIBRARY_PATH and DYLD_LIBRARY_PATH with mangled_name, which is extracted by error messages we get from callback from cling. Return true when the missing library was autoloaded. | |
| void | TCling__LibraryUnloadedRTTI (const void *dyLibHandle, const char *canonicalName) |
| int | TCling__LoadLibrary (const char *library) |
| Load a library. | |
| void * | TCling__LockCompilationDuringUserCodeExecution () |
| Lock the interpreter. | |
| void | TCling__PrintStackTrace () |
| Print a StackTrace! | |
| void | TCling__RegisterRdictForLoadPCM (const std::string &pcmFileNameFullPath, llvm::StringRef *pcmContent) |
| void * | TCling__ResetInterpreterMutex () |
| Reset the interpreter lock to the state it had before interpreter-related calls happened. | |
| void | TCling__RestoreInterpreterMutex (void *delta) |
| Re-apply the lock count delta that TCling__ResetInterpreterMutex() caused. | |
| void | TCling__SplitAclicMode (const char *fileName, string &mode, string &args, string &io, string &fname) |
| bool | TCling__TEST_isInvalidDecl (clang::Decl *D) |
| bool | TCling__TEST_isInvalidDecl (ClassInfo_t *input) |
| void | TCling__TransactionRollback (const cling::Transaction &T) |
| void | TCling__UnlockCompilationDuringUserCodeExecution (void *) |
| Unlock the interpreter. | |
| static void | TCling__UpdateClassInfo (const NamedDecl *TD) |
| Update TClingClassInfo for a class (e.g. upon seeing a definition). | |
| void | TCling__UpdateListsOnCommitted (const cling::Transaction &T, cling::Interpreter *) |
| void | TCling__UpdateListsOnUnloaded (const cling::Transaction &T) |
| int | TCling_GenerateDictionary (const std::string &className, const std::vector< std::string > &headers, const std::vector< std::string > &fwdDecls, const std::vector< std::string > &unknown) |
| int | TCling_GenerateDictionary (const std::vector< std::string > &classes, const std::vector< std::string > &headers, const std::vector< std::string > &fwdDecls, const std::vector< std::string > &unknown) |
| bool | TClingLookupHelper__AutoParse (const char *cname) |
| Allow calling autoparsing from TMetaUtils. | |
| bool | TClingLookupHelper__CheckInClassTable (const std::string &tname, std::string &result) |
| Check if the class name is present in TClassTable. | |
| bool | TClingLookupHelper__ExistingTypeCheck (const std::string &tname, std::string &result) |
| Try hard to avoid looking up in the Cling database as this could enduce an unwanted autoparsing. | |
Variables | |
| const char * | fantomline = "TRint::EndOfLineAction();" |
| static const std::unordered_set< std::string > | gIgnoredPCMNames |
| List of dicts that have the PCM information already in the PCH. | |
| static bool | HaveFullGlobalModuleIndex = false |
| externint | optind |
| #define R__DLLEXPORT __attribute__ ((visibility ("default"))) |
Definition at line 153 of file TCling.cxx.
|
strong |
Check in what order the member of a tuple are layout.
| Enumerator | |
|---|---|
| kAscending | |
| kDescending | |
| kUnexpected | |
Definition at line 3994 of file TCling.cxx.
|
static |
Definition at line 4036 of file TCling.cxx.
|
static |
Definition at line 8877 of file TCling.cxx.
| TInterpreter * CreateInterpreter | ( | void * | interpLibHandle, |
| const char * | argv[] ) |
Definition at line 625 of file TCling.cxx.
| void DestroyInterpreter | ( | TInterpreter * | interp | ) |
Definition at line 633 of file TCling.cxx.
|
static |
Parse the payload or header.
Definition at line 6443 of file TCling.cxx.
|
static |
Find a template decl within N nested namespaces, 0<=N<inf Assumes 1 and only 1 template present and 1 and only 1 entity contained by the namespace. Example: ns1::ns2::..::nsN::myTemplate Returns nullptr in case of error.
Definition at line 697 of file TCling.cxx.
|
static |
Definition at line 7124 of file TCling.cxx.
|
static |
This interface returns a list of dependent libraries in the form: lib libA.so libB.so libC.so.
The first library is the library we are searching dependencies for. Note: In order to speed up the search, we display the dependencies of the libraries which are not yet loaded. For instance, if libB.so was already loaded the list would contain: lib libA.so libC.so.
Definition at line 7289 of file TCling.cxx.
|
static |
Let cling process a command line.
If the command is executed and the error is 0, then the return value is the int value corresponding to the result of the executed command (float and double return values will be truncated).
Definition at line 2474 of file TCling.cxx.
|
static |
Checks if there is an ASTFile on disk for the given module M.
Definition at line 1100 of file TCling.cxx.
|
static |
Definition at line 7380 of file TCling.cxx.
|
static |
Definition at line 7401 of file TCling.cxx.
|
static |
Definition at line 1093 of file TCling.cxx.
|
static |
Definition at line 4012 of file TCling.cxx.
|
static |
Definition at line 1115 of file TCling.cxx.
|
static |
Definition at line 1065 of file TCling.cxx.
|
static |
Loads the C++ modules that we require to run any ROOT program. This is just supposed to make a C++ module from a modulemap available to the interpreter.
Definition at line 1087 of file TCling.cxx.
|
static |
Definition at line 2014 of file TCling.cxx.
|
static |
Helper to initialize TVirtualStreamerInfo's factor early. Use static initialization to insure only one TStreamerInfo is created.
Definition at line 1712 of file TCling.cxx.
|
static |
Definition at line 1218 of file TCling.cxx.
|
static |
Definition at line 1327 of file TCling.cxx.
|
static |
Definition at line 5623 of file TCling.cxx.
|
static |
Definition at line 3210 of file TCling.cxx.
| int TCling__AutoLoadCallback | ( | const char * | className | ) |
Definition at line 640 of file TCling.cxx.
| int TCling__AutoParseCallback | ( | const char * | className | ) |
Definition at line 645 of file TCling.cxx.
| int TCling__CompileMacro | ( | const char * | fileName, |
| const char * | options ) |
Definition at line 661 of file TCling.cxx.
| clang::NamespaceDecl * TCling__DEBUG__DCtoNamespace | ( | clang::DeclContext * | DC | ) |
Definition at line 220 of file TCling.cxx.
| clang::RecordDecl * TCling__DEBUG__DCtoRecordDecl | ( | clang::DeclContext * | DC | ) |
Definition at line 223 of file TCling.cxx.
| void TCling__DEBUG__decl_dump | ( | void * | D | ) |
Definition at line 235 of file TCling.cxx.
| void TCling__DEBUG__dump | ( | clang::Decl * | D | ) |
Definition at line 229 of file TCling.cxx.
| void TCling__DEBUG__dump | ( | clang::DeclContext * | DC | ) |
Definition at line 226 of file TCling.cxx.
| void TCling__DEBUG__dump | ( | clang::FunctionDecl * | FD | ) |
Definition at line 232 of file TCling.cxx.
| clang::DeclContext * TCling__DEBUG__getDeclContext | ( | clang::Decl * | D | ) |
Definition at line 217 of file TCling.cxx.
| void TCling__DEBUG__printName | ( | clang::Decl * | D | ) |
Definition at line 238 of file TCling.cxx.
| const char * TCling__GetClassSharedLibs | ( | const char * | className, |
| bool | skipCore ) |
Definition at line 650 of file TCling.cxx.
| void TCling__GetNormalizedContext | ( | const ROOT::TMetaUtils::TNormalizedCtxt *& | normCtxt | ) |
Definition at line 574 of file TCling.cxx.
| TObject * TCling__GetObjectAddress | ( | const char * | Name, |
| void *& | LookupCtx ) |
Definition at line 617 of file TCling.cxx.
| const Decl * TCling__GetObjectDecl | ( | TObject * | obj | ) |
Definition at line 621 of file TCling.cxx.
| void TCling__InvalidateGlobal | ( | const clang::Decl * | D | ) |
Definition at line 591 of file TCling.cxx.
| int TCling__IsAutoLoadNamespaceCandidate | ( | const clang::NamespaceDecl * | nsDecl | ) |
Definition at line 656 of file TCling.cxx.
| void TCling__LibraryLoadedRTTI | ( | const void * | dyLibHandle, |
| const char * | canonicalName ) |
Definition at line 600 of file TCling.cxx.
| bool TCling__LibraryLoadingFailed | ( | const std::string & | errmessage, |
| const std::string & | libStem, | ||
| bool | permanent, | ||
| bool | resolved ) |
Lookup libraries in LD_LIBRARY_PATH and DYLD_LIBRARY_PATH with mangled_name, which is extracted by error messages we get from callback from cling. Return true when the missing library was autoloaded.
Definition at line 368 of file TCling.cxx.
| void TCling__LibraryUnloadedRTTI | ( | const void * | dyLibHandle, |
| const char * | canonicalName ) |
Definition at line 610 of file TCling.cxx.
| int TCling__LoadLibrary | ( | const char * | library | ) |
Load a library.
Definition at line 349 of file TCling.cxx.
| void * TCling__LockCompilationDuringUserCodeExecution | ( | ) |
Lock the interpreter.
Definition at line 385 of file TCling.cxx.
| void TCling__PrintStackTrace | ( | ) |
Print a StackTrace!
Definition at line 342 of file TCling.cxx.
| void TCling__RegisterRdictForLoadPCM | ( | const std::string & | pcmFileNameFullPath, |
| llvm::StringRef * | pcmContent ) |
Definition at line 605 of file TCling.cxx.
| void * TCling__ResetInterpreterMutex | ( | ) |
Reset the interpreter lock to the state it had before interpreter-related calls happened.
Definition at line 377 of file TCling.cxx.
| void TCling__RestoreInterpreterMutex | ( | void * | delta | ) |
Re-apply the lock count delta that TCling__ResetInterpreterMutex() caused.
Definition at line 358 of file TCling.cxx.
| void TCling__SplitAclicMode | ( | const char * | fileName, |
| string & | mode, | ||
| string & | args, | ||
| string & | io, | ||
| string & | fname ) |
Definition at line 668 of file TCling.cxx.
| bool TCling__TEST_isInvalidDecl | ( | clang::Decl * | D | ) |
Definition at line 253 of file TCling.cxx.
| bool TCling__TEST_isInvalidDecl | ( | ClassInfo_t * | input | ) |
Definition at line 256 of file TCling.cxx.
| void TCling__TransactionRollback | ( | const cling::Transaction & | T | ) |
Definition at line 596 of file TCling.cxx.
| void TCling__UnlockCompilationDuringUserCodeExecution | ( | void * | state | ) |
Unlock the interpreter.
Definition at line 396 of file TCling.cxx.
|
static |
Update TClingClassInfo for a class (e.g. upon seeing a definition).
Definition at line 406 of file TCling.cxx.
| void TCling__UpdateListsOnCommitted | ( | const cling::Transaction & | T, |
| cling::Interpreter * | ) |
Definition at line 581 of file TCling.cxx.
| void TCling__UpdateListsOnUnloaded | ( | const cling::Transaction & | T | ) |
Definition at line 586 of file TCling.cxx.
| int TCling_GenerateDictionary | ( | const std::string & | className, |
| const std::vector< std::string > & | headers, | ||
| const std::vector< std::string > & | fwdDecls, | ||
| const std::vector< std::string > & | unknown ) |
Definition at line 837 of file TCling.cxx.
| int TCling_GenerateDictionary | ( | const std::vector< std::string > & | classes, |
| const std::vector< std::string > & | headers, | ||
| const std::vector< std::string > & | fwdDecls, | ||
| const std::vector< std::string > & | unknown ) |
Definition at line 716 of file TCling.cxx.
| bool TClingLookupHelper__AutoParse | ( | const char * | cname | ) |
Allow calling autoparsing from TMetaUtils.
Definition at line 911 of file TCling.cxx.
| bool TClingLookupHelper__CheckInClassTable | ( | const std::string & | tname, |
| std::string & | result ) |
Check if the class name is present in TClassTable.
| [in] | tname | class name to check. |
| [out] | result | If a class name has an alternative name registered in TClassTable, it will be copied into this string. |
Definition at line 1020 of file TCling.cxx.
| bool TClingLookupHelper__ExistingTypeCheck | ( | const std::string & | tname, |
| std::string & | result ) |
Try hard to avoid looking up in the Cling database as this could enduce an unwanted autoparsing.
Definition at line 920 of file TCling.cxx.
| const char* fantomline = "TRint::EndOfLineAction();" |
Definition at line 858 of file TCling.cxx.
|
static |
List of dicts that have the PCM information already in the PCH.
Definition at line 1989 of file TCling.cxx.
|
static |
Definition at line 1114 of file TCling.cxx.
| externint optind |
Definition at line 333 of file TCling.cxx.