summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.cc6
-rw-r--r--removeFunctionCall.cpp6
2 files changed, 9 insertions, 3 deletions
diff --git a/main.cc b/main.cc
index f71f1f4..41a3200 100644
--- a/main.cc
+++ b/main.cc
@@ -18,10 +18,14 @@ bool coucouEveryone()
int main()
{
std::string aValue{"stari"};
+ if (configValue(aValue, "on"))
{
coucouEveryone();
}
-
+ if (!configValue("burger", "on"))
+ {
+ std::cout << "Mouhahahaha I am a villain!\n";
+ }
int abc;
return 0;
}
diff --git a/removeFunctionCall.cpp b/removeFunctionCall.cpp
index 8f62818..ff871bb 100644
--- a/removeFunctionCall.cpp
+++ b/removeFunctionCall.cpp
@@ -90,6 +90,7 @@ AST_POLYMORPHIC_MATCHER_P2(hasVariableNameArgument,
if (!Node.getNumArgs())
return false;
const Expr* Arg = Node.getArg(0);
+ std::cout << "[DEBUG] hasVariableNameArgument; VariableName: " << VariableName << '\n';
if (Finder->isTraversalIgnoringImplicitNodes() && isa<CXXDefaultArgExpr>(Arg))
return false;
return InnerMatcher.matches(*Arg->IgnoreParenImpCasts(), Finder, Builder);
@@ -108,6 +109,7 @@ AST_POLYMORPHIC_MATCHER_P2(hasExpectedValueArgument,
if (Node.getNumArgs() > 2)
return false;
const Expr* Arg = Node.getArg(1);
+ std::cout << "[DEBUG] hasExpectedValueArgument; ExpectedValue: " << ExpectedValue << '\n';
if (Finder->isTraversalIgnoringImplicitNodes() && isa<CXXDefaultArgExpr>(Arg))
return false;
return InnerMatcher.matches(*Arg->IgnoreParenImpCasts(), Finder, Builder);
@@ -184,8 +186,8 @@ int main(int argc,
// for instance if there is a ternary operator somewhere...
const std::string FunctionReturnValue("true");
auto Rule = makeRule(callExpr(callee(FunctionToRemove),
- hasVariableNameArgument("ohThisIsTheVariableName", expr()),
- hasExpectedValueArgument("ohTheExpectedValueIsThis", expr())),
+ hasVariableNameArgument("LightVariableName", expr()),
+ hasExpectedValueArgument("on", expr())),
transformer::changeTo(cat(FunctionReturnValue)));
AtomicChanges AllChanges;