Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
arshajii committed May 9, 2024
1 parent e936d5e commit acff5e3
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 13 deletions.
5 changes: 3 additions & 2 deletions codon/cir/llvm/gpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,9 @@ void remapFunctions(llvm::Module *M) {
}},

{"seq_throw",
[](llvm::IRBuilder<> &B,
const std::vector<llvm::Value *> &args) { B.CreateUnreachable(); }},
[](llvm::IRBuilder<> &B, const std::vector<llvm::Value *> &args) {
B.CreateUnreachable();
}},
};

for (auto &pair : remapping) {
Expand Down
4 changes: 2 additions & 2 deletions codon/parser/ast/error.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ struct SrcInfo {
: file(std::move(file)), line(line), col(col), len(len), id(0) {
static int nextId = 0;
id = nextId++;
};
}

SrcInfo() : SrcInfo("", 0, 0, 0) {}

Expand Down Expand Up @@ -62,7 +62,7 @@ class ParserException : public std::runtime_error {
: ParserException(-1, msg, {}) {}
ParserException(const ParserException &e) noexcept
: std::runtime_error(e), locations(e.locations), messages(e.messages),
errorCode(e.errorCode){};
errorCode(e.errorCode) {}

/// Add an error message to the current stack trace
void trackRealize(const std::string &msg, const SrcInfo &info) {
Expand Down
8 changes: 4 additions & 4 deletions codon/parser/ast/expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -683,8 +683,8 @@ struct fmt::formatter<
template <>
struct fmt::formatter<codon::ast::CallExpr::Arg> : fmt::formatter<std::string_view> {
template <typename FormatContext>
auto format(const codon::ast::CallExpr::Arg &p, FormatContext &ctx) const
-> decltype(ctx.out()) {
auto format(const codon::ast::CallExpr::Arg &p,
FormatContext &ctx) const -> decltype(ctx.out()) {
return fmt::format_to(ctx.out(), "({}{})",
p.name.empty() ? "" : fmt::format("{} = ", p.name), p.value);
}
Expand All @@ -693,8 +693,8 @@ struct fmt::formatter<codon::ast::CallExpr::Arg> : fmt::formatter<std::string_vi
template <>
struct fmt::formatter<codon::ast::Param> : fmt::formatter<std::string_view> {
template <typename FormatContext>
auto format(const codon::ast::Param &p, FormatContext &ctx) const
-> decltype(ctx.out()) {
auto format(const codon::ast::Param &p,
FormatContext &ctx) const -> decltype(ctx.out()) {
return fmt::format_to(ctx.out(), "{}", p.toString());
}
};
Expand Down
4 changes: 2 additions & 2 deletions codon/parser/ast/types/class.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ template <>
struct fmt::formatter<codon::ast::types::ClassType::Generic>
: fmt::formatter<std::string_view> {
template <typename FormatContext>
auto format(const codon::ast::types::ClassType::Generic &p, FormatContext &ctx) const
-> decltype(ctx.out()) {
auto format(const codon::ast::types::ClassType::Generic &p,
FormatContext &ctx) const -> decltype(ctx.out()) {
return fmt::format_to(ctx.out(), "({}{})",
p.name.empty() ? "" : fmt::format("{} = ", p.name), p.type);
}
Expand Down
3 changes: 0 additions & 3 deletions codon/parser/visitors/typecheck/typecheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ StmtPtr TypecheckVisitor::apply(Cache *cache, const StmtPtr &stmts) {
auto so = clone(stmts);
auto s = v.inferTypes(so, true);
if (!s) {
// LOG("{}", so->toString(2));
v.error("cannot typecheck the program");
}
if (s->getSuite())
Expand Down Expand Up @@ -356,8 +355,6 @@ TypecheckVisitor::findMatchingMethods(const types::ClassTypePtr &typ,
continue; // avoid overloads that have not been seen yet
auto method = ctx->instantiate(mi, typ)->getFunc();
int score = canCall(method, args);
// LOG("{}: {} {} :: {} :: {}", getSrcInfo(), method->debugString(2), args, score,
// method->ast->getSrcInfo());
if (score != -1) {
results.push_back(mi);
}
Expand Down

0 comments on commit acff5e3

Please sign in to comment.