Commit 5eaa5783 authored by Tommi Rantala's avatar Tommi Rantala

Pass strings by const reference

parent 8ec651e9
......@@ -1141,7 +1141,7 @@ void CodegenLLVM::visit(Program &program)
probe->accept(*this);
}
int CodegenLLVM::getNextIndexForProbe(std::string probe_name) {
int CodegenLLVM::getNextIndexForProbe(const std::string &probe_name) {
if (next_probe_index_.count(probe_name) == 0)
next_probe_index_[probe_name] = 1;
int index = next_probe_index_[probe_name];
......@@ -1149,7 +1149,7 @@ int CodegenLLVM::getNextIndexForProbe(std::string probe_name) {
return index;
}
std::string CodegenLLVM::getSectionNameForProbe(std::string probe_name, int index) {
std::string CodegenLLVM::getSectionNameForProbe(const std::string &probe_name, int index) {
return "s_" + probe_name + "_" + std::to_string(index);
}
......
......@@ -49,8 +49,8 @@ public:
void visit(Program &program) override;
AllocaInst *getMapKey(Map &map);
AllocaInst *getHistMapKey(Map &map, Value *log2);
int getNextIndexForProbe(std::string probe_name);
std::string getSectionNameForProbe(std::string probe_name, int index);
int getNextIndexForProbe(const std::string &probe_name);
std::string getSectionNameForProbe(const std::string &probe_name, int index);
Value *createLogicalAnd(Binop &binop);
Value *createLogicalOr(Binop &binop);
......
......@@ -106,7 +106,7 @@ static bool is_dir(const std::string& path)
return S_ISDIR(buf.st_mode);
}
static std::pair<bool, std::string> get_kernel_path_info(const std::string kdir)
static std::pair<bool, std::string> get_kernel_path_info(const std::string &kdir)
{
if (is_dir(kdir + "/build") && is_dir(kdir + "/source"))
return std::make_pair(true, "source");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment