12#ifndef ROOT_TMetaUtils
13#define ROOT_TMetaUtils
20#include <unordered_set>
28#if defined(__GNUC__) && !defined(__clang__)
29#pragma GCC diagnostic push
30#pragma GCC diagnostic ignored "-Wpragmas"
31#pragma GCC diagnostic ignored "-Wclass-memaccess"
34#include "clang/Basic/Module.h"
36#if defined(__GNUC__) && !defined(__clang__)
37#pragma GCC diagnostic pop
47 class ClassTemplateDecl;
48 class ClassTemplateSpecializationDecl;
49 class CompilerInstance;
50 class CXXBaseSpecifier;
66 class TemplateArgument;
67 class TemplateArgumentList;
68 class TemplateParameterList;
71 class TypedefNameDecl;
72 struct PrintingPolicy;
100class AnnotatedRecordDecl;
107 static const std::string
iotype(
"iotype");
108 static const std::string
name(
"name");
110 static const std::string
ioname(
"ioname");
121 const cling::Interpreter &interp,
123 std::ostream& dictStream,
124 bool isAutoStreamer);
156 bool replace =
false);
178 bool *shuttingDownPtr,
179 const int *pgDebug =
nullptr);
185 bool IsDeclaredScope(
const std::string &base,
bool &isInlined)
override;
194 const std::string &normalizedName);
225 const clang::RecordDecl *decl,
228 bool rRequestNoInputOperator,
229 bool rRequestOnlyTClass,
230 int rRequestedVersionNumber,
231 int rRequestedRNTupleSplitMode,
232 const cling::Interpreter &interpret,
236 const clang::RecordDecl *decl,
237 const char *requestName,
240 bool rRequestNoInputOperator,
241 bool rRequestOnlyTClass,
242 int rRequestedVersionNumber,
243 int rRequestedRNTupleSplitMode,
244 const cling::Interpreter &interpret,
248 const clang::Type *requestedType,
249 const clang::RecordDecl *decl,
250 const char *requestedName,
253 bool rRequestNoInputOperator,
254 bool rRequestOnlyTClass,
255 int rRequestedVersionNumber,
256 int rRequestedRNTupleSplitMode,
257 const cling::Interpreter &interpret,
261 const clang::Type *requestedType,
262 const clang::RecordDecl *decl,
263 const char *requestedName,
264 unsigned int nTemplateArgsToSkip,
267 bool rRequestNoInputOperator,
268 bool rRequestOnlyTClass,
269 int rRequestedVersionNumber,
270 int rRequestedRNTupleSplitMode,
271 const cling::Interpreter &interpret,
309 default: assert(
false &&
"invalid setting of fRequestedRNTupleSplitMode");
315 operator clang::RecordDecl
const *()
const {
342 const clang::CXXRecordDecl *
GetType()
const;
359 const std::string& propName,
360 std::string& propValue);
364 const std::string& propName,
371bool RequireCompleteType(
const cling::Interpreter &interp, clang::SourceLocation Loc, clang::QualType Type);
376 const cling::Interpreter &interpret,
380llvm::StringRef
DataMemberInfo__ValidArrayIndex(
const cling::Interpreter& interp,
const clang::DeclaratorDecl &
m,
int *errnum =
nullptr, llvm::StringRef *errstr =
nullptr);
394const clang::FunctionDecl*
ClassInfo__HasMethod(
const clang::DeclContext *cl,
char const*,
const cling::Interpreter& interp);
398 const clang::NamedDecl &forcontext,
399 const clang::QualType &qti,
402 const cling::Interpreter &interp,
403 const char *tcl =
nullptr);
406bool IsBase(
const clang::CXXRecordDecl *cl,
const clang::CXXRecordDecl *base,
const clang::CXXRecordDecl *context,
const cling::Interpreter &interp);
409bool IsBase(
const clang::FieldDecl &
m,
const char* basename,
const cling::Interpreter &interp);
427bool HasNewMerge(clang::CXXRecordDecl
const*,
const cling::Interpreter&);
430bool HasOldMerge(clang::CXXRecordDecl
const*,
const cling::Interpreter&);
433bool hasOpaqueTypedef(clang::QualType instanceType,
const TNormalizedCtxt &normCtxt);
436bool hasOpaqueTypedef(
const AnnotatedRecordDecl &cl,
const cling::Interpreter &interp,
const TNormalizedCtxt &normCtxt);
442bool NeedDestructor(clang::CXXRecordDecl
const*,
const cling::Interpreter&);
449 const cling::Interpreter&,
bool diagnose);
458void GetQualifiedName(std::string &qual_name,
const clang::QualType &
type,
const clang::NamedDecl &forcontext);
464void GetQualifiedName(std::string &qual_name,
const clang::Type &
type,
const clang::NamedDecl &forcontext);
476void GetQualifiedName(std::string &qual_name,
const AnnotatedRecordDecl &annotated);
482void GetQualifiedName(std::string &qual_name,
const clang::RecordDecl &recordDecl);
494void WritePointersSTL(
const AnnotatedRecordDecl &cl,
const cling::Interpreter &interp,
const TNormalizedCtxt &normCtxt);
497int GetClassVersion(
const clang::RecordDecl *cl,
const cling::Interpreter &interp);
512 const std::function<
void(
const clang::Module::Header &)> &closure,
513 bool includeDirectlyUsedModules =
true);
528std::string
TrueName(
const clang::FieldDecl &
m);
532 const cling::Interpreter &
gInterp,
534 const clang::Type** resultType);
538 const AnnotatedRecordDecl &cl,
539 const clang::CXXRecordDecl *decl,
540 const cling::Interpreter &interp,
542 const TNormalizedCtxt &normCtxt);
549 const cling::Interpreter &
gInterp,
554 const AnnotatedRecordDecl &cl,
555 const cling::Interpreter &interp,
556 const TNormalizedCtxt &normCtxt,
557 std::ostream& finalString,
563 const AnnotatedRecordDecl &cl,
564 const clang::CXXRecordDecl *decl,
565 const cling::Interpreter &interp,
566 const TNormalizedCtxt &normCtxt,
568 bool& needCollectionProxy);
572 const clang::CXXRecordDecl* clxx,
573 const cling::Interpreter &interp,
574 const TNormalizedCtxt &normCtxt);
578 const clang::CXXRecordDecl* clxx,
579 const cling::Interpreter &interp,
580 const TNormalizedCtxt &normCtxt);
584std::string
GetFileName(
const clang::Decl& decl,
const cling::Interpreter& interp);
599 std::string nameForDlsym =
name;
601#if defined(R__MACOSX) || defined(R__WIN32)
606 if (nameForDlsym[0] ==
'_')
607 nameForDlsym.erase(0, 1);
629clang::QualType
GetNormalizedType(
const clang::QualType &
type,
const cling::Interpreter &interpreter,
const TNormalizedCtxt &normCtxt);
636void GetNormalizedName(std::string &norm_name,
const clang::QualType &
type,
const cling::Interpreter &interpreter,
const TNormalizedCtxt &normCtxt);
641 const clang::TypeDecl* typeDecl,
642 const cling::Interpreter &interpreter);
647clang::QualType
GetTypeForIO(
const clang::QualType& templateInstanceType,
648 const cling::Interpreter &interpreter,
649 const TNormalizedCtxt &normCtxt,
655std::pair<std::string,clang::QualType>
GetNameTypeForIO(
const clang::QualType& templateInstanceType,
656 const cling::Interpreter &interpreter,
657 const TNormalizedCtxt &normCtxt,
662llvm::StringRef
GetComment(
const clang::Decl &decl, clang::SourceLocation *loc =
nullptr);
666bool HasClassDefMacro(
const clang::Decl *decl,
const cling::Interpreter &interpreter);
670llvm::StringRef
GetClassComment(
const clang::CXXRecordDecl &decl, clang::SourceLocation *loc,
const cling::Interpreter &interpreter);
686 Redecl = Redecl->getMostRecentDecl();
687 while (Redecl && !Redecl->hasAttrs())
688 Redecl = Redecl->getPreviousDecl();
727bool IsOfType(
const clang::CXXRecordDecl &cl,
const std::string&
type,
const cling::LookupHelper& lh);
748 clang::ClassTemplateDecl*& ctd,
749 clang::ClassTemplateSpecializationDecl*& ctsd);
757 std::list<std::pair<std::string,bool> >&);
760 std::list<std::pair<std::string,bool> >&);
764 std::list<std::pair<std::string,unsigned int> >& enclosingSc);
774void ReplaceAll(std::string& str,
const std::string& from,
const std::string& to,
bool recurse=
false);
781 static unsigned int gNumberOfErrors = 0;
782 return gNumberOfErrors;
789 static bool gWarningsAreErrors =
false;
790 return gWarningsAreErrors;
801inline void LevelPrint(
bool prefix,
int level,
const char *location,
const char *fmt, va_list ap)
806 const char *
type =
nullptr;
821 if (!location || !location[0]) {
822 if (prefix) fprintf(stderr,
"%s: ",
type);
823 vfprintf(stderr, (
const char*)
va_(fmt), ap);
825 if (prefix) fprintf(stderr,
"%s in <%s>: ",
type, location);
826 else fprintf(stderr,
"In <%s>: ", location);
827 vfprintf(stderr, (
const char*)
va_(fmt), ap);
840inline void Error(
const char *location,
const char *
va_(fmt), ...)
843 va_start(ap,
va_(fmt));
850inline void SysError(
const char *location,
const char *
va_(fmt), ...)
853 va_start(ap,
va_(fmt));
860inline void Info(
const char *location,
const char *
va_(fmt), ...)
863 va_start(ap,
va_(fmt));
870inline void Warning(
const char *location,
const char *
va_(fmt), ...)
873 va_start(ap,
va_(fmt));
880inline void Fatal(
const char *location,
const char *
va_(fmt), ...)
883 va_start(ap,
va_(fmt));
892bool EndsWith(
const std::string &theString,
const std::string &theSubstring);
895bool BeginsWith(
const std::string &theString,
const std::string &theSubstring);
904namespace AST2SourceTools {
908 bool (*ignoreFiles)(
const clang::PresumedLoc&) ,
909 const cling::Interpreter& interp, std::string *logs);
913 const clang::TemplateParameterList& tmplParamList,
914 const cling::Interpreter& interpreter);
920const clang::RecordDecl*
EncloseInScopes(
const clang::Decl& decl, std::string& defString);
924 const cling::Interpreter& interpreter,
925 std::string& defString,
926 bool acceptStl=
false);
930 const cling::Interpreter& interpreter,
931 std::string& defString);
935 const cling::Interpreter& interpreter,
936 std::string& defString,
937 const std::string &normalizedName);
939int GetDefArg(
const clang::ParmVarDecl& par, std::string& valAsString,
const clang::PrintingPolicy& pp);
943 const cling::Interpreter& interpreter,
944 std::string& defString);
947 const cling::Interpreter& interpreter,
948 std::string& fwdDeclString,
949 std::unordered_set<std::string>* fwdDeclSet=
nullptr);
static Roo_reg_AGKInteg1D instance
cling::Interpreter * gInterp
Int_t gErrorIgnoreLevel
Error handling routines.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void input
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 filename
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 result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
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
Type
enumeration specifying the integration types.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...