Skip to content

Commit

Permalink
cppcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
o- committed Apr 23, 2021
1 parent 5c170a5 commit 2b52f8f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions rir/src/compiler/gnur2pir/gnur2pir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ static void findMerges(const RBCCode& bytecode, CompilerInfo& info) {

struct BCCompiler {
CompilerInfo& cmp;
BCCompiler(CompilerInfo& cmp) : cmp(cmp) {}
explicit BCCompiler(CompilerInfo& cmp) : cmp(cmp) {}

void push(Value* v) { cmp.stack.push(v); }

Expand All @@ -447,29 +447,29 @@ struct BCCompiler {
Value* env() { return cmp.insert.env; }

template <RBC::Id BC>
void compile(RBC);
void compile(const RBC&);
};

// Start instructions translation

template <>
void BCCompiler::compile<RBC::GETVAR_OP>(RBC bc) {
void BCCompiler::compile<RBC::GETVAR_OP>(const RBC& bc) {
auto v = insert(new LdVar(cnst(bc.imm(0)), env()));
insertPush(new Force(v, env(), Tombstone::framestate()));
}

template <>
void BCCompiler::compile<RBC::RETURN_OP>(RBC bc) {
void BCCompiler::compile<RBC::RETURN_OP>(const RBC& bc) {
insert(new Return(pop()));
}

template <>
void BCCompiler::compile<RBC::LDCONST_OP>(RBC bc) {
void BCCompiler::compile<RBC::LDCONST_OP>(const RBC& bc) {
push(insert(new LdConst(cnst(bc.imm(0)))));
}

template <>
void BCCompiler::compile<RBC::ADD_OP>(RBC bc) {
void BCCompiler::compile<RBC::ADD_OP>(const RBC& bc) {
auto a = pop();
auto b = pop();
insertPush(new Add(a, b, env(), bc.imm(0)));
Expand Down
2 changes: 1 addition & 1 deletion rir/src/compiler/gnur2pir/gnur2pir.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Gnur2Pir {
Module& m;

public:
Gnur2Pir(Module& m) : m(m){};
explicit Gnur2Pir(Module& m) : m(m){};
pir::ClosureVersion* compile(SEXP src, const std::string& name);
};

Expand Down

0 comments on commit 2b52f8f

Please sign in to comment.