Open Aaron3154518 opened 3 years ago
In Codegen, we iterate through each statement. We need to get the first write of that statement and look up its type.
Here's an example of iterating through dataSpaces
(type is std::vector<std::pair<std::string, std::string>>
):
for (auto& pair : dataSpaces) {
pair.first; //Name
pair.second; // Type
}
Documentation for the pair object: https://www.cplusplus.com/reference/utility/pair/
Once we store type information, we need to generate type declarations in
codeGen()
. Every statement writes to exactly 1 dataspace so every statement needs exactly 1 type declaration.