Overlord: A C++ Overloading Inspector
Function overloading is a well-known technique available in most major programming languages, including <tex xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">$\mathrm{C}^{++}$</tex>, to facilitate compile-time polymorphism. Due to the complex requirements imposed by the <tex xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">$\mathbf{C}^{++}$</tex> Language Standard, the behaviour of overload resolution can be surprising even for experienced <tex xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">$\mathbf{C}^{++}$</tex> developers. This is exacerbated by the fact that if an unexpected function is selected in an overloaded situation, most compilers do not explain why. In addition, an overabundance of candidates can be a compilation time bottleneck. Despite its widespread usage, there are not many tools to help programmers analyse overload usage in a software project. We developed an overloading inspector tool, Overlord, based on the open-source LLVM/Clang Compiler Infrastructure. With Overlord developers can list the possible candidate functions for a call site, and obtain step-by-step reasoning about the candidate selection process. Additionally to its comprehension functionality the tool also provides profiling data on overload resolution times to help library authors streamline the set of available overloads for improving the compilation performance.
Authors
- Richárd Szalay (ORCID: https://orcid.org/0000-0001-5684-5158)
- Zoltán Porkoláb (ORCID: https://orcid.org/0000-0001-6819-0224)
- Botond István Horváth
Institutions
- Eötvös Loránd University (HU)
- HUN-REN Institute for Computer Science and Control (HU)
Publication Details
- Published
- 2025-04-27
- DOI
- https://doi.org/10.1109/icpc66645.2025.00027
- Primary Topic
- Distributed and Parallel Computing Systems
- Type
- article
- Field-Weighted Citation Impact
- 0.00