Skip to content

Commit

Permalink
Add function parameters to built Computation #20
Browse files Browse the repository at this point in the history
  • Loading branch information
riftEmber committed Sep 10, 2021
1 parent 7386bfc commit d538616
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/SPFComputationBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,13 @@ SPFComputationBuilder::buildComputationFromFunction(FunctionDecl *funcDecl) {
stmtContexts.clear();
computation = std::make_unique<iegenlib::Computation>();

// perform processing
processBody(funcBody);
// add function parameters to the Computation
for (const auto *param: funcDecl->parameters()) {
computation->addParameter(param->getNameAsString(), param->getOriginalType().getAsString());
}

// collect results into Computation
// collect function body info and add it to the Computation
processBody(funcBody);
for (auto &stmtContext: stmtContexts) {
auto *stmt = new iegenlib::Stmt();

Expand Down Expand Up @@ -80,7 +83,7 @@ SPFComputationBuilder::buildComputationFromFunction(FunctionDecl *funcDecl) {
}
}

// insert Computation data spaces
// add Computation data spaces
auto stmtDataSpaces = stmtContext.dataAccesses.dataSpaces;
for (const auto &dataSpaceName:
stmtContext.dataAccesses.dataSpaces) {
Expand Down

0 comments on commit d538616

Please sign in to comment.