Definition at line 238 of file DictSelectionReader.h.
Classes | |
struct | TemplateInfo |
Public Member Functions | |
DictSelectionReader (cling::Interpreter &interp, SelectionRules &, const clang::ASTContext &, ROOT::TMetaUtils::TNormalizedCtxt &) | |
Take the selection rules as input (for consistency w/ other selector interfaces) | |
bool | shouldVisitTemplateInstantiations () const |
bool | VisitRecordDecl (clang::RecordDecl *) |
Visit the entities that needs to be selected. | |
Private Member Functions | |
template<class T > | |
unsigned int | ExtractTemplateArgValue (const T &, const std::string &) |
Extract the value of the template parameter. | |
bool | FirstPass (const clang::RecordDecl &) |
First pass on the AST. | |
void | GetPointeeType (std::string &typeName) |
Get name of the pointee type. | |
const clang::TemplateArgumentList * | GetTmplArgList (const clang::CXXRecordDecl &) |
Get the template arguments list if any. | |
bool | InSelectionNamespace (const clang::RecordDecl &, const std::string &str="") |
Check if in the ROOT::Meta::Selection namespace. | |
void | ManageBaseClasses (const clang::CXXRecordDecl &, const std::string &, bool &) |
Take care of the class bases. | |
void | ManageFields (const clang::RecordDecl &, const std::string &, ClassSelectionRule &, bool) |
Take care of the class fields. | |
std::string | PatternifyName (const std::string &className) |
Transform instance name in pattern for selection. | |
bool | SecondPass (const clang::RecordDecl &) |
Second pass on the AST, using the information of the first one. | |
Private Attributes | |
llvm::StringMap< std::set< std::string > > | fAutoSelectedClassFieldNames |
Collect the autoselected classes. | |
llvm::StringMap< ClassSelectionRule > | fClassNameSelectionRuleMap |
Map of the already built sel rules. | |
bool | fIsFirstPass |
Keep trance of the number of passes through the AST. | |
llvm::StringMap< std::set< std::string > > | fNoAutoSelectedClassFieldNames |
Collect the autoexcluded classes. | |
ROOT::TMetaUtils::TNormalizedCtxt & | fNormCtxt |
The reference to the normalized context. | |
std::set< const clang::RecordDecl * > | fSelectedRecordDecls |
The pointers of the selected RecordDecls. | |
SelectionRules & | fSelectionRules |
The selection rules to be filled. | |
std::set< std::string > | fSpecialNames |
The names of the classes used for the selction syntax. | |
std::unordered_map< std::string, TemplateInfo > | fTemplateInfoMap |
List template name - properties map. | |
ROOT::Internal::DictSelectionReader::DictSelectionReader | ( | cling::Interpreter & | interp, |
SelectionRules & | selectionRules, | ||
const clang::ASTContext & | C, | ||
ROOT::TMetaUtils::TNormalizedCtxt & | normCtxt | ||
) |
Take the selection rules as input (for consistency w/ other selector interfaces)
Definition at line 22 of file DictSelectionReader.cxx.
|
inlineprivate |
Extract the value of the template parameter.
Extract the value of the integral template parameter of a CXXRecordDecl when it has a certain name.
If nothing can be extracted, the value of zero
is returned.
Definition at line 121 of file DictSelectionReader.cxx.
|
inlineprivate |
First pass on the AST.
Manage the first pass over the AST, inspecting only nodes which are within the selection namespace.
Selection rules are directly filled as well as data sructures re-used during the second pass.
Definition at line 250 of file DictSelectionReader.cxx.
|
inlineprivate |
Get name of the pointee type.
Transform the name of the type eliminating the trailing & and *.
Definition at line 410 of file DictSelectionReader.cxx.
|
inlineprivate |
Get the template arguments list if any.
Get the pointer to the template arguments list.
Return zero if not available.
Definition at line 102 of file DictSelectionReader.cxx.
|
inlineprivate |
Check if in the ROOT::Meta::Selection namespace.
If it's not contained by 2 namespaces, drop it.
Check that the recordDecl is enclosed in the ROOT::Meta::Selection namespace, excluding the portion dedicated the definition of the syntax, which is part of ROOT, not of the user code. If performance is needed, an alternative approach to string comparisons could be adopted. One could use for example hashes of strings in first approximation.
Definition at line 63 of file DictSelectionReader.cxx.
|
inlineprivate |
Take care of the class bases.
Check the traits of the class.
Useful information may be there extract mothers, make a switchcase: 1) templates args are to be skipped 2) There are properties. Make a loop. make a switch: 2a) Is splittable Manage the loop over the base classes. Initially, the class attributes are identified and selection rules filled if:
Definition at line 217 of file DictSelectionReader.cxx.
|
inlineprivate |
Take care of the class fields.
Iterate on the members to see if 1) They are transient 2) They imply further selection.
Loop over the class filelds and take actions according to their properties
Definition at line 152 of file DictSelectionReader.cxx.
|
inlineprivate |
Transform instance name in pattern for selection.
Transform a name of a class instance into a pattern for selection e.g.
myClass<double, int, ...> in the selection namespace will translate into a pattern of the type myClass<*>
Definition at line 399 of file DictSelectionReader.cxx.
|
inlineprivate |
Second pass on the AST, using the information of the first one.
Second pass through the AST.
Two operations are performed:
TemplateSpecialisationDecl
its name is checked to match one of the patterns identified during the first pass. If a match is found, a property is added to the selection rule with the number of template arguments to keep in order to percolate this information down to the AnnotatedRecordDecl
creation which happens in the RScanner
. Definition at line 307 of file DictSelectionReader.cxx.
|
inline |
Definition at line 248 of file DictSelectionReader.h.
bool ROOT::Internal::DictSelectionReader::VisitRecordDecl | ( | clang::RecordDecl * | recordDecl | ) |
Visit the entities that needs to be selected.
Definition at line 384 of file DictSelectionReader.cxx.
|
private |
Collect the autoselected classes.
Definition at line 292 of file DictSelectionReader.h.
|
private |
Map of the already built sel rules.
Definition at line 297 of file DictSelectionReader.h.
|
private |
Keep trance of the number of passes through the AST.
Definition at line 298 of file DictSelectionReader.h.
|
private |
Collect the autoexcluded classes.
Definition at line 294 of file DictSelectionReader.h.
|
private |
The reference to the normalized context.
Definition at line 299 of file DictSelectionReader.h.
|
private |
The pointers of the selected RecordDecls.
Definition at line 288 of file DictSelectionReader.h.
|
private |
The selection rules to be filled.
Definition at line 286 of file DictSelectionReader.h.
|
private |
The names of the classes used for the selction syntax.
Definition at line 290 of file DictSelectionReader.h.
|
private |
List template name - properties map.
Definition at line 295 of file DictSelectionReader.h.