citrun

watch C/C++ source code execute
Log | Files | Refs | LICENSE

commit ee03bc135158c0c1133f42c02d132c0e3d6b6cd4
parent 09c1964fd5ce604e48f8054cd91e5ab1cb854261
Author: Kyle Milz <kyle@0x30.net>
Date:   Tue,  2 Aug 2016 17:28:55 -0600

src/inst: put constructor under class def

Diffstat:
Msrc/inst_main.cc | 42+++++++++++++++++++++---------------------
1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/src/inst_main.cc b/src/inst_main.cc @@ -63,6 +63,27 @@ private: std::string m_pfx; }; +CitrunInst::CitrunInst(int argc, char *argv[]) : + m_args(argv, argv + argc), + m_object_arg(false), + m_compile_arg(false), + m_ec(), + m_log("citrun.log", m_ec, llvm::sys::fs::F_Append), + m_pid(getpid()), + m_pfx(std::to_string(m_pid) + ": ") +{ + struct utsname utsname; + if (uname(&utsname) == -1) + err(1, "uname"); + + m_log << m_pfx << "citrun-inst v0.0 (" << utsname.sysname + << "-" << utsname.release << " " << utsname.machine + << ") called as '" << m_args[0] << "'.\n"; + + setprogname("citrun-inst"); + clean_path(); +} + // Returns true if value ends with suffix, false otherwise. static bool ends_with(std::string const &value, std::string const &suffix) @@ -102,27 +123,6 @@ copy_file(std::string const &dst_fn, std::string const &src_fn) utimes(dst_fn.c_str(), st_tim); } -CitrunInst::CitrunInst(int argc, char *argv[]) : - m_args(argv, argv + argc), - m_object_arg(false), - m_compile_arg(false), - m_ec(), - m_log("citrun.log", m_ec, llvm::sys::fs::F_Append), - m_pid(getpid()), - m_pfx(std::to_string(m_pid) + ": ") -{ - struct utsname utsname; - if (uname(&utsname) == -1) - err(1, "uname"); - - m_log << m_pfx << "citrun-inst v0.0 (" << utsname.sysname - << "-" << utsname.release << " " << utsname.machine - << ") called as '" << m_args[0] << "'.\n"; - - setprogname("citrun-inst"); - clean_path(); -} - void CitrunInst::process_cmdline() {