summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--main.cc6
-rwxr-xr-xremove.sh2
-rw-r--r--removeFunctionCall.cpp4
4 files changed, 6 insertions, 8 deletions
diff --git a/README.md b/README.md
index be8ac7d..361521f 100644
--- a/README.md
+++ b/README.md
@@ -1 +1 @@
-./remove.sh file.cpp -parameter "NAME_OF_FUNCTION_PARAMETER" -value <true/false/"value">
+./remove.sh file.cpp -parameter "NAME_OF_FUNCTION_PARAMETER" -value <true/false>
diff --git a/main.cc b/main.cc
index ef15e6e..9030b12 100644
--- a/main.cc
+++ b/main.cc
@@ -1,6 +1,6 @@
#include <iostream>
-bool displayHello()
+bool configValue(const std::string& iKey)
{
bool result;
std::cin >> result;
@@ -16,11 +16,11 @@ bool coucouEveryone()
int main()
{
- if (displayHello())
+ if (configValue("aparam"))
{
coucouEveryone();
}
- if (!displayHello())
+ if (!configValue(""))
{
std::cout << "Mouhahahaha I am a villain!\n";
}
diff --git a/remove.sh b/remove.sh
index c2f12b9..781dc6d 100755
--- a/remove.sh
+++ b/remove.sh
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
echo "Removing calls..."
-./build/remove-function-call $1
+./build/remove-function-call $1 $2
clang-tidy $1 -checks=-*,readability-simplify-boolean-expr -fix >/dev/null 2>&1
echo "Done."
diff --git a/removeFunctionCall.cpp b/removeFunctionCall.cpp
index 3e0d4cb..2be2d9d 100644
--- a/removeFunctionCall.cpp
+++ b/removeFunctionCall.cpp
@@ -127,14 +127,12 @@ int main(int argc,
StandaloneToolExecutor Executor(std::move(OptionsParser.get()));
- std::string ArgId = "arg";
-
// auto Rule = makeRule(
// callExpr(callee(functionDecl(hasName("AwesomeFunc"))),
// hasArgument(0, expr(hasType(pointerType())).bind(ArgId))),
// changeTo(node(ArgId), transformer::maybeDeref(ArgId)));
- auto functionToRemove = functionDecl(matchesName("displayHello"));
+ auto functionToRemove = functionDecl(matchesName("configValue"));
auto Rule = makeRule(callExpr(callee(functionToRemove)), changeTo(cat("true")));
AtomicChanges AllChanges;