Transforming C++11 Code to C++03 to Support Legacy Compilation Environments
Abstract: Newer technologies - programming languages, environments, libraries - change very rapidly. However, various internal and external constraints often prevent projects from quickly adopting to these changes. Customers may require specific platform compatibility from a software vendor, for example. In this work, we deal with such an issue in the context of the C++ programming language. Our industrial partner is required to use SDKs that support only older C++ language editions. They, however, would like to allow their developers to use the newest language constructs in their code. To address this problem, we created a source code transformation framework to automatically backport source code written according to the C++11 standard to its functionally equivalent C++03 variant. With our framework developers are free to exploit the latest language features, while production code is still built by using a restricted set of available language constructs. This paper reports on the technical details of the transformation engine, and our experiences in applying it on two large industrial code bases and four open-source systems. Our solution is freely available and open-source.
- ECOOP ’96 — Object-Oriented Programming: 10th European Conference Linz, Austria, July 8–12, 1996 Proceedings, chapter Eliminating virtual function calls in C++ programs, pages 142–166. Springer Berlin Heidelberg, Berlin, Heidelberg, 1996.
- ASF+SDF meta-environment. http://www.meta-environment.org/. Accessed: 2016-06-21.
- CodeBoost: A framework for the transformation of C++ programs. Technical report, 2001.
- K. Bennett. Legacy systems: coping with success. IEEE Software, 12(1):19–23, Jan 1995.
- Clang Tools. https://github.com/llvm-mirror/clang-tools-extra. Accessed: 2016-04-17.
- A lightweight transformational approach to support large scale adaptive changes. In Software Maintenance (ICSM), 2010 IEEE International Conference on, pages 1–10. IEEE, 2010.
- DMS software reengineering toolkit by Semantic Designs. https://www.semanticdesigns.com/Products/DMS/DMSToolkit.html. Accessed: 2016-06-21.
- EDG C++ Front End. https://www.edg.com/c.
- Columbus – Reverse Engineering Tool and Schema for C++. In Proceedings of the 18th International Conference on Software Maintenance (ICSM’02), pages 172–181. IEEE Computer Society, October 2002.
- GCC, the GNU Compiler Collection. https://gcc.gnu.org/. Accessed: 2016-04-24.
- Include What You Use. http://include-what-you-use.org/.
- ISO/IEC 14882:2003 - Programming languages – C++. http://www.iso.org/iso/catalogue_detail.htm?csnumber=38110. Accessed: 2016-04-23.
- ISO/IEC 14882:2011 - Information technology – Programming languages – C++. http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=50372. Accessed: 2016-04-23.
- JSON Compilation Database Format Specification. http://clang.llvm.org/docs/JSONCompilationDatabase.html. Accessed: 2016-04-23.
- Euro-Par 2011: Parallel Processing Workshops: CCPI, CGWS, HeteroPar, HiBB, HPCVirt, HPPC, HPSS, MDGS, ProPer, Resilience, UCHPC, VHPC, Bordeaux, France, August 29 – September 2, 2011, Revised Selected Papers, Part II, chapter Scout: A Source-to-Source Transformator for SIMD-Optimizations, pages 137–145. Springer Berlin Heidelberg, 2012.
- Languages and Compilers for Parallel Computing (LCPC 2003), TX, USA, October 2-4, 2003. Revised Papers, chapter Cetus – An Extensible Compiler Infrastructure for Source-to-Source Transformation, pages 539–553. Springer Berlin Heidelberg, 2004.
- LLVM C Backend. https://github.com/draperlaboratory/llvm-cbe.
- LLVM clang compiler infrastructure. http://clang.llvm.org. Accessed: 2016-04-17.
- A Large-scale Cross-architecture Evaluation of Thread-coarsening. In Proceedings of the International Conference on High Performance Computing, Networking, Storage and Analysis, SC ’13, pages 11:1–11:11, New York, NY, USA, 2013. ACM.
- Paper: Togpu: Automatic Source Transformation from C++ to CUDA using Clang/LLVM. Electronic Imaging, 2016(1):1–9, 2016-02-14T00:00:00.
- Robert C. Martin. The Clean Coder: A Code of Conduct for Professional Programmers. Prentice Hall Press, Upper Saddle River, NJ, USA, 1st edition, 2011.
- Scott Meyers. Effective Modern C++: 42 Specific Ways to Improve Your Use of C++11 and C++14. O’Reilly Media, Inc., 1st edition, 2014.
- József Mihalicza. Analysis and Methods for Supporting Generative Metaprogramming in Large Scale C++ Projects. PhD thesis, Eötvös Loránd University, 2014.
- Software Product Line Engineering: Foundations, Principles and Techniques. Springer-Verlag New York, Inc., Secaucus, NJ, USA, 2005.
- ROSE compiler infrastructure. http://rosecompiler.org/. Accessed: 2016-06-21.
- Stratego/XT program transformation language. http://strategoxt.org/. Accessed: 2016-06-21.
- The TXL programming language. http://www.txl.ca/. Accessed: 2016-06-21.
Paper Prompts
Sign up for free to create and run prompts on this paper using GPT-5.
Top Community Prompts
Collections
Sign up for free to add this paper to one or more collections.