Skip to content

Commit

Permalink
Make the labels like the design doc.
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Schweitz <eschweitz@nvidia.com>
  • Loading branch information
schweitzpgi committed Feb 4, 2025
1 parent b9d52e8 commit 8f9b6df
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lib/Optimizer/CodeGen/ReturnToOutputLog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,22 +208,22 @@ class ReturnRewrite : public OpRewritePattern<func::ReturnOp> {
return "f" + std::to_string(width);
}
if (auto strTy = dyn_cast<cudaq::cc::StructType>(ty)) {
std::string result = "tuple<";
if (strTy.getMembers().empty())
return "{}";
std::string result = "{" + translateType(strTy.getMembers().front());
return result + '>';
result += translateType(strTy.getMembers().front());
for (auto memTy : strTy.getMembers().drop_front())
result += ", " + translateType(memTy);
return result + "}";
return result + '>';
}
if (auto arrTy = dyn_cast<cudaq::cc::ArrayType>(ty)) {
std::int32_t size = arrTy.getSize();
return "[" + std::to_string(size) + " x " +
translateType(arrTy.getElementType()) + "]";
}
if (auto arrTy = dyn_cast<cudaq::cc::StdvecType>(ty)) {
return "[" + std::to_string(*vecSz) + " x " +
translateType(arrTy.getElementType()) + "]";
return "array<" + translateType(arrTy.getElementType()) + " x " +
std::to_string(size) + '>';
}
if (auto arrTy = dyn_cast<cudaq::cc::StdvecType>(ty))
return "array<" + translateType(arrTy.getElementType()) + " x " +
std::to_string(*vecSz) + '>';
return "error";
}

Expand Down

0 comments on commit 8f9b6df

Please sign in to comment.