From 22932958d862dbdb2594838007c90a07bc81edc3 Mon Sep 17 00:00:00 2001 From: bloodstalker Date: Wed, 11 Mar 2020 08:51:16 +0330 Subject: update --- README.md | 2 -- cgrep.cpp | 21 ++------------------- covrun.sh | 1 + makefile | 4 ++-- 4 files changed, 5 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 4fff3ff..b09bb20 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,6 @@ [![Language grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/bloodstalker/cgrep.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/bloodstalker/cgrep/context:cpp) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/726c70d0e3294f149036fa6134998fe8)](https://www.codacy.com/manual/bloodstalker/cgrep?utm_source=github.com&utm_medium=referral&utm_content=bloodstalker/cgrep&utm_campaign=Badge_Grade) [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fbloodstalker%2Fcgrep.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fbloodstalker%2Fcgrep?ref=badge_shield) -[![Coverity Scan Build Status](https://scan.coverity.com/projects/19431/badge.svg)](https://scan.coverity.com/projects/bloodstalker-cgrep) -[![Coverage Status](https://coveralls.io/repos/github/bloodstalker/cgrep/badge.svg?branch=master)](https://coveralls.io/github/bloodstalker/cgrep?branch=master) [![Gitter](https://badges.gitter.im/mutatortools/community.svg)](https://gitter.im/mutatortools/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) # cgrep diff --git a/cgrep.cpp b/cgrep.cpp index 452f3e7..b359aa7 100644 --- a/cgrep.cpp +++ b/cgrep.cpp @@ -865,21 +865,6 @@ private: BlankDiagConsumer *BDCProto = new BlankDiagConsumer; Rewriter TheRewriter; }; -/***********************************************************************************************/ -static ClangTool build_cgrep_instance(int argc, const char **argv) { - CommonOptionsParser op(argc, argv, CGrepCat); - ClangTool cgrepInstance(op.getCompilations(), op.getSourcePathList()); - - return cgrepInstance; -} - -static int run_cgrep_instance(ClangTool cgrepToolInstance) { - int ret = cgrepToolInstance.run( - newFrontendActionFactory().get()); - - return ret; -} - /***********************************************************************************************/ /*Main*/ int main(int argc, const char **argv) { @@ -888,10 +873,8 @@ int main(int argc, const char **argv) { op.getSourcePathList(); ClangTool Tool(op.getCompilations(), op.getSourcePathList()); int ret = Tool.run(newFrontendActionFactory().get()); -#if 0 - if ("" != CO_RECURSIVE) { - dig(CO_RECURSIVE, argc, argv); - } +#if 1 + listDirs(CO_RECURSIVE); #endif return ret; } diff --git a/covrun.sh b/covrun.sh index 6fb6c71..53e3726 100755 --- a/covrun.sh +++ b/covrun.sh @@ -12,3 +12,4 @@ LLVM_PROFILE_FILE="eight.profraw" "./cgrep-cov" -A 1 -B 1 --cxxcall --call --reg LLVM_PROFILE_FILE="nine.profraw" "./cgrep-cov" -A 1 -B 1 --memvar --regex ite ./cgrep.cpp LLVM_PROFILE_FILE="ten.profraw" "./cgrep-cov" --union --regex [Uu]nion ./test/main.cpp LLVM_PROFILE_FILE="eleven.profraw" "./cgrep-cov" --struct --regex [sS]truct ./test/main.cpp +LLVM_PROFILE_FILE="twelve.profraw" "./cgrep-cov" --dir ./ --regex run --func ./cgrep.cpp diff --git a/makefile b/makefile index 1daca58..f149ec7 100644 --- a/makefile +++ b/makefile @@ -133,12 +133,12 @@ $(TARGET)-cov: $(TARGET).ocov ./cfe-extra/cfe_extra.ocov cov: runcov @llvm-profdata merge -sparse ./one.profraw ./two.profraw ./three.profraw ./four.profraw ./five.profraw ./six.profraw ./seven.profraw \ - ./eight.profraw ./nine.profraw ./ten.profraw ./eleven.profraw -o ./cgrep.profdata + ./eight.profraw ./nine.profraw ./ten.profraw ./eleven.profraw ./twelve.profraw -o ./cgrep.profdata @llvm-cov show $(TARGET)-cov -instr-profile=cgrep.profdata -ignore-filename-regex=llvm clang covrep: runcov @llvm-profdata merge -sparse ./one.profraw ./two.profraw ./three.profraw ./four.profraw ./five.profraw ./six.profraw ./seven.profraw \ - ./eight.profraw ./nine.profraw ./ten.profraw ./eleven.profraw -o ./cgrep.profdata + ./eight.profraw ./nine.profraw ./ten.profraw ./eleven.profraw ./twelve.profraw -o ./cgrep.profdata @llvm-cov report $(TARGET)-cov -instr-profile=cgrep.profdata -ignore-filename-regex=llvm -ignore-filename-regex=clang -show-functions cgrep.cpp ASM:$(ASM_LIST) -- cgit v1.2.3