|
ROOT
Reference Guide |
|
Go to the documentation of this file.
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;
94 namespace TMetaUtils {
100 class AnnotatedRecordDecl;
107 static const std::string
iotype(
"iotype");
108 static const std::string
name(
"name");
110 static const std::string
ioname(
"ioname");
114 static const std::string
transient(
"transient");
121 const cling::Interpreter &interp,
123 std::ostream& dictStream,
124 bool isAutoStreamer);
135 class TNormalizedCtxtImpl;
156 bool replace =
false);
178 bool *shuttingDownPtr,
179 const int *pgDebug = 0);
185 virtual bool IsDeclaredScope(
const std::string &base,
bool &isInlined);
194 const std::string &normalizedName);
216 const clang::RecordDecl *decl,
219 bool rRequestNoInputOperator,
220 bool rRequestOnlyTClass,
221 int rRequestedVersionNumber,
222 const cling::Interpreter &interpret,
226 const clang::RecordDecl *decl,
227 const char *requestName,
230 bool rRequestNoInputOperator,
231 bool rRequestOnlyTClass,
232 int rRequestedVersionNumber,
233 const cling::Interpreter &interpret,
238 const clang::RecordDecl *decl,
239 const char *requestedName,
242 bool rRequestNoInputOperator,
243 bool rRequestOnlyTClass,
244 int rRequestedVersionNumber,
245 const cling::Interpreter &interpret,
250 const clang::RecordDecl *decl,
251 const char *requestedName,
252 unsigned int nTemplateArgsToSkip,
255 bool rRequestNoInputOperator,
256 bool rRequestOnlyTClass,
257 int rRequestedVersionNumber,
258 const cling::Interpreter &interpret,
292 operator clang::RecordDecl
const *()
const {
319 const clang::CXXRecordDecl *
GetType()
const;
336 const std::string& propName,
337 std::string& propValue);
341 const std::string& propName,
345 bool RequireCompleteType(
const cling::Interpreter &interp,
const clang::CXXRecordDecl *cl);
353 const cling::Interpreter &interpret,
371 const clang::FunctionDecl*
ClassInfo__HasMethod(
const clang::DeclContext *cl,
char const*,
const cling::Interpreter& interp);
374 void CreateNameTypeMap(clang::CXXRecordDecl
const&, std::map<std::string, ROOT::Internal::TSchemaType>&);
378 const clang::NamedDecl &forcontext,
379 const clang::QualType &qti,
382 const cling::Interpreter &interp,
386 bool IsBase(
const clang::CXXRecordDecl *cl,
const clang::CXXRecordDecl *base,
const clang::CXXRecordDecl *context,
const cling::Interpreter &interp);
389 bool IsBase(
const clang::FieldDecl &
m,
const char* basename,
const cling::Interpreter &interp);
407 bool HasNewMerge(clang::CXXRecordDecl
const*,
const cling::Interpreter&);
410 bool HasOldMerge(clang::CXXRecordDecl
const*,
const cling::Interpreter&);
422 bool NeedDestructor(clang::CXXRecordDecl
const*,
const cling::Interpreter&);
429 const cling::Interpreter&,
bool diagnose);
438 void GetQualifiedName(std::string &qual_name,
const clang::QualType &
type,
const clang::NamedDecl &forcontext);
462 void GetQualifiedName(std::string &qual_name,
const clang::RecordDecl &recordDecl);
477 int GetClassVersion(
const clang::RecordDecl *cl,
const cling::Interpreter &interp);
492 const std::function<
void(
const clang::Module::Header &)> &closure,
493 bool includeDirectlyUsedModules =
true);
508 std::string
TrueName(
const clang::FieldDecl &
m);
512 const cling::Interpreter &
gInterp,
519 const clang::CXXRecordDecl *decl,
520 const cling::Interpreter &interp,
529 const cling::Interpreter &
gInterp,
535 const cling::Interpreter &interp,
537 std::ostream& finalString,
544 const clang::CXXRecordDecl *decl,
545 const cling::Interpreter &interp,
548 bool& needCollectionProxy);
552 const clang::CXXRecordDecl* clxx,
553 const cling::Interpreter &interp,
558 const clang::CXXRecordDecl* clxx,
559 const cling::Interpreter &interp,
564 llvm::StringRef
GetFileName(
const clang::Decl& decl,
565 const cling::Interpreter& interp);
604 const clang::TypeDecl* typeDecl,
605 const cling::Interpreter &interpreter);
610 clang::QualType
GetTypeForIO(
const clang::QualType& templateInstanceType,
611 const cling::Interpreter &interpreter,
618 std::pair<std::string,clang::QualType>
GetNameTypeForIO(
const clang::QualType& templateInstanceType,
619 const cling::Interpreter &interpreter,
625 llvm::StringRef
GetComment(
const clang::Decl &decl, clang::SourceLocation *loc = 0);
629 llvm::StringRef
GetClassComment(
const clang::CXXRecordDecl &decl, clang::SourceLocation *loc,
const cling::Interpreter &interpreter);
645 Redecl = Redecl->getMostRecentDecl();
646 while (Redecl && !Redecl->hasAttrs())
647 Redecl = Redecl->getPreviousDecl();
676 bool IsOfType(
const clang::CXXRecordDecl &cl,
const std::string&
type,
const cling::LookupHelper& lh);
697 clang::ClassTemplateDecl*& ctd,
698 clang::ClassTemplateSpecializationDecl*& ctsd);
706 std::list<std::pair<std::string,bool> >&);
709 std::list<std::pair<std::string,bool> >&);
713 std::list<std::pair<std::string,unsigned int> >& enclosingSc);
723 void ReplaceAll(std::string& str,
const std::string& from,
const std::string& to,
bool recurse=
false);
730 static unsigned int gNumberOfErrors = 0;
731 return gNumberOfErrors;
738 static bool gWarningsAreErrors =
false;
739 return gWarningsAreErrors;
750 inline void LevelPrint(
bool prefix,
int level,
const char *location,
const char *fmt, va_list ap)
755 const char *
type = 0;
770 if (!location || !location[0]) {
771 if (prefix) fprintf(stderr,
"%s: ",
type);
772 vfprintf(stderr, (
const char*)
va_(fmt), ap);
774 if (prefix) fprintf(stderr,
"%s in <%s>: ",
type, location);
775 else fprintf(stderr,
"In <%s>: ", location);
776 vfprintf(stderr, (
const char*)
va_(fmt), ap);
789 inline void Error(
const char *location,
const char *
va_(fmt), ...)
792 va_start(ap,
va_(fmt));
799 inline void SysError(
const char *location,
const char *
va_(fmt), ...)
802 va_start(ap,
va_(fmt));
809 inline void Info(
const char *location,
const char *
va_(fmt), ...)
812 va_start(ap,
va_(fmt));
819 inline void Warning(
const char *location,
const char *
va_(fmt), ...)
822 va_start(ap,
va_(fmt));
829 inline void Fatal(
const char *location,
const char *
va_(fmt), ...)
832 va_start(ap,
va_(fmt));
841 bool EndsWith(
const std::string &theString,
const std::string &theSubstring);
844 bool BeginsWith(
const std::string &theString,
const std::string &theSubstring);
853 namespace AST2SourceTools {
857 bool (*ignoreFiles)(
const clang::PresumedLoc&) ,
858 const cling::Interpreter& interp);
862 const clang::TemplateParameterList& tmplParamList,
863 const cling::Interpreter& interpreter);
869 const clang::RecordDecl*
EncloseInScopes(
const clang::Decl& decl, std::string& defString);
873 const cling::Interpreter& interpreter,
874 std::string& defString,
875 bool acceptStl=
false);
879 const cling::Interpreter& interpreter,
880 std::string& defString);
882 int GetDefArg(
const clang::ParmVarDecl& par, std::string& valAsString,
const clang::PrintingPolicy& pp);
886 const cling::Interpreter& interpreter,
887 std::string& defString);
890 const cling::Interpreter& interpreter,
891 std::string& fwdDeclString,
892 std::unordered_set<std::string>* fwdDeclSet=
nullptr);
static void output(int code)
cling::Interpreter * gInterp
Type
enumeration specifying the integration types.
void function(const Char_t *name_, T fun, const Char_t *docstring=0)
typedef void((*Func_t)())
static Roo_reg_AGKInteg1D instance
R__EXTERN Int_t gErrorIgnoreLevel
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...