citrun

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

commit defa2bc7c126c70ee22f484bcb0b46081565055c
parent b057b9bf2dcce97639f24af3c20612a52c8d51bc
Author: Kyle Milz <kyle@0x30.net>
Date:   Fri, 12 Aug 2016 00:35:53 -0600

src: change name to be shorter

Diffstat:
Msrc/inst_action.cc | 4++--
Msrc/inst_visitor.cc | 6+++---
Mt/inst_binop.t | 6+++---
Mt/inst_dowhile.t | 6+++---
Mt/inst_for.t | 4++--
Mt/inst_if.t | 14+++++++-------
Mt/inst_return.t | 12++++++------
Mt/inst_switch.t | 6+++---
Mt/inst_while.t | 8++++----
9 files changed, 33 insertions(+), 33 deletions(-)

diff --git a/src/inst_action.cc b/src/inst_action.cc @@ -83,9 +83,9 @@ InstrumentAction::EndSourceFileAction() << "extern \"C\" {\n" << "#endif\n"; preamble << runtime_h << "\n"; - preamble << "static uint64_t _citrun_lines[" << num_lines << "];\n"; + preamble << "static uint64_t _citrun[" << num_lines << "];\n"; preamble << "static struct citrun_node _citrun_node = {\n" - << " _citrun_lines,\n" + << " _citrun,\n" << " " << num_lines << ",\n" << " \"" << m_compiler_file_name << "\",\n" << " \"" << file_name << "\",\n"; diff --git a/src/inst_visitor.cc b/src/inst_visitor.cc @@ -140,9 +140,9 @@ RewriteASTVisitor::modify_stmt(clang::Stmt *s, int &counter) return false; // If x = y is the original statement on line 19 then we try rewriting - // as (++citrun_lines[19], x = y). + // as (++_citrun[19], x = y). std::stringstream ss; - ss << "(++_citrun_lines[" + ss << "(++_citrun[" << m_SM.getPresumedLineNumber(s->getLocStart()) - 1 << "], "; @@ -180,7 +180,7 @@ RewriteASTVisitor::VisitFunctionDecl(clang::FunctionDecl *f) int decl_start = m_SM.getPresumedLineNumber(f->getLocStart()); int decl_end = m_SM.getPresumedLineNumber(curly_brace); for (int i = decl_start; i <= decl_end; ++i) - rewrite_text << "++_citrun_lines[" << i - 1 << "];"; + rewrite_text << "++_citrun[" << i - 1 << "];"; // Rewrite the function source right after the beginning curly brace. m_TheRewriter.InsertTextBefore(curly_brace, rewrite_text.str()); diff --git a/t/inst_binop.t b/t/inst_binop.t @@ -38,9 +38,9 @@ static const struct { unsigned char data[0 + 64 * 6]; } blah; -int main(void) {citrun_start();++_citrun_lines[13]; - if ((++_citrun_lines[14], (++_citrun_lines[14], 4 + 3))) - return (++_citrun_lines[15], 0); +int main(void) {citrun_start();++_citrun[13]; + if ((++_citrun[14], (++_citrun[14], 4 + 3))) + return (++_citrun[15], 0); } EOF diff --git a/t/inst_dowhile.t b/t/inst_dowhile.t @@ -18,11 +18,11 @@ EOF cat <<EOF > while.c.inst_good int main(int argc, char *argv[]) -{citrun_start();++_citrun_lines[0];++_citrun_lines[1];++_citrun_lines[2]; +{citrun_start();++_citrun[0];++_citrun[1];++_citrun[2]; do { argc++; - } while ((++_citrun_lines[5], (++_citrun_lines[5], argc != 10))); - return (++_citrun_lines[6], 0); + } while ((++_citrun[5], (++_citrun[5], argc != 10))); + return (++_citrun[6], 0); } EOF diff --git a/t/inst_for.t b/t/inst_for.t @@ -22,10 +22,10 @@ cat <<EOF > for.c.inst_good int main(int argc, char *argv[]) -{citrun_start();++_citrun_lines[2];++_citrun_lines[3];++_citrun_lines[4]; +{citrun_start();++_citrun[2];++_citrun[3];++_citrun[4]; for (;;); - for ((++_citrun_lines[7], argc = 0); (++_citrun_lines[7], (++_citrun_lines[7], argc < 10)); argc++) + for ((++_citrun[7], argc = 0); (++_citrun[7], (++_citrun[7], argc < 10)); argc++) argv++; } EOF diff --git a/t/inst_if.t b/t/inst_if.t @@ -27,16 +27,16 @@ cat <<EOF > if.c.inst_good int main(int argc, char *argv[]) -{citrun_start();++_citrun_lines[2];++_citrun_lines[3];++_citrun_lines[4]; - if ((++_citrun_lines[5], (++_citrun_lines[5], argc == 1))) - return (++_citrun_lines[6], 1); +{citrun_start();++_citrun[2];++_citrun[3];++_citrun[4]; + if ((++_citrun[5], (++_citrun[5], argc == 1))) + return (++_citrun[6], 1); else - (++_citrun_lines[8], exit(14)); + (++_citrun[8], exit(14)); - if ((++_citrun_lines[10], ((++_citrun_lines[10], argc = 2)))) - return (++_citrun_lines[11], 5); + if ((++_citrun[10], ((++_citrun[10], argc = 2)))) + return (++_citrun[11], 5); else - (++_citrun_lines[13], exit(0)); + (++_citrun[13], exit(0)); } EOF diff --git a/t/inst_return.t b/t/inst_return.t @@ -19,16 +19,16 @@ int main(void) { EOF cat <<EOF > return.c.inst_good -int foo() {++_citrun_lines[0]; - return (++_citrun_lines[1], 0); +int foo() {++_citrun[0]; + return (++_citrun[1], 0); } -int main(void) {citrun_start();++_citrun_lines[4]; - return (++_citrun_lines[5], 10); +int main(void) {citrun_start();++_citrun[4]; + return (++_citrun[5], 10); - return (++_citrun_lines[7], (++_citrun_lines[7], 10 + 10)); + return (++_citrun[7], (++_citrun[7], 10 + 10)); - return (++_citrun_lines[9], (++_citrun_lines[9], foo())); + return (++_citrun[9], (++_citrun[9], foo())); } EOF diff --git a/t/inst_switch.t b/t/inst_switch.t @@ -24,17 +24,17 @@ EOF cat <<EOF > switch.c.inst_good int main(void) -{citrun_start();++_citrun_lines[0];++_citrun_lines[1];++_citrun_lines[2]; +{citrun_start();++_citrun[0];++_citrun[1];++_citrun[2]; int i; - switch ((++_citrun_lines[5], i)) { + switch ((++_citrun[5], i)) { case 0: break; case 1: break; } - return (++_citrun_lines[12], 0); + return (++_citrun[12], 0); } EOF diff --git a/t/inst_while.t b/t/inst_while.t @@ -19,12 +19,12 @@ EOF cat <<EOF > while.c.inst_good int main(int argc, char *argv[]) -{citrun_start();++_citrun_lines[0];++_citrun_lines[1];++_citrun_lines[2]; - while ((++_citrun_lines[3], (++_citrun_lines[3], argc < 17))) +{citrun_start();++_citrun[0];++_citrun[1];++_citrun[2]; + while ((++_citrun[3], (++_citrun[3], argc < 17))) argc++; - while ((++_citrun_lines[6], ((++_citrun_lines[6], argc && argv)))); - return (++_citrun_lines[7], 0); + while ((++_citrun[6], ((++_citrun[6], argc && argv)))); + return (++_citrun[7], 0); } EOF