Skip to content

Commit

Permalink
Fixed some warnings about lambda's closures that are bigger than nece…
Browse files Browse the repository at this point in the history
…ssary (apache#9481)

* Fixed some warnings, including lambdas closure that are bigger than necessary, and some missing parenthesis around an assignment in a conditional (LLVM fears a mistake where one wanted to use the equality test ==)

* Fixed formatting as two lines can now be merged while still being under 100 characters
  • Loading branch information
FranckQC authored and ylc committed Jan 13, 2022
1 parent 5f0e993 commit 28bda06
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/driver/driver_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ transform::Pass BindTarget(Target target) {
}

static transform::Pass AnnotateEntryFunc(bool b) {
auto fpass = [b](tir::PrimFunc f, IRModule m, transform::PassContext ctx) {
auto fpass = [](tir::PrimFunc f, IRModule m, transform::PassContext ctx) {
return WithAttr(std::move(f), tir::attr::kIsEntryFunc, Bool(true));
};
return tir::transform::CreatePrimFuncPass(fpass, 0, "AnnotateEntryFunc", {});
Expand Down
3 changes: 1 addition & 2 deletions src/relay/backend/vm/compiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -618,8 +618,7 @@ class VMFunctionCompiler : DeviceAwareExprFunctor<void(const Expr& n)> {
}
})
.Match("memory.alloc_storage",
[this, call_node](const Array<Expr>& args, const Attrs& attrs,
const Array<Type>& type_arg) {
[this](const Array<Expr>& args, const Attrs& attrs, const Array<Type>& type_arg) {
ICHECK_EQ(args.size(), 2);
// Compute the size of the allocation.
this->VisitExpr(args[0]);
Expand Down

0 comments on commit 28bda06

Please sign in to comment.