Presentation is loading. Please wait.

Presentation is loading. Please wait.

Dictionary generation for the Experiments

Similar presentations


Presentation on theme: "Dictionary generation for the Experiments"— Presentation transcript:

1 Dictionary generation for the Experiments
Velislava Spasova Supervisor: Axel Naumann

2 Introduction to dictionaries
LHC data is C++ objects stored at disks C++ provides very limited Runtime type information (RTTI) A mechanism to describe reflection information for the objects’ classes is needed Dictionaries are one such mechanism Dictionaries are C++ source files generated from header files

3 Current Dictionary Generating Tools (rootcint)
Two dictionary generation tools – rootcint and genreflex rootcint : Uses CINT for the parsing of the header files Selection information could be passed as a Linkdef.h file Problems: CINT is limited in its parsing capabilities, templates processing could be problematic, etc.

4 Current Dictionary Generating Tools (genreflex)
genreflex is a Python script (1000s of lines) Uses GCCXML to parse the header files – a temporary XML file describing the AST is created XML selection files could be used for specification of the items for which a dictionary is to be generated Problems: Slow and practically impossible to debug, creates an intermediate file between the header file and the dictionary which slows down even more the dictionary generation

5 LLVM and clang LLVM - collection of compiler and tool-chain technologies Used as an optimizer and code generator for different compiler front-ends clang – compiler front-end for C, C++ and Objective-C Uses LLVM as a back-end Offers a C++ interface to C++ code Is much faster than GCC Benefits: enhanced language support, shortened build times, more dynamic access to C++

6 Proposed solution Combine rootcint and genreflex functionality into one tool - rootcling using LLVM and clang

7 Requirements to rootcling
Should be a drop-in solution The transition to the new tool should be transparent to the users Shouldn’t break existing code Should accept current mechanisms for dictionary selection (XML selection files or Linkdef.h files)

8 My task – dictionary selection
Create small (pseudo) XML parser to parse the selection.xml files used by genreflex Create small parser to parse Linkdef.h files used by rootcint Realize different selection policies corresponding to the different policies of rootcint and genreflex. Realize the selection process based on the information in the selection files

9 Classes flow chart .

10 The role of clang Provides access to the header through the clang::Decl class and its derivatives (“AST”) Fast and reliable Provides mechanism for recursive traversal of the AST Overriding the DeclVisitor methods to check if a Decl* is to be selected and if yes, trigger the dictionary generation

11 Selection data structure
Selection criteria are represented as a hierarchy of Selection rules Selection rules are created when parsing the selection files

12 Example Linkdef.h file #ifdef __CINT__ #pragma link off all globals;
#pragma link off all classes; #pragma link off all functions; #pragma link C++ nestedclasses; #pragma link C++ class A+; #pragma link C++ class B-!; #pragma link C++ function n::get_n(); #pragma link C++ function n::set_values(int*, std::string&); #pragma link C++ global var_a; #pragma link C++ enum ETest; #endif

13 Example selection.xml file
<lcgdict> <selection> <class name = “a” /> <class pattern=“std::vector<*” /> <class file = “test.h” /> <function proto_name = “n::get_n(float\*,int)” /> </selection> <exclusion> <class name = “a” > <method proto_pattern = “set_value(*)” /> </class> </exclusion> </lcgdict>

14 Some complications … rootcint and genreflex have different and complex default behavior Should nested classes (A::B) inherit the selection rule for the outer class (A)? genreflex and rootcint allow for different behavior Determine selection behavior of both tools experimentally

15 Selection flow chart

16 Progress and Future work
XML parser developed Pattern recognition developed Selection rule classes developed Selection mechanism implemented Future work: Linkdef.h parser to be developed Tests

17 Don’t hesitate to share any remarks, suggestions or questions

18 Thank you!


Download ppt "Dictionary generation for the Experiments"

Similar presentations


Ads by Google