samasri / omr

Eclipse OMR™ Cross platform components for building reliable, high performance language runtimes
http://www.eclipse.org/omr
Other
0 stars 2 forks source link

Tool is not guaranteed to be reading all the classes in the source code #18

Open samasri opened 6 years ago

samasri commented 6 years ago

Summary: non-class structures (like structs and unions) and some template classes are not processed

In VisitCXXRecord function, we ignore all CXX records that are not classes (hence, unions and structs are ignored). In addition, when trying to iterate through parents of a CXXRecordDecl, we use an iterator that iterates from bases_begin() to bases_end(). The iterator points to a QualType, which is a more specific Type. The Type can sometimes be converted to a CXXRecordDecl. OMRStatistics, inspired from OMRChecker code, ignores all Type objects that are not converted to CXXRecordDecl objects. However, after some tinkering with these ignored Type objects, we realize that they might be useful.

samasri commented 6 years ago

When asking Matthew about it why are non-CXXRecordDecl objects ignored in OMRChecker source code, the top of his head suspicion was to avoid forward declarations. However, I need to investigate this further; the plan I have in mind for this: Print the names and locations of all the non-CXXRecordDecl objects passed through by the bases iterator and check if they are forward declarations.

samasri commented 6 years ago

A consequence to that is shown when collecting function calls. Some calls are generated by unions, structs, or template methods, these calls are ignored since the receiver is not found in the list of classes.