Skip to content

Commit 2b52f8f

Browse files
committed
cppcheck
1 parent 5c170a5 commit 2b52f8f

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

rir/src/compiler/gnur2pir/gnur2pir.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ static void findMerges(const RBCCode& bytecode, CompilerInfo& info) {
426426

427427
struct BCCompiler {
428428
CompilerInfo& cmp;
429-
BCCompiler(CompilerInfo& cmp) : cmp(cmp) {}
429+
explicit BCCompiler(CompilerInfo& cmp) : cmp(cmp) {}
430430

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

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

449449
template <RBC::Id BC>
450-
void compile(RBC);
450+
void compile(const RBC&);
451451
};
452452

453453
// Start instructions translation
454454

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

461461
template <>
462-
void BCCompiler::compile<RBC::RETURN_OP>(RBC bc) {
462+
void BCCompiler::compile<RBC::RETURN_OP>(const RBC& bc) {
463463
insert(new Return(pop()));
464464
}
465465

466466
template <>
467-
void BCCompiler::compile<RBC::LDCONST_OP>(RBC bc) {
467+
void BCCompiler::compile<RBC::LDCONST_OP>(const RBC& bc) {
468468
push(insert(new LdConst(cnst(bc.imm(0)))));
469469
}
470470

471471
template <>
472-
void BCCompiler::compile<RBC::ADD_OP>(RBC bc) {
472+
void BCCompiler::compile<RBC::ADD_OP>(const RBC& bc) {
473473
auto a = pop();
474474
auto b = pop();
475475
insertPush(new Add(a, b, env(), bc.imm(0)));

rir/src/compiler/gnur2pir/gnur2pir.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Gnur2Pir {
1414
Module& m;
1515

1616
public:
17-
Gnur2Pir(Module& m) : m(m){};
17+
explicit Gnur2Pir(Module& m) : m(m){};
1818
pir::ClosureVersion* compile(SEXP src, const std::string& name);
1919
};
2020

0 commit comments

Comments
 (0)