12 #ifndef ROOT_TMetaUtils
13 #define ROOT_TMetaUtils
19 #include <unordered_set>
31 class ClassTemplateDecl;
32 class ClassTemplateSpecializationDecl;
33 class CompilerInstance;
34 class CXXBaseSpecifier;
50 class TemplateArgument;
51 class TemplateArgumentList;
52 class TemplateParameterList;
55 class TypedefNameDecl;
56 struct PrintingPolicy;
80 namespace TMetaUtils {
83 class AnnotatedRecordDecl;
89 static const std::string
separator(
"@@@");
90 static const std::string
iotype(
"iotype");
91 static const std::string
name(
"name");
92 static const std::string
pattern(
"pattern");
93 static const std::string
ioname(
"ioname");
94 static const std::string
comment(
"comment");
95 static const std::string
nArgsToKeep(
"nArgsToKeep");
96 static const std::string
persistent(
"persistent");
97 static const std::string
transient(
"transient");
106 const cling::Interpreter &interp,
108 std::ostream& dictStream,
109 bool isAutoStreamer);
121 class TNormalizedCtxtImpl;
142 bool replace =
false);
163 const int *pgDebug = 0);
169 virtual bool IsDeclaredScope(
const std::string &base,
bool &isInlined);
196 const clang::RecordDecl *decl,
199 bool rRequestNoInputOperator,
200 bool rRequestOnlyTClass,
201 int rRequestedVersionNumber,
202 const cling::Interpreter &interpret,
206 const clang::RecordDecl *decl,
207 const char *requestName,
210 bool rRequestNoInputOperator,
211 bool rRequestOnlyTClass,
212 int rRequestedVersionNumber,
213 const cling::Interpreter &interpret,
218 const clang::RecordDecl *decl,
219 const char *requestedName,
222 bool rRequestNoInputOperator,
223 bool rRequestOnlyTClass,
224 int rRequestedVersionNumber,
225 const cling::Interpreter &interpret,
230 const clang::RecordDecl *decl,
231 const char *requestedName,
232 unsigned int nTemplateArgsToSkip,
235 bool rRequestNoInputOperator,
236 bool rRequestOnlyTClass,
237 int rRequestedVersionNumber,
238 const cling::Interpreter &interpret,
271 operator clang::RecordDecl
const *()
const {
298 const clang::CXXRecordDecl *
GetType()
const;
318 const std::string& propName,
319 std::string& propValue);
323 const std::string& propName,
327 bool RequireCompleteType(
const cling::Interpreter &interp,
const clang::CXXRecordDecl *cl);
335 const cling::Interpreter &interpret,
351 const clang::FunctionDecl*
ClassInfo__HasMethod(
const clang::DeclContext *cl,
char const*,
const cling::Interpreter& interp);
358 const clang::NamedDecl &forcontext,
359 const clang::QualType &qti,
362 const cling::Interpreter &interp,
366 bool IsBase(
const clang::CXXRecordDecl *cl,
const clang::CXXRecordDecl *base,
const clang::CXXRecordDecl *context,
const cling::Interpreter &interp);
369 bool IsBase(
const clang::FieldDecl &
m,
const char* basename,
const cling::Interpreter &interp);
387 bool HasNewMerge(clang::CXXRecordDecl
const*,
const cling::Interpreter&);
390 bool HasOldMerge(clang::CXXRecordDecl
const*,
const cling::Interpreter&);
393 bool hasOpaqueTypedef(clang::QualType instanceType,
const TNormalizedCtxt &normCtxt);
396 bool hasOpaqueTypedef(
const AnnotatedRecordDecl &cl,
const cling::Interpreter &interp,
const TNormalizedCtxt &normCtxt);
409 const cling::Interpreter&,
bool diagnose);
418 void GetQualifiedName(std::string &qual_name,
const clang::QualType &
type,
const clang::NamedDecl &forcontext);
436 void GetQualifiedName(std::string &qual_name,
const AnnotatedRecordDecl &annotated);
442 void GetQualifiedName(std::string &qual_name,
const clang::RecordDecl &recordDecl);
454 void WritePointersSTL(
const AnnotatedRecordDecl &cl,
const cling::Interpreter &interp,
const TNormalizedCtxt &normCtxt);
457 int GetClassVersion(
const clang::RecordDecl *cl,
const cling::Interpreter &interp);
481 std::string
TrueName(
const clang::FieldDecl &
m);
485 const cling::Interpreter &
gInterp,
491 const AnnotatedRecordDecl &cl,
492 const clang::CXXRecordDecl *decl,
493 const cling::Interpreter &interp,
495 const TNormalizedCtxt &normCtxt);
502 const cling::Interpreter &
gInterp,
507 const AnnotatedRecordDecl &cl,
508 const cling::Interpreter &interp,
509 const TNormalizedCtxt &normCtxt,
510 std::ostream& finalString,
516 const AnnotatedRecordDecl &cl,
517 const clang::CXXRecordDecl *decl,
518 const cling::Interpreter &interp,
519 const TNormalizedCtxt &normCtxt,
521 bool& needCollectionProxy);
525 const clang::CXXRecordDecl* clxx,
526 const cling::Interpreter &interp,
527 const TNormalizedCtxt &normCtxt);
531 const clang::CXXRecordDecl* clxx,
532 const cling::Interpreter &interp,
533 const TNormalizedCtxt &normCtxt);
537 llvm::StringRef
GetFileName(
const clang::Decl& decl,
538 const cling::Interpreter& interp);
547 const char* moduleFileName,
548 const char* headers[]);
583 clang::QualType
GetNormalizedType(
const clang::QualType &
type,
const cling::Interpreter &interpreter,
const TNormalizedCtxt &normCtxt);
590 void GetNormalizedName(std::string &norm_name,
const clang::QualType &
type,
const cling::Interpreter &interpreter,
const TNormalizedCtxt &normCtxt);
595 const clang::TypeDecl* typeDecl,
596 const cling::Interpreter &interpreter);
600 llvm::StringRef
GetComment(
const clang::Decl &decl, clang::SourceLocation *loc = 0);
604 llvm::StringRef
GetClassComment(
const clang::CXXRecordDecl &decl, clang::SourceLocation *loc,
const cling::Interpreter &interpreter);
620 Redecl = Redecl->getMostRecentDecl();
621 while (Redecl && !Redecl->hasAttrs())
622 Redecl = Redecl->getPreviousDecl();
651 bool IsOfType(
const clang::CXXRecordDecl &cl,
const std::string&
type,
const cling::LookupHelper& lh);
672 clang::ClassTemplateDecl*& ctd,
673 clang::ClassTemplateSpecializationDecl*& ctsd);
681 std::list<std::pair<std::string,bool> >&);
684 std::list<std::pair<std::string,bool> >&);
688 std::list<std::pair<std::string,unsigned int> >& enclosingSc);
698 void ReplaceAll(std::string& str,
const std::string& from,
const std::string& to,
bool recurse=
false);
703 void LevelPrint(
bool prefix,
int level,
const char *location,
const char *fmt, va_list ap);
706 void Error(
const char *location,
const char *
va_(fmt), ...);
709 void SysError(
const char *location,
const char *
va_(fmt), ...);
712 void Info(
const char *location,
const char *
va_(fmt), ...);
715 void Warning(
const char *location,
const char *
va_(fmt), ...);
718 void Fatal(
const char *location,
const char *
va_(fmt), ...);
724 bool EndsWith(
const std::string &theString,
const std::string &theSubstring);
727 bool BeginsWith(
const std::string &theString,
const std::string &theSubstring);
730 namespace AST2SourceTools {
733 const std::string
Decls2FwdDecls(
const std::vector<const clang::Decl*> &decls,
734 const cling::Interpreter& interp);
738 const clang::TemplateParameterList& tmplParamList,
739 const cling::Interpreter& interpreter);
745 const clang::RecordDecl*
EncloseInScopes(
const clang::Decl& decl, std::string& defString);
749 const cling::Interpreter& interpreter,
750 std::string& defString,
751 bool acceptStl=
false);
755 const cling::Interpreter& interpreter,
756 std::string& defString);
758 int GetDefArg(
const clang::ParmVarDecl&
par, std::string& valAsString,
const clang::PrintingPolicy& pp);
762 const cling::Interpreter& interpreter,
763 std::string& defString);
766 const cling::Interpreter& interpreter,
767 std::string& fwdDeclString,
768 std::unordered_set<std::string>* fwdDeclSet=
nullptr);
776 #endif // ROOT_TMetaUtils
cling::Interpreter * gInterp
Type
enumeration specifying the integration types.
typedef void((*Func_t)())
static void output(int code)