34#include "cling/Interpreter/Interpreter.h"
35#include "cling/Interpreter/LookupHelper.h"
36#include "cling/Utils/AST.h"
38#include "clang/AST/ASTContext.h"
39#include "clang/AST/Decl.h"
40#include "clang/AST/DeclCXX.h"
41#include "clang/AST/DeclTemplate.h"
42#include "clang/AST/GlobalDecl.h"
43#include "clang/AST/PrettyPrinter.h"
44#include "clang/AST/RecordLayout.h"
45#include "clang/AST/Type.h"
46#include "clang/Basic/Specifiers.h"
47#include "clang/Frontend/CompilerInstance.h"
48#include "clang/Sema/Sema.h"
50#include "llvm/ExecutionEngine/GenericValue.h"
51#include "llvm/Support/Casting.h"
52#include "llvm/Support/raw_ostream.h"
65 if (
const NamedDecl* ND = llvm::dyn_cast<NamedDecl>(decl)) {
66 PrintingPolicy Policy(decl->getASTContext().getPrintingPolicy());
67 llvm::raw_string_ostream stream(buf);
68 ND->getNameForDiagnostic(stream, Policy,
true);
74 :
TClingDeclInfo(nullptr), fInterp(interp), fFirstTime(true), fDescend(false), fIterAll(all),
75 fIsIter(true), fOffsetCache(0)
77 TranslationUnitDecl *TU =
78 interp->getCI()->getASTContext().getTranslationUnitDecl();
84 :
TClingDeclInfo(nullptr), fInterp(interp), fFirstTime(true), fDescend(false), fIterAll(
kTRUE), fIsIter(false),
87 const cling::LookupHelper& lh =
fInterp->getLookupHelper();
88 const Type *
type =
nullptr;
89 const Decl *decl = lh.findScope(
name,
90 gDebug > 5 ? cling::LookupHelper::WithDiagnostics
91 : cling::LookupHelper::NoDiagnostics,
92 &
type, intantiateTemplate);
96 decl = lh.findScope(buf,
97 gDebug > 5 ? cling::LookupHelper::WithDiagnostics
98 : cling::LookupHelper::NoDiagnostics,
99 &
type, intantiateTemplate);
103 if (
const auto *TD =
type->getAsTagDecl()) {
109 if (decl && decl->isInvalidDecl()) {
110 Error(
"TClingClassInfo",
"Found an invalid decl for %s.",
name);
118 :
TClingDeclInfo(nullptr), fInterp(interp), fFirstTime(true), fDescend(false), fIterAll(
kTRUE),
119 fIsIter(false), fOffsetCache(0)
155 const RecordDecl *RD = llvm::dyn_cast<RecordDecl>(
GetDecl());
158 cling::Interpreter::PushTransactionRAII RAII(
fInterp);
170 const CXXRecordDecl *CRD =
171 llvm::dyn_cast<CXXRecordDecl>(
GetDecl());
175 if (CRD->isAbstract()) {
178 if (CRD->hasUserDeclaredConstructor()) {
182 !CRD->hasUserDeclaredConstructor() &&
183 !CRD->hasTrivialDefaultConstructor()
188 CRD->hasUserProvidedDefaultConstructor() ||
189 !CRD->hasTrivialDefaultConstructor()
193 if (CRD->hasUserDeclaredDestructor()) {
196 else if (!CRD->hasTrivialDestructor()) {
199 if (CRD->hasUserDeclaredCopyAssignment()) {
202 if (CRD->isPolymorphic()) {
205 if (CRD->isAggregate() || CRD->isPOD()) {
209 if (CRD->hasDefinition() &&
fInterp->getSema().IsCXXTriviallyRelocatableType(*CRD)) {
224 Error(
"TClingClassInfo::Delete()",
"Called while invalid!");
228 Error(
"TClingClassInfo::Delete()",
"Class is not loaded: %s",
249 Error(
"DeleteArray",
"Placement delete of an array is unsupported!\n");
276 const TypedefType *TT = llvm::dyn_cast<TypedefType>(
fType);
278 llvm::StringRef tname(TT->getDecl()->getName());
279 if (tname == fname) {
280 const NamedDecl *ndecl = llvm::dyn_cast<NamedDecl>(
GetDecl());
281 if (ndecl && ndecl->getName() != fname) {
288 const cling::LookupHelper &lh =
fInterp->getLookupHelper();
289 const FunctionTemplateDecl *fd
290 = lh.findFunctionTemplate(
GetDecl(), fname,
291 gDebug > 5 ? cling::LookupHelper::WithDiagnostics
292 : cling::LookupHelper::NoDiagnostics,
false);
293 if (fd)
return fd->getCanonicalDecl();
302 const cling::LookupHelper &lh =
fInterp->getLookupHelper();
305 gDebug > 5 ? cling::LookupHelper::WithDiagnostics
306 : cling::LookupHelper::NoDiagnostics);
307 if (vd)
return llvm::dyn_cast<ValueDecl>(vd->getCanonicalDecl());
323 const TypedefType *TT = llvm::dyn_cast<TypedefType>(
fType);
325 llvm::StringRef tname(TT->getDecl()->getName());
326 if (tname == fname) {
327 const NamedDecl *ndecl = llvm::dyn_cast<NamedDecl>(
GetDecl());
328 if (ndecl && ndecl->getName() != fname) {
330 return GetMethod(ndecl->getName().str().c_str());
335 const cling::LookupHelper &lh =
fInterp->getLookupHelper();
336 const FunctionDecl *fd
337 = lh.findAnyFunction(
GetDecl(), fname,
338 gDebug > 5 ? cling::LookupHelper::WithDiagnostics
339 : cling::LookupHelper::NoDiagnostics,
359 const char *proto,
bool objectIsConst,
374 const TypedefType *TT = llvm::dyn_cast<TypedefType>(
fType);
376 llvm::StringRef tname(TT->getDecl()->getName());
377 if (tname == fname) {
378 const NamedDecl *ndecl = llvm::dyn_cast<NamedDecl>(
GetDecl());
379 if (ndecl && ndecl->getName() != fname) {
381 return GetMethod(ndecl->getName().str().c_str(),proto,
382 objectIsConst,poffset,
389 const cling::LookupHelper& lh =
fInterp->getLookupHelper();
390 const FunctionDecl *fd;
392 fd = lh.findFunctionProto(
GetDecl(), fname, proto,
393 gDebug > 5 ? cling::LookupHelper::WithDiagnostics
394 : cling::LookupHelper::NoDiagnostics,
397 fd = lh.matchFunctionProto(
GetDecl(), fname, proto,
398 gDebug > 5 ? cling::LookupHelper::WithDiagnostics
399 : cling::LookupHelper::NoDiagnostics,
402 Error(
"TClingClassInfo::GetMethod",
403 "The MatchMode %d is not supported.",
mode);
421 const clang::DeclContext* ourDC = llvm::dyn_cast<clang::DeclContext>(
GetDecl());
422 if (!fd->getDeclContext()->Equals(ourDC)
423 && !(fd->getDeclContext()->isTransparentContext()
424 && fd->getDeclContext()->getParent()->Equals(ourDC)))
428 if (poffset) *poffset = 0;
432 if (
const CXXMethodDecl *md =
433 llvm::dyn_cast<CXXMethodDecl>(fd)) {
445 const llvm::SmallVectorImpl<clang::QualType> &proto,
453 const llvm::SmallVectorImpl<clang::QualType> &proto,
bool objectIsConst,
468 const TypedefType *TT = llvm::dyn_cast<TypedefType>(
fType);
470 llvm::StringRef tname(TT->getDecl()->getName());
471 if (tname == fname) {
472 const NamedDecl *ndecl = llvm::dyn_cast<NamedDecl>(
GetDecl());
473 if (ndecl && ndecl->getName() != fname) {
475 return GetMethod(ndecl->getName().str().c_str(),proto,objectIsConst,poffset,
482 const cling::LookupHelper& lh =
fInterp->getLookupHelper();
483 const FunctionDecl *fd;
485 fd = lh.findFunctionProto(
GetDecl(), fname, proto,
486 gDebug > 5 ? cling::LookupHelper::WithDiagnostics
487 : cling::LookupHelper::NoDiagnostics,
490 fd = lh.matchFunctionProto(
GetDecl(), fname, proto,
491 gDebug > 5 ? cling::LookupHelper::WithDiagnostics
492 : cling::LookupHelper::NoDiagnostics,
495 Error(
"TClingClassInfo::GetMethod",
496 "The MatchMode %d is not supported.",
mode);
507 if (
const CXXMethodDecl *md =
508 llvm::dyn_cast<CXXMethodDecl>(fd)) {
526 const char *arglist,
bool objectIsConst,
534 const TypedefType *TT = llvm::dyn_cast<TypedefType>(
fType);
536 llvm::StringRef tname(TT->getDecl()->getName());
537 if (tname == fname) {
538 const NamedDecl *ndecl = llvm::dyn_cast<NamedDecl>(
GetDecl());
539 if (ndecl && ndecl->getName() != fname) {
541 return GetMethod(ndecl->getName().str().c_str(),arglist,
542 objectIsConst,poffset
556 if (!strcmp(arglist,
")")) {
560 const cling::LookupHelper &lh =
fInterp->getLookupHelper();
561 const FunctionDecl *fd
562 = lh.findFunctionArgs(
GetDecl(), fname, arglist,
563 gDebug > 5 ? cling::LookupHelper::WithDiagnostics
564 : cling::LookupHelper::NoDiagnostics,
573 if (
const CXXMethodDecl *md =
574 llvm::dyn_cast<CXXMethodDecl>(fd)) {
599 clang_val =
static_cast<int>(num_params);
610 const CXXRecordDecl* definer = md->getParent();
611 const CXXRecordDecl* accessor =
612 llvm::cast<CXXRecordDecl>(
GetDecl());
613 if (definer != accessor) {
620 if (bci->
GetDecl() == definer) {
640 std::pair<ptrdiff_t, OffsetPtrFunc_t> offsetCache = (*iter).second;
643 return (*executableFunc)(address, isDerivedObject);
646 Error(
"TClingBaseClassInfo::Offset",
"The address of the object for virtual base offset calculation is not valid.");
651 return offsetCache.first;
659 return binfo.
Offset(address, isDerivedObject);
665 std::vector<std::string> res;
669 cling::Interpreter::PushTransactionRAII RAII(
fInterp);
670 const auto DC = dyn_cast<DeclContext>(
fDecl);
674 clang::PrintingPolicy policy(
fDecl->getASTContext().getPrintingPolicy());
675 for (
auto UD : DC->using_directives()) {
676 NamespaceDecl *NS = UD->getNominatedNamespace();
679 llvm::raw_string_ostream stream(nsName);
681 NS->getNameForDiagnostic(stream, policy,
true);
684 res.push_back(nsName);
705 return EIOCtorCategory::kAbsent;
707 auto CRD = llvm::dyn_cast<CXXRecordDecl>(
GetDecl());
710 return EIOCtorCategory::kAbsent;
713 auto kind = CheckIOConstructor(CRD,
"TRootIOCtor",
nullptr, *
fInterp);
714 if ((kind == EIOCtorCategory::kIORefType) || (kind == EIOCtorCategory::kIOPtrType)) {
715 if (type_name) *type_name =
"TRootIOCtor";
719 kind = CheckIOConstructor(CRD,
"__void__",
nullptr, *
fInterp);
720 if (kind == EIOCtorCategory::kIORefType) {
721 if (type_name) *type_name =
"__void__";
726 return CheckDefaultConstructor(CRD, *
fInterp) ? EIOCtorCategory::kDefault : EIOCtorCategory::kAbsent;
733 return fInterp->getLookupHelper()
735 gDebug > 5 ? cling::LookupHelper::WithDiagnostics
736 : cling::LookupHelper::NoDiagnostics);
746 fIter = DeclContext::decl_iterator();
750 const cling::LookupHelper& lh =
fInterp->getLookupHelper();
752 : cling::LookupHelper::NoDiagnostics,
757 SetDecl(lh.findScope(buf,
gDebug > 5 ? cling::LookupHelper::WithDiagnostics
758 : cling::LookupHelper::NoDiagnostics,
763 if (
const auto *TD =
fType->getAsTagDecl()) {
774 fIter = DeclContext::decl_iterator();
782 Fatal(
"TClingClassInfo::Init(tagnum)",
"Should no longer be called");
792 if (
const auto *TD =
fType->getAsTagDecl()) {
798 QualType qType(
fType,0);
799 static PrintingPolicy printPol(
fInterp->getCI()->getLangOpts());
800 printPol.SuppressScope =
false;
801 Error(
"TClingClassInfo::Init(const Type&)",
802 "The given type %s does not point to a Decl",
803 qType.getAsString(printPol).c_str());
819 const CXXRecordDecl *CRD =
820 llvm::dyn_cast<CXXRecordDecl>(
GetDecl());
826 const CXXRecordDecl *baseCRD =
827 llvm::dyn_cast<CXXRecordDecl>(base.
GetDecl());
828 return CRD->isDerivedFrom(baseCRD);
844 if (
auto *ED = llvm::dyn_cast<clang::EnumDecl>(
GetDecl()))
845 return ED->isScoped();
856 if (
auto ED = llvm::dyn_cast<EnumDecl>(
GetDecl())) {
858 auto Ty = ED->getIntegerType().getTypePtrOrNull();
860 Ty = Ty->getUnqualifiedDesugaredType();
861 if (
auto BTy = llvm::dyn_cast_or_null<BuiltinType>(Ty)) {
862 switch (BTy->getKind()) {
863 case BuiltinType::Bool:
866 case BuiltinType::Char_U:
867 case BuiltinType::UChar:
870 case BuiltinType::Char_S:
871 case BuiltinType::SChar:
874 case BuiltinType::UShort:
876 case BuiltinType::Short:
878 case BuiltinType::UInt:
880 case BuiltinType::Int:
882 case BuiltinType::ULong:
884 case BuiltinType::Long:
886 case BuiltinType::ULongLong:
888 case BuiltinType::LongLong:
914 const CXXRecordDecl *CRD = llvm::dyn_cast<CXXRecordDecl>(
GetDecl());
916 if (!CRD->hasDefinition()) {
920 const TagDecl *TD = llvm::dyn_cast<TagDecl>(
GetDecl());
921 if (TD && TD->getDefinition() ==
nullptr) {
952 cling::Interpreter::PushTransactionRAII RAII(
fInterp);
955 const clang::DeclContext *DC = cast<DeclContext>(
GetDecl());
957 fIter = DC->decls_begin();
959 fIter = DC->noload_decls_begin();
966 if (
const NamedDecl* ND =
967 llvm::dyn_cast<NamedDecl>(
GetDecl())) {
968 PrintingPolicy Policy(
GetDecl()->getASTContext().
969 getPrintingPolicy());
970 llvm::raw_string_ostream stream(buf);
971 ND->getNameForDiagnostic(stream, Policy,
false);
973 Error(
"TClingClassInfo::InternalNext",
974 "Next called but iteration not prepared for %s!", buf.c_str());
976 Error(
"TClingClassInfo::InternalNext",
977 "Next called but iteration not prepared!");
1005 DeclContext *DC = llvm::cast<DeclContext>(*
fIter);
1007 fIter = DC->decls_begin();
1009 fIter = DC->noload_decls_begin();
1029 Decl::Kind DK =
fIter->getKind();
1030 if ((DK == Decl::Namespace) || (DK == Decl::Enum) ||
1031 (DK == Decl::CXXRecord) ||
1032 (DK == Decl::ClassTemplateSpecialization)) {
1033 const TagDecl *TD = llvm::dyn_cast<TagDecl>(*
fIter);
1034 if (TD && !TD->isCompleteDefinition()) {
1038 if (DK == Decl::Namespace) {
1040 if (!
fIter->isCanonicalDecl()) {
1046 if (DK != Decl::Enum) {
1048 DeclContext *DC = llvm::cast<DeclContext>(*
fIter);
1049 if ((
fIterAll && *DC->decls_begin())
1050 || (!
fIterAll && *DC->noload_decls_begin())) {
1060 if (
GetDecl()->isInvalidDecl()) {
1061 Warning(
"TClingClassInfo::Next()",
"Reached an invalid decl.");
1063 if (
const RecordDecl *RD =
1064 llvm::dyn_cast<RecordDecl>(
GetDecl())) {
1065 fType = RD->getASTContext().getCanonicalTagType(RD).getTypePtr();
1083 Error(
"TClingClassInfo::New()",
"Called while invalid!");
1087 Error(
"TClingClassInfo::New()",
"Class is not loaded: %s",
1093 std::string type_name;
1097 auto RD = dyn_cast<CXXRecordDecl>(
GetDecl());
1099 Error(
"TClingClassInfo::New()",
"This is a namespace!: %s",
1113 void* obj =
nullptr;
1118 Error(
"TClingClassInfo::New()",
"Call of default constructor "
1119 "failed to return an object for class: %s",
1132 Error(
"TClingClassInfo::New(n)",
"Called while invalid!");
1136 Error(
"TClingClassInfo::New(n)",
"Class is not loaded: %s",
1142 std::string type_name;
1147 auto RD = dyn_cast<CXXRecordDecl>(
GetDecl());
1149 Error(
"TClingClassInfo::New(n)",
"This is a namespace!: %s",
1163 void* obj =
nullptr;
1166 nullptr, (
unsigned long)
n);
1168 Error(
"TClingClassInfo::New(n)",
"Call of default constructor "
1169 "failed to return an array of class: %s",
1183 Error(
"TClingClassInfo::New(n, arena)",
"Called while invalid!");
1187 Error(
"TClingClassInfo::New(n, arena)",
"Class is not loaded: %s",
1193 std::string type_name;
1198 auto RD = dyn_cast<CXXRecordDecl>(
GetDecl());
1200 Error(
"TClingClassInfo::New(n, arena)",
"This is a namespace!: %s",
1214 void* obj =
nullptr;
1218 arena, (
unsigned long)
n);
1228 Error(
"TClingClassInfo::New(arena)",
"Called while invalid!");
1232 Error(
"TClingClassInfo::New(arena)",
"Class is not loaded: %s",
1238 std::string type_name;
1243 auto RD = dyn_cast<CXXRecordDecl>(
GetDecl());
1245 Error(
"TClingClassInfo::New(arena)",
"This is a namespace!: %s",
1259 void* obj =
nullptr;
1279 cling::Interpreter::PushTransactionRAII RAII(
fInterp);
1281 const clang::DeclContext *ctxt =
GetDecl()->getDeclContext();
1282 clang::NamespaceDecl *std_ns =
fInterp->getSema().getStdNamespace();
1283 while (ctxt && ! ctxt->isTranslationUnit()) {
1284 if (ctxt->Equals(std_ns)) {
1288 ctxt = ctxt->getParent();
1290 Decl::Kind DK =
GetDecl()->getKind();
1291 if ((DK == Decl::Namespace) || (DK == Decl::TranslationUnit)) {
1296 const TagDecl *TD = llvm::dyn_cast<TagDecl>(
GetDecl());
1305 const CXXRecordDecl *CRD =
1306 llvm::dyn_cast<CXXRecordDecl>(
GetDecl());
1310 if (CRD->isClass()) {
1312 }
else if (CRD->isStruct()) {
1314 }
else if (CRD->isUnion()) {
1317 if (CRD->hasDefinition() && CRD->isAbstract()) {
1350 Decl::Kind DK =
GetDecl()->getKind();
1351 if (DK == Decl::Namespace) {
1355 else if (DK == Decl::Enum) {
1359 const RecordDecl *RD = llvm::dyn_cast<RecordDecl>(
GetDecl());
1364 if (!RD->getDefinition()) {
1368 ASTContext &Context =
GetDecl()->getASTContext();
1369 cling::Interpreter::PushTransactionRAII RAII(
fInterp);
1370 const ASTRecordLayout &Layout = Context.getASTRecordLayout(RD);
1371 int64_t
size = Layout.getSize().getQuantity();
1372 int clang_size =
static_cast<int>(
size);
1394 Decl::Kind DK =
GetDecl()->getKind();
1395 if (DK == Decl::Namespace) {
1397 }
else if (DK == Decl::Enum) {
1400 const RecordDecl *RD = llvm::dyn_cast<RecordDecl>(
GetDecl());
1404 if (!RD->getDefinition()) {
1408 ASTContext &Context =
GetDecl()->getASTContext();
1409 cling::Interpreter::PushTransactionRAII RAII(
fInterp);
1410 const ASTRecordLayout &Layout = Context.getASTRecordLayout(RD);
1411 auto align = Layout.getAlignment().getQuantity();
1446 if (
const NamedDecl* ND =
1447 llvm::dyn_cast<NamedDecl>(
GetDecl())) {
1448 PrintingPolicy Policy(
GetDecl()->getASTContext().
1449 getPrintingPolicy());
1450 llvm::raw_string_ostream stream(output);
1451 ND->getNameForDiagnostic(stream, Policy,
true);
1469 if (
const TagDecl *TD = llvm::dyn_cast<TagDecl>(
GetDecl())) {
1471 if (AnnotateAttr *A = TD->getAttr<AnnotateAttr>()) {
1472 std::string
attr = A->getAnnotation().str();
1488 const CXXRecordDecl *CRD =
1489 llvm::dyn_cast<CXXRecordDecl>(
GetDecl());
1490 if (CRD && !CRD->isFromASTFile()) {
1505 TTHREAD_TLS_DECL( std::string, buf);
1507 if (
const NamedDecl* ND = llvm::dyn_cast<NamedDecl>(
GetDecl())) {
1509 buf = ND->getNameAsString();
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
long Longptr_t
Integer large enough to hold a pointer (platform-dependent)
static std::string FullyQualifiedName(const Decl *decl)
ptrdiff_t(* OffsetPtrFunc_t)(void *, bool)
@ kClassIsTriviallyRelocatable
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
void Fatal(const char *location, const char *msgfmt,...)
Use this function in case of a fatal error. It will abort the program.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t attr
Option_t Option_t TPoint TPoint const char mode
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t property
R__EXTERN TVirtualMutex * gInterpreterMutex
Int_t gDebug
Global variable setting the debug level. Set to 0 to disable, increase it in steps of 1 to increase t...
#define R__LOCKGUARD(mutex)
#define R__WRITE_LOCKGUARD(mutex)
Emulation of the CINT BaseClassInfo class.
ptrdiff_t Offset(void *address=0, bool isDerivedObject=true) const
TClingClassInfo * GetBase() const
Emulation of the CINT CallFunc class.
void * ExecDefaultConstructor(const TClingClassInfo *info, ROOT::TMetaUtils::EIOCtorCategory kind, const std::string &type_name, void *address=nullptr, unsigned long nary=0UL)
void ExecDestructor(const TClingClassInfo *info, void *address=nullptr, unsigned long nary=0UL, bool withFree=true)
Emulation of the CINT ClassInfo class.
clang::DeclContext::decl_iterator fIter
static bool IsEnum(cling::Interpreter *interp, const char *name)
long ClassProperty() const
void Init(const char *name)
void FullName(std::string &output, const ROOT::TMetaUtils::TNormalizedCtxt &normCtxt) const
llvm::DenseMap< const clang::Decl *, std::pair< ptrdiff_t, OffsetPtrFunc_t > > fOffsetCache
EDataType GetUnderlyingType() const
size_t GetAlignOf() const
Return the alignment of the class in bytes as reported by clang.
std::mutex fOffsetCacheMutex
const char * TmpltName() const
void AddBaseOffsetValue(const clang::Decl *decl, ptrdiff_t offset)
Longptr_t GetOffset(const clang::CXXMethodDecl *md) const
ptrdiff_t GetBaseOffset(TClingClassInfo *toBase, void *address, bool isDerivedObject)
void SetDecl(const clang::Decl *D)
bool IsScopedEnum() const
ROOT::TMetaUtils::EIOCtorCategory HasDefaultConstructor(bool checkio=false, std::string *type_name=nullptr) const
TClingMethodInfo GetMethodWithArgs(const char *fname, const char *arglist, Longptr_t *poffset, ROOT::EFunctionMatchMode mode=ROOT::kConversionMatch, EInheritanceMode imode=kWithInheritance) const
const clang::FunctionTemplateDecl * GetFunctionTemplate(const char *fname) const
int GetMethodNArg(const char *method, const char *proto, Bool_t objectIsConst, ROOT::EFunctionMatchMode mode=ROOT::kConversionMatch) const
bool IsValidMethod(const char *method, const char *proto, Bool_t objectIsConst, Longptr_t *offset, ROOT::EFunctionMatchMode mode=ROOT::kConversionMatch) const
bool HasMethod(const char *name) const
std::string fDeclFileName
void DeleteArray(void *arena, bool dtorOnly, const ROOT::TMetaUtils::TNormalizedCtxt &normCtxt) const
void * New(const ROOT::TMetaUtils::TNormalizedCtxt &normCtxt) const
TClingMethodInfo GetMethod(const char *fname) const
const clang::ValueDecl * GetDataMember(const char *name) const
int Size() const
Return the size of the class in bytes as reported by clang.
void Destruct(void *arena, const ROOT::TMetaUtils::TNormalizedCtxt &normCtxt) const
std::vector< std::string > GetUsingNamespaces()
cling::Interpreter * fInterp
std::vector< clang::DeclContext::decl_iterator > fIterStack
bool IsBase(const char *name) const
const clang::Type * fType
void Delete(void *arena, const ROOT::TMetaUtils::TNormalizedCtxt &normCtxt) const
const clang::Decl * fDecl
virtual bool IsValid() const
virtual const clang::Decl * GetDecl() const
Emulation of the CINT MethodInfo class.
const clang::FunctionDecl * GetTargetFunctionDecl() const
Get the FunctionDecl, or if this represents a UsingShadowDecl, the underlying target FunctionDecl.
void Init(const clang::FunctionDecl *)
constexpr bool IsValidAlignment(std::size_t align) noexcept
Return true if align is a valid C++ alignment value: strictly positive and a power of two.
R__EXTERN TVirtualRWMutex * gCoreMutex
std::string InsertStd(const char *tname)