Classes | |
class | AnnotatedNamespaceDecl |
struct | DelayedAnnotatedRecordDeclInfo |
Public Types | |
typedef std::vector< ROOT::TMetaUtils::AnnotatedRecordDecl > | ClassColl_t |
typedef void(* | DeclCallback) (const clang::RecordDecl *) |
typedef std::map< const clang::Decl *, const BaseSelectionRule * > | DeclsSelRulesMap_t |
typedef std::vector< const clang::EnumDecl * > | EnumColl_t |
enum class | EScanType : char { kNormal , kTwoPasses , kOnePCM } |
typedef std::vector< const clang::FunctionDecl * > | FunctionColl_t |
typedef std::vector< AnnotatedNamespaceDecl > | NamespaceColl_t |
typedef std::vector< const clang::TypedefNameDecl * > | TypedefColl_t |
typedef std::vector< const clang::VarDecl * > | VariableColl_t |
Public Member Functions | |
RScanner (SelectionRules &rules, EScanType stype, const cling::Interpreter &interpret, ROOT::TMetaUtils::TNormalizedCtxt &normCtxt, unsigned int verbose=0) | |
Regular constructor setting up the scanner to search for entities matching the 'rules'. | |
virtual | ~RScanner () |
void | AddDelayedAnnotatedRecordDecls () |
bool | GetDeclName (clang::Decl *D, std::string &name) const |
const DeclsSelRulesMap_t & | GetDeclsSelRulesMap () const |
bool | GetFunctionPrototype (clang::Decl *D, std::string &prototype) const |
void | Scan (const clang::ASTContext &C) |
DeclCallback | SetRecordDeclCallback (DeclCallback callback) |
Set the callback to the RecordDecl and return the previous one. | |
bool | shouldVisitTemplateInstantiations () const |
bool | TraverseClassTemplatePartialSpecializationDecl (clang::ClassTemplatePartialSpecializationDecl *) |
bool | TraverseDeclContextHelper (clang::DeclContext *DC) |
bool | TraverseStmt (clang::Stmt *) |
bool | TreatRecordDeclOrTypedefNameDecl (clang::TypeDecl *typeDecl) |
bool | VisitEnumDecl (clang::EnumDecl *D) |
bool | VisitFieldDecl (clang::FieldDecl *D) |
Nothing to be done here. | |
bool | VisitFunctionDecl (clang::FunctionDecl *D) |
bool | VisitNamespaceDecl (clang::NamespaceDecl *D) |
This method visits a namespace node. | |
bool | VisitRecordDecl (clang::RecordDecl *D) |
bool | VisitTypedefNameDecl (clang::TypedefNameDecl *D) |
Visitor for every TypedefNameDecl, i.e. | |
bool | VisitVarDecl (clang::VarDecl *D) |
Static Public Member Functions | |
static bool | GetDeclQualName (const clang::Decl *D, std::string &qual_name) |
Static Public Attributes | |
static const char * | fgClangDeclKey = "ClangDecl" |
static const char * | fgClangFuncKey = "ClangFunc" |
Private Member Functions | |
int | AddAnnotatedRecordDecl (const ClassSelectionRule *, const clang::Type *, const clang::RecordDecl *, const std::string &, const clang::TypedefNameDecl *, unsigned int indexOffset=0) |
std::string | ConvTemplateArguments (const clang::TemplateArgumentList &list) const |
std::string | ConvTemplateName (clang::TemplateName &N) const |
std::string | ConvTemplateParameterList (clang::TemplateParameterList *list) const |
std::string | ConvTemplateParams (clang::TemplateDecl *D) const |
void | DeclInfo (clang::Decl *D) const |
std::string | ExprToStr (clang::Expr *expr) const |
unsigned int | FuncModifiers (clang::FunctionDecl *D) const |
std::string | FuncParameterList (clang::FunctionDecl *D) const |
std::string | FuncParameters (clang::FunctionDecl *D) const |
std::string | GetEnumName (clang::EnumDecl *D) const |
std::string | GetLocation (clang::Decl *D) const |
std::string | GetName (clang::Decl *D) const |
std::string | GetSrcLocation (clang::SourceLocation L) const |
bool | shouldVisitDecl (clang::NamedDecl *D) |
Whether we can actually visit this declaration, i.e. | |
void | ShowError (const std::string &msg, const std::string &location="") const |
void | ShowInfo (const std::string &msg, const std::string &location="") const |
void | ShowTemplateInfo (const std::string &msg, const std::string &location="") const |
void | ShowWarning (const std::string &msg, const std::string &location="") const |
void | UnexpectedDecl (clang::Decl *D, const std::string &txt="") const |
unexpected - this kind of declaration is unexpected (in concrete place) | |
void | UnimplementedDecl (clang::Decl *D, const std::string &txt="") |
information about item, that should be implemented | |
void | UnimportantDecl (clang::Decl *D, const std::string &txt="") const |
unimportant - this kind of declaration is not stored into reflex | |
void | UnknownDecl (clang::Decl *D, const std::string &txt="") const |
unknown - this kind of declaration was not known to programmer | |
void | UnknownType (clang::QualType qual_type) const |
void | UnsupportedDecl (clang::Decl *D, const std::string &txt="") const |
unsupported - this kind of declaration is probably not used (in current version of C++) | |
void | UnsupportedType (clang::QualType qual_type) const |
unsigned int | VarModifiers (clang::VarDecl *D) const |
unsigned int | Visibility (clang::Decl *D) const |
unsigned int | VisibilityModifiers (clang::AccessSpecifier access) const |
Private Attributes | |
DeclsSelRulesMap_t | fDeclSelRuleMap |
bool | fDeclTable [fgDeclLast+1] |
bool | fFirstPass |
const cling::Interpreter & | fInterpreter |
clang::Decl * | fLastDecl |
ROOT::TMetaUtils::TNormalizedCtxt & | fNormCtxt |
DeclCallback | fRecordDeclCallback |
EScanType | fScanType |
std::set< clang::RecordDecl * > | fselectedRecordDecls |
SelectionRules & | fSelectionRules |
const clang::SourceManager * | fSourceManager |
bool | fTypeTable [fgTypeLast+1] |
unsigned int | fVerboseLevel |
Static Private Attributes | |
static int | fgAnonymousClassCounter = 0 |
static std::map< clang::Decl *, std::string > | fgAnonymousClassMap |
static int | fgAnonymousEnumCounter = 0 |
static std::map< clang::Decl *, std::string > | fgAnonymousEnumMap |
static int | fgBadClassCounter = 0 |
static const int | fgDeclLast = clang::Decl::Var |
static const int | fgTypeLast = clang::Type::TemplateTypeParm |
typedef std::vector<ROOT::TMetaUtils::AnnotatedRecordDecl> RScanner::ClassColl_t |
typedef void(* RScanner::DeclCallback) (const clang::RecordDecl *) |
typedef std::map<const clang::Decl*,const BaseSelectionRule*> RScanner::DeclsSelRulesMap_t |
typedef std::vector<const clang::EnumDecl*> RScanner::EnumColl_t |
typedef std::vector<const clang::FunctionDecl*> RScanner::FunctionColl_t |
typedef std::vector<AnnotatedNamespaceDecl> RScanner::NamespaceColl_t |
typedef std::vector<const clang::TypedefNameDecl*> RScanner::TypedefColl_t |
typedef std::vector<const clang::VarDecl*> RScanner::VariableColl_t |
|
strong |
RScanner::RScanner | ( | SelectionRules & | rules, |
EScanType | stype, | ||
const cling::Interpreter & | interpret, | ||
ROOT::TMetaUtils::TNormalizedCtxt & | normCtxt, | ||
unsigned int | verbose = 0 |
||
) |
Regular constructor setting up the scanner to search for entities matching the 'rules'.
Definition at line 77 of file Scanner.cxx.
|
virtual |
Definition at line 105 of file Scanner.cxx.
|
private |
Definition at line 535 of file Scanner.cxx.
void RScanner::AddDelayedAnnotatedRecordDecls | ( | ) |
Definition at line 815 of file Scanner.cxx.
|
private |
|
private |
Definition at line 417 of file Scanner.cxx.
|
private |
|
private |
|
private |
Definition at line 276 of file Scanner.cxx.
|
private |
Definition at line 402 of file Scanner.cxx.
|
private |
|
private |
Definition at line 459 of file Scanner.cxx.
|
private |
Definition at line 432 of file Scanner.cxx.
bool RScanner::GetDeclName | ( | clang::Decl * | D, |
std::string & | name | ||
) | const |
Definition at line 984 of file Scanner.cxx.
|
static |
Definition at line 1000 of file Scanner.cxx.
|
inline |
|
private |
Definition at line 378 of file Scanner.cxx.
bool RScanner::GetFunctionPrototype | ( | clang::Decl * | D, |
std::string & | prototype | ||
) | const |
Definition at line 1016 of file Scanner.cxx.
|
private |
Definition at line 235 of file Scanner.cxx.
|
private |
Definition at line 252 of file Scanner.cxx.
|
private |
Definition at line 225 of file Scanner.cxx.
void RScanner::Scan | ( | const clang::ASTContext & | C | ) |
Definition at line 1052 of file Scanner.cxx.
RScanner::DeclCallback RScanner::SetRecordDeclCallback | ( | RScanner::DeclCallback | callback | ) |
Set the callback to the RecordDecl and return the previous one.
Definition at line 1083 of file Scanner.cxx.
|
private |
Whether we can actually visit this declaration, i.e.
if it is reachable via name lookup.
RScanner shouldn't touch decls for which this method returns false as we call Sema methods on those declarations. Those will fail in strange way as they assume those decls are already visible.
The main problem this is supposed to prevent is when we use C++ modules and have hidden declarations in our AST. Usually they can't be found as they are hidden from name lookup until their module is actually imported, but as the RecursiveASTVisitor is not supposed to be restricted by lookup limitations, it still reaches those hidden declarations.
Definition at line 122 of file Scanner.cxx.
|
inline |
|
private |
Definition at line 207 of file Scanner.cxx.
|
private |
Definition at line 191 of file Scanner.cxx.
|
private |
Definition at line 215 of file Scanner.cxx.
|
private |
Definition at line 199 of file Scanner.cxx.
|
inline |
bool RScanner::TraverseDeclContextHelper | ( | clang::DeclContext * | DC | ) |
Definition at line 954 of file Scanner.cxx.
bool RScanner::TreatRecordDeclOrTypedefNameDecl | ( | clang::TypeDecl * | typeDecl | ) |
Definition at line 612 of file Scanner.cxx.
|
private |
unexpected - this kind of declaration is unexpected (in concrete place)
Definition at line 298 of file Scanner.cxx.
|
private |
information about item, that should be implemented
Definition at line 327 of file Scanner.cxx.
|
private |
unimportant - this kind of declaration is not stored into reflex
Definition at line 320 of file Scanner.cxx.
|
private |
unknown - this kind of declaration was not known to programmer
Definition at line 287 of file Scanner.cxx.
|
private |
Definition at line 360 of file Scanner.cxx.
|
private |
unsupported - this kind of declaration is probably not used (in current version of C++)
Definition at line 309 of file Scanner.cxx.
|
private |
Definition at line 369 of file Scanner.cxx.
|
private |
|
private |
|
private |
bool RScanner::VisitEnumDecl | ( | clang::EnumDecl * | D | ) |
Definition at line 875 of file Scanner.cxx.
bool RScanner::VisitFieldDecl | ( | clang::FieldDecl * | D | ) |
Nothing to be done here.
Definition at line 912 of file Scanner.cxx.
bool RScanner::VisitFunctionDecl | ( | clang::FunctionDecl * | D | ) |
Definition at line 934 of file Scanner.cxx.
bool RScanner::VisitNamespaceDecl | ( | clang::NamespaceDecl * | D | ) |
This method visits a namespace node.
Definition at line 479 of file Scanner.cxx.
bool RScanner::VisitRecordDecl | ( | clang::RecordDecl * | D | ) |
Definition at line 522 of file Scanner.cxx.
bool RScanner::VisitTypedefNameDecl | ( | clang::TypedefNameDecl * | D | ) |
Visitor for every TypedefNameDecl, i.e.
aliases and typedefs We check three conditions before trying to match the name: 1) If we are creating a big PCM 2) If the underlying decl is a RecordDecl 3) If the typedef is eventually contained in the std namespace
Definition at line 849 of file Scanner.cxx.
bool RScanner::VisitVarDecl | ( | clang::VarDecl * | D | ) |
Definition at line 893 of file Scanner.cxx.
|
private |
|
private |
std::vector<DelayedAnnotatedRecordDeclInfo> RScanner::fDelayedAnnotatedRecordDecls |
|
staticprivate |
|
staticprivate |
|
static |
|
static |
|
staticprivate |
|
staticprivate |
|
private |
|
private |
ClassColl_t RScanner::fSelectedClasses |
EnumColl_t RScanner::fSelectedEnums |
FunctionColl_t RScanner::fSelectedFunctions |
NamespaceColl_t RScanner::fSelectedNamespaces |
|
private |
TypedefColl_t RScanner::fSelectedTypedefs |
VariableColl_t RScanner::fSelectedVariables |
|
private |
|
private |
|
private |