From d72983996f30ee785cca9f66eeea598a2432744e Mon Sep 17 00:00:00 2001 From: Aotrix <9aotrix@protonmail.com> Date: Wed, 7 Oct 2026 23:10:09 +0200 Subject: Add information regarding missing include directory --- CMakeLists.txt | 5 +++++ README.md | 6 ++++++ compile_commands.json | 4 ++-- main.cc | 6 +----- remove.sh | 2 +- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b1cd1d4..720f41d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,11 @@ add_clang_executable(remove-function-call removeFunctionCall.cpp ) +add_compile_options( + remove-function-call + /usr/lib/gcc/x86_64-pc-linux-gnu/16/include +) + clang_target_link_libraries(remove-function-call PRIVATE clangAST diff --git a/README.md b/README.md index 361521f..6860c31 100644 --- a/README.md +++ b/README.md @@ -1 +1,7 @@ ./remove.sh file.cpp -parameter "NAME_OF_FUNCTION_PARAMETER" -value + +IMPORTANT: +Do not forget to add this to compile_commands.json: +-I/usr/lib/gcc/x86_64-pc-linux-gnu/16/include + +And make sure that compile_commands.json is at the root of folder (not in `build`) diff --git a/compile_commands.json b/compile_commands.json index da7fc2f..ff109c6 100644 --- a/compile_commands.json +++ b/compile_commands.json @@ -1,8 +1,8 @@ [ { "directory": "/home/aotrix/development/clang_AST/removeFunctionCall/build", - "command": "/usr/bin/c++ -std=gnu++20 -fno-exceptions -funwind-tables -o CMakeFiles/remove-function-call.dir/removeFunctionCall.cpp.o -c /home/aotrix/development/clang_AST/removeFunctionCall/removeFunctionCall.cpp", + "command": "/usr/bin/c++ -std=gnu++20 -fno-exceptions -funwind-tables -o CMakeFiles/remove-function-call.dir/removeFunctionCall.cpp.o -c /home/aotrix/development/clang_AST/removeFunctionCall/removeFunctionCall.cpp -I/usr/lib/gcc/x86_64-pc-linux-gnu/16/include", "file": "/home/aotrix/development/clang_AST/removeFunctionCall/removeFunctionCall.cpp", "output": "CMakeFiles/remove-function-call.dir/removeFunctionCall.cpp.o" } -] \ No newline at end of file +] diff --git a/main.cc b/main.cc index 41a3200..f71f1f4 100644 --- a/main.cc +++ b/main.cc @@ -18,14 +18,10 @@ 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/remove.sh b/remove.sh index 781dc6d..c2f12b9 100755 --- a/remove.sh +++ b/remove.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash echo "Removing calls..." -./build/remove-function-call $1 $2 +./build/remove-function-call $1 clang-tidy $1 -checks=-*,readability-simplify-boolean-expr -fix >/dev/null 2>&1 echo "Done." -- cgit v1.2.3