Automatic Conversion of C and C++ Programs to the BuildIt Multi-Stage Programming Framework
Name
kumar-aryan02-meng-eecs-2025-thesis.pdf
Description
Thesis PDF
Size
558.35 KB
Format
Adobe PDF
Checksum (MD5)
a73b0e30a05387e62ae8862359b0ddde
Author(s)
Kumar, Aryan
Advisor(s)
Amarasinghe, Saman
Date Issued
May 2025
Publisher
Massachusetts Institute of Technology
Abstract
BuildIt allows users to write C++ programs that can execute in multiple stages, where the output of one stage is the program source for the next stage, ending with some final output produced. This is particularly useful for writing specialized code and generating code for domain-specific languages. While there are other approaches to multi-stage programming, BuildIt has several advantages: it takes a library-based approach (so it requires no modifications to the compiler and is thus highly portable), and it has excellent ease of use as all the user has to do is change the declared types of variables in their C++ program. The goal of this thesis is to further improve BuildIt’s ease of use by simplifying this step: in particular, by developing a tool that will automatically convert existing C and C++ programs to the BuildIt framework. We show how to use Clang tooling in conjunction with modifications to the Clang compiler to perform non-trivial modifications to source, namely type-modification, to automatically convert code to its unstaged BuildIt equivalent. As the unstaged BuildIt code can be specialized by staging certain variables, this tool will ultimately enable more easily staging and optimizing C/C++ repositories with the BuildIt framework.
MIT Department
Massachusetts Institute of Technology. Department of Electrical Engineering and Computer Science
Terms of Use
In Copyright - Educational Use Permitted
Copyright retained by author(s)
Persistent DSpace Link