Skip to content

Commit

Permalink
removed the debug prints. boost is no longer a dependency.
Browse files Browse the repository at this point in the history
  • Loading branch information
terminaldweller committed Mar 30, 2020
1 parent 3888347 commit a6c42a8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
9 changes: 2 additions & 7 deletions cgrep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -689,13 +689,10 @@ class TraceVarHandlerSub : public MatchFinder::MatchCallback {
explicit TraceVarHandlerSub(Rewriter &Rewrite) : Rewrite(Rewrite) {}

virtual void run(const MatchFinder::MatchResult &MR) {
std::cout << "called\n";
const DeclRefExpr *DRE =
MR.Nodes.getNodeAs<clang::DeclRefExpr>("tracevardeclrefexpr");
if (DRE) {
if (DRE->getFoundDecl() == ND) {
std::cout << "DRE:" << std::hex << DRE->getFoundDecl() << "\n";
std::cout << "ND:" << std::hex << ND << "\n";
std::cout << DRE->getLocation().printToString(*(MR.SourceManager))
<< "\n";
}
Expand All @@ -715,11 +712,8 @@ class TraceVarHandler : public MatchFinder::MatchCallback {
public:
explicit TraceVarHandler(Rewriter &Rewrite)
: Rewrite(Rewrite), SubMatcher(Rewrite) {}
~TraceVarHandler() {
std::cout << "Destroy\n";
}

virtual void run(const MatchFinder::MatchResult &MR) {
virtual void run(const MatchFinder::MatchResult &MR) override {
const VarDecl *VD = MR.Nodes.getNodeAs<clang::VarDecl>("tracevar");
if (VD) {
SourceRange SR = VD->getSourceRange();
Expand All @@ -740,6 +734,7 @@ class TraceVarHandler : public MatchFinder::MatchCallback {
}
}


private:
MatchFinder Matcher;
Rewriter &Rewrite [[maybe_unused]];
Expand Down
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ endif
CXX_EXTRA?=
CTAGS_I_PATH?=./
#LD_FLAGS= -lstdc++fs
LD_FLAGS= -lboost_system -lboost_filesystem
LD_FLAGS=
EXTRA_LD_FLAGS?=
ADD_SANITIZERS_CC= -g -fsanitize=address -fno-omit-frame-pointer
ADD_SANITIZERS_LD= -g -fsanitize=address
Expand Down
1 change: 0 additions & 1 deletion pch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "clang/Tooling/CommonOptionsParser.h"
#include "clang/Tooling/Tooling.h"
#include "llvm/Support/raw_ostream.h"
#include <boost/filesystem.hpp>
#include <cassert>
#include <cstdlib>
#include <dirent.h>
Expand Down

0 comments on commit a6c42a8

Please sign in to comment.