Clava: C/C++ source-to-source compilation using LARA

Abstract This article presents Clava, a Clang-based source-to-source compiler, that accepts scripts written in LARA, a JavaScript-based DSL with special constructs for code queries, analysis and transformations. Clava improves Clang’s source-to-source capabilities by providing a more convenient and flexible way to analyze, transform and generate C/C++ code, and provides support for building strategies that capture run-time behavior. We present the Clava framework, its main capabilities, and how it can been used. Furthermore, we show that Clava is sufficiently robust to analyze, instrument and test a set of large C/C++ application codes, such as GCC.

[1]  Hamid Arabnejad,et al.  Source-to-source compilation targeting OpenMP-based automatic parallelization of C applications , 2019, The Journal of Supercomputing.

[2]  Daniel J. Quinlan ROSE: Compiler Support for Object-Oriented Frameworks , 2000, Parallel Process. Lett..

[3]  Rudolf Eigenmann,et al.  Cetus: A Source-to-Source Compiler Infrastructure for Multicores , 2009, Computer.

[4]  Julio Cesar Sampaio do Prado Leite,et al.  On Non-Functional Requirements in Software Engineering , 2009, Conceptual Modeling: Foundations and Applications.

[5]  Giovanni Agosta,et al.  Aspect-Driven Mixed-Precision Tuning Targeting GPUs , 2018, PARMA-DITAM '18.

[6]  Gianluca Palermo,et al.  Pegasus: Performance Engineering for Software Applications Targeting HPC Systems , 2020, IEEE Transactions on Software Engineering.

[7]  Jan Martinovic,et al.  Expressing and Applying C++ Code Transformations for the HDF5 API Through a DSL , 2017, CISIM.

[8]  Wayne Luk,et al.  Performance‐driven instrumentation and mapping strategies using the LARA aspect‐oriented programming approach , 2016, Softw. Pract. Exp..

[9]  Benjamin Muschko Gradle in Action , 2014 .

[10]  Stéphane Ducasse,et al.  AspectMaps: A Scalable Visualization of Join Point Shadows , 2011, 2011 IEEE 19th International Conference on Program Comprehension.

[11]  Wolfgang Schröder-Preikschat,et al.  AspectC++: an aspect-oriented extension to the C++ programming language , 2002 .

[12]  João M. P. Cardoso,et al.  Nonio - modular automatic compiler phase selection and ordering specialization framework for modern compilers , 2019, SoftwareX.

[13]  Pierre Jouvelot,et al.  Semantical interprocedural parallelization: an overview of the PIPS project , 1991 .

[14]  Luca Benini,et al.  The ANTAREX Domain Specific Language for High Performance Computing , 2019, Microprocess. Microsystems.

[15]  Kenneth W. Martin,et al.  Mastering CMake: A Cross-Platform Build System , 2008 .

[16]  Pedro Pinto,et al.  Aspect composition for multiple target languages using LARA , 2018, Comput. Lang. Syst. Struct..

[17]  David H. Bailey,et al.  The Nas Parallel Benchmarks , 1991, Int. J. High Perform. Comput. Appl..