12#ifndef ROOT_TMetaUtils
13#define ROOT_TMetaUtils
20#include <unordered_set>
25#if defined(__GNUC__) && !defined(__clang__)
26#pragma GCC diagnostic push
27#pragma GCC diagnostic ignored "-Wpragmas"
28#pragma GCC diagnostic ignored "-Wclass-memaccess"
31#include "clang/Basic/Module.h"
33#if defined(__GNUC__) && !defined(__clang__)
34#pragma GCC diagnostic pop
44 class ClassTemplateDecl;
45 class ClassTemplateSpecializationDecl;
46 class CompilerInstance;
47 class CXXBaseSpecifier;
63 class TemplateArgument;
64 class TemplateArgumentList;
65 class TemplateParameterList;
68 class TypedefNameDecl;
69 struct PrintingPolicy;
97class AnnotatedRecordDecl;
104 static const std::string
iotype(
"iotype");
105 static const std::string
name(
"name");
107 static const std::string
ioname(
"ioname");
118 const cling::Interpreter &interp,
120 std::ostream& dictStream,
121 bool isAutoStreamer);
132class TNormalizedCtxtImpl;
153 bool replace =
false);
175 bool *shuttingDownPtr,
176 const int *pgDebug = 0);
182 virtual bool IsDeclaredScope(
const std::string &base,
bool &isInlined);
191 const std::string &normalizedName);
213 const clang::RecordDecl *decl,
216 bool rRequestNoInputOperator,
217 bool rRequestOnlyTClass,
218 int rRequestedVersionNumber,
219 const cling::Interpreter &interpret,
223 const clang::RecordDecl *decl,
224 const char *requestName,
227 bool rRequestNoInputOperator,
228 bool rRequestOnlyTClass,
229 int rRequestedVersionNumber,
230 const cling::Interpreter &interpret,
235 const clang::RecordDecl *decl,
236 const char *requestedName,
239 bool rRequestNoInputOperator,
240 bool rRequestOnlyTClass,
241 int rRequestedVersionNumber,
242 const cling::Interpreter &interpret,
247 const clang::RecordDecl *decl,
248 const char *requestedName,
249 unsigned int nTemplateArgsToSkip,
252 bool rRequestNoInputOperator,
253 bool rRequestOnlyTClass,
254 int rRequestedVersionNumber,
255 const cling::Interpreter &interpret,
289 operator clang::RecordDecl
const *()
const {
316 const clang::CXXRecordDecl *
GetType()
const;
333 const std::string& propName,
334 std::string& propValue);
338 const std::string& propName,
350 const cling::Interpreter &interpret,
368const clang::FunctionDecl*
ClassInfo__HasMethod(
const clang::DeclContext *cl,
char const*,
const cling::Interpreter& interp);
371void CreateNameTypeMap(clang::CXXRecordDecl
const&, std::map<std::string, ROOT::Internal::TSchemaType>&);
375 const clang::NamedDecl &forcontext,
376 const clang::QualType &qti,
379 const cling::Interpreter &interp,
383bool IsBase(
const clang::CXXRecordDecl *cl,
const clang::CXXRecordDecl *base,
const clang::CXXRecordDecl *context,
const cling::Interpreter &interp);
386bool IsBase(
const clang::FieldDecl &
m,
const char* basename,
const cling::Interpreter &interp);
404bool HasNewMerge(clang::CXXRecordDecl
const*,
const cling::Interpreter&);
407bool HasOldMerge(clang::CXXRecordDecl
const*,
const cling::Interpreter&);
419bool NeedDestructor(clang::CXXRecordDecl
const*,
const cling::Interpreter&);
426 const cling::Interpreter&,
bool diagnose);
435void GetQualifiedName(std::string &qual_name,
const clang::QualType &
type,
const clang::NamedDecl &forcontext);
459void GetQualifiedName(std::string &qual_name,
const clang::RecordDecl &recordDecl);
474int GetClassVersion(
const clang::RecordDecl *cl,
const cling::Interpreter &interp);
489 const std::function<
void(
const clang::Module::Header &)> &closure,
490 bool includeDirectlyUsedModules =
true);
505std::string
TrueName(
const clang::FieldDecl &
m);
509 const cling::Interpreter &
gInterp,
516 const clang::CXXRecordDecl *decl,
517 const cling::Interpreter &interp,
526 const cling::Interpreter &
gInterp,
532 const cling::Interpreter &interp,
534 std::ostream& finalString,
541 const clang::CXXRecordDecl *decl,
542 const cling::Interpreter &interp,
545 bool& needCollectionProxy);
549 const clang::CXXRecordDecl* clxx,
550 const cling::Interpreter &interp,
555 const clang::CXXRecordDecl* clxx,
556 const cling::Interpreter &interp,
561llvm::StringRef
GetFileName(
const clang::Decl& decl,
562 const cling::Interpreter& interp);
601 const clang::TypeDecl* typeDecl,
602 const cling::Interpreter &interpreter);
607clang::QualType
GetTypeForIO(
const clang::QualType& templateInstanceType,
608 const cling::Interpreter &interpreter,
615std::pair<std::string,clang::QualType>
GetNameTypeForIO(
const clang::QualType& templateInstanceType,
616 const cling::Interpreter &interpreter,
622llvm::StringRef
GetComment(
const clang::Decl &decl, clang::SourceLocation *loc = 0);
626llvm::StringRef
GetClassComment(
const clang::CXXRecordDecl &decl, clang::SourceLocation *loc,
const cling::Interpreter &interpreter);
642 Redecl = Redecl->getMostRecentDecl();
643 while (Redecl && !Redecl->hasAttrs())
644 Redecl = Redecl->getPreviousDecl();
673bool IsOfType(
const clang::CXXRecordDecl &cl,
const std::string&
type,
const cling::LookupHelper& lh);
694 clang::ClassTemplateDecl*& ctd,
695 clang::ClassTemplateSpecializationDecl*& ctsd);
703 std::list<std::pair<std::string,bool> >&);
706 std::list<std::pair<std::string,bool> >&);
710 std::list<std::pair<std::string,unsigned int> >& enclosingSc);
720void ReplaceAll(std::string& str,
const std::string& from,
const std::string& to,
bool recurse=
false);
727 static unsigned int gNumberOfErrors = 0;
728 return gNumberOfErrors;
735 static bool gWarningsAreErrors =
false;
736 return gWarningsAreErrors;
747inline void LevelPrint(
bool prefix,
int level,
const char *location,
const char *fmt, va_list ap)
752 const char *
type = 0;
767 if (!location || !location[0]) {
768 if (prefix) fprintf(stderr,
"%s: ",
type);
769 vfprintf(stderr, (
const char*)
va_(fmt), ap);
771 if (prefix) fprintf(stderr,
"%s in <%s>: ",
type, location);
772 else fprintf(stderr,
"In <%s>: ", location);
773 vfprintf(stderr, (
const char*)
va_(fmt), ap);
786inline void Error(
const char *location,
const char *
va_(fmt), ...)
789 va_start(ap,
va_(fmt));
796inline void SysError(
const char *location,
const char *
va_(fmt), ...)
799 va_start(ap,
va_(fmt));
806inline void Info(
const char *location,
const char *
va_(fmt), ...)
809 va_start(ap,
va_(fmt));
816inline void Warning(
const char *location,
const char *
va_(fmt), ...)
819 va_start(ap,
va_(fmt));
826inline void Fatal(
const char *location,
const char *
va_(fmt), ...)
829 va_start(ap,
va_(fmt));
838bool EndsWith(
const std::string &theString,
const std::string &theSubstring);
841bool BeginsWith(
const std::string &theString,
const std::string &theSubstring);
850namespace AST2SourceTools {
854 bool (*ignoreFiles)(
const clang::PresumedLoc&) ,
855 const cling::Interpreter& interp);
859 const clang::TemplateParameterList& tmplParamList,
860 const cling::Interpreter& interpreter);
866const clang::RecordDecl*
EncloseInScopes(
const clang::Decl& decl, std::string& defString);
870 const cling::Interpreter& interpreter,
871 std::string& defString,
872 bool acceptStl=
false);
876 const cling::Interpreter& interpreter,
877 std::string& defString);
879int GetDefArg(
const clang::ParmVarDecl& par, std::string& valAsString,
const clang::PrintingPolicy& pp);
883 const cling::Interpreter& interpreter,
884 std::string& defString);
887 const cling::Interpreter& interpreter,
888 std::string& fwdDeclString,
889 std::unordered_set<std::string>* fwdDeclSet=
nullptr);
cling::Interpreter * gInterp
R__EXTERN Int_t gErrorIgnoreLevel
typedef void((*Func_t)())
Type
enumeration specifying the integration types.
void function(const Char_t *name_, T fun, const Char_t *docstring=0)
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
static Roo_reg_AGKInteg1D instance
static void output(int code)