Skip to content

Commit 6b18259

Browse files
committed
Review comments.
Signed-off-by: fruffy <fruffy@nyu.edu>
1 parent 6ceaed7 commit 6b18259

File tree

6 files changed

+8
-7
lines changed

6 files changed

+8
-7
lines changed

backends/bmv2/portable_common/options.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ std::vector<const char *> *PortableOptions::process(int argc, char *const argv[]
1313
std::cerr << "Could not determine executable path" << std::endl;
1414
return nullptr;
1515
}
16-
exe_name = cstring(executablePath.stem().c_str());
16+
this->exe_name = cstring(executablePath.stem().c_str());
1717
searchForIncludePath(p4includePath,
1818
{"p4include/bmv2"_cs, "../p4include/bmv2"_cs, "../../p4include/bmv2"_cs},
1919
executablePath.c_str());

backends/dpdk/options.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ std::vector<const char *> *DpdkOptions::process(int argc, char *const argv[]) {
1313
std::cerr << "Could not determine executable path" << std::endl;
1414
return nullptr;
1515
}
16-
exe_name = cstring(executablePath.stem().c_str());
16+
this->exe_name = cstring(executablePath.stem().c_str());
1717

1818
searchForIncludePath(p4includePath,
1919
{"p4include/dpdk"_cs, "../p4include/dpdk"_cs, "../../p4include/dpdk"_cs},

backends/tofino/bf-p4c/bf-p4c-options.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ std::vector<const char *> *BFN_Options::process(int argc, char *const argv[]) {
718718
std::cerr << "Could not determine executable path" << std::endl;
719719
return nullptr;
720720
}
721-
exe_name = cstring(executablePath.stem().c_str());
721+
this->exe_name = cstring(executablePath.stem().c_str());
722722
// sde installs p4include directory to $SDE/install/share/p4c/p4include
723723
// and installs p4c to $SDE/install/bin/
724724
//

frontends/common/parser_options.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ std::vector<const char *> *ParserOptions::process(int argc, char *const argv[])
377377
std::cerr << "Could not determine executable path" << std::endl;
378378
return nullptr;
379379
}
380-
exe_name = cstring(executablePath.stem().c_str());
380+
this->exe_name = cstring(executablePath.stem().c_str());
381381

382382
searchForIncludePath(p4_14includePath,
383383
{"p4_14include"_cs, "../p4_14include"_cs, "../../p4_14include"_cs},

lib/alloc_trace.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,11 @@ std::ostream &operator<<(std::ostream &out, const AllocTrace &at) {
7474
}
7575
std::sort(sorted.begin(), sorted.end(), [](auto &a, auto &b) { return a.first > b.first; });
7676
#if HAVE_LIBBACKTRACE
77-
if (!global_backtrace_state)
77+
if (!global_backtrace_state) {
78+
// TODO: Do not use cstring here?
7879
global_backtrace_state =
79-
backtrace_create_state(getExecutablePath().c_str(), 1, bt_error, &out);
80+
backtrace_create_state(cstring(getExecutablePath().c_str()).c_str(), 1, bt_error, &out);
81+
}
8082
#endif
8183

8284
out << "Allocated a total of " << n4(total_total) << "B memory";

lib/exename.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ std::filesystem::path getExecutablePath(const std::filesystem::path &suggestedPa
5858
std::array<char, PATH_MAX> buffer{};
5959
uint32_t size = static_cast<uint32_t>(buffer.size());
6060
if (_NSGetExecutablePath(buffer.data(), &size) == 0) {
61-
// TODO: What to do about the allocation here?
6261
return buffer.data();
6362
} else
6463
#elif defined(_WIN32)

0 commit comments

Comments
 (0)