diff --git a/include/revng-c/TargetFunctionOption/TargetFunctionOption.h b/include/revng-c/TargetFunctionOption/TargetFunctionOption.h deleted file mode 100644 index 2a42b8404..000000000 --- a/include/revng-c/TargetFunctionOption/TargetFunctionOption.h +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -// -// Copyright rev.ng Labs Srl. See LICENSE.md for details. -// - -#include "llvm/Support/CommandLine.h" - -extern llvm::cl::opt TargetFunction; diff --git a/lib/Backend/CBackendPass.cpp b/lib/Backend/CBackendPass.cpp index 937768a1f..4f4b76fc9 100644 --- a/lib/Backend/CBackendPass.cpp +++ b/lib/Backend/CBackendPass.cpp @@ -10,7 +10,6 @@ #include "revng-c/RestructureCFGPass/LoadGHAST.h" #include "revng-c/Support/FunctionFileHelpers.h" #include "revng-c/Support/FunctionTags.h" -#include "revng-c/TargetFunctionOption/TargetFunctionOption.h" using namespace llvm; @@ -48,12 +47,6 @@ bool BackendPass::runOnFunction(llvm::Function &F) { if (not FTags.contains(FunctionTags::Isolated)) return false; - // If the `-single-decompilation` option was passed from command line, skip - // decompilation for all the functions that are not the selected one. - if (not TargetFunction.empty()) - if (not F.getName().equals(TargetFunction.c_str())) - return false; - // If the -c-decompiled-dir flag was passed, the decompiled function needs to // be written to file, in the specified directory. We initialize Out with a // proper file descriptor to make it happen. diff --git a/lib/Backend/CMakeLists.txt b/lib/Backend/CMakeLists.txt index 48d906f86..b2920cce4 100644 --- a/lib/Backend/CMakeLists.txt +++ b/lib/Backend/CMakeLists.txt @@ -10,7 +10,6 @@ target_link_libraries( revngcInitModelTypes revngcRestructureCFGPass revngcSupport - revngcTargetFunctionOption revngcTypeNames revng::revngModel revng::revngSupport diff --git a/lib/Backend/VariableScopeAnalysisPass.cpp b/lib/Backend/VariableScopeAnalysisPass.cpp index 5f8a2ec92..0b69fe0e3 100644 --- a/lib/Backend/VariableScopeAnalysisPass.cpp +++ b/lib/Backend/VariableScopeAnalysisPass.cpp @@ -16,7 +16,6 @@ #include "revng-c/Backend/VariableScopeAnalysisPass.h" #include "revng-c/RestructureCFGPass/LoadGHAST.h" #include "revng-c/Support/FunctionTags.h" -#include "revng-c/TargetFunctionOption/TargetFunctionOption.h" using ValuePtrSet = VariableScopeAnalysisPass::ValuePtrSet; @@ -165,12 +164,6 @@ bool VariableScopeAnalysisPass::runOnFunction(Function &F) { if (not FTags.contains(FunctionTags::Isolated)) return false; - // If the `-single-decompilation` option was passed from command line, skip - // decompilation for all the functions that are not the selected one. - if (not TargetFunction.empty()) - if (not F.getName().equals(TargetFunction.c_str())) - return false; - // Get the Abstract Syntax Tree of the restructured code. ASTTree &GHAST = getAnalysis().getGHAST(F); diff --git a/lib/BeautifyGHAST/BeautifyGHASTPass.cpp b/lib/BeautifyGHAST/BeautifyGHASTPass.cpp index 9bd755802..715d817cb 100644 --- a/lib/BeautifyGHAST/BeautifyGHASTPass.cpp +++ b/lib/BeautifyGHAST/BeautifyGHASTPass.cpp @@ -8,7 +8,6 @@ #include "revng-c/BeautifyGHAST/BeautifyGHAST.h" #include "revng-c/RestructureCFGPass/LoadGHAST.h" -#include "revng-c/TargetFunctionOption/TargetFunctionOption.h" struct BeautifyGHASTPass : public llvm::FunctionPass { static char ID; @@ -37,14 +36,6 @@ bool BeautifyGHASTPass::runOnFunction(llvm::Function &F) { if (not FunctionTags::TagsSet::from(&F).contains(FunctionTags::Isolated)) return false; - // If we passed the `-single-decompilation` option to the command line, skip - // decompilation for all the functions that are not the selected one. - if (TargetFunction.size() != 0) { - if (!F.getName().equals(TargetFunction.c_str())) { - return false; - } - } - // Get and beautify the Abstract Syntax Tree beautifyAST(F, getAnalysis().getGHAST(F)); diff --git a/lib/BeautifyGHAST/CMakeLists.txt b/lib/BeautifyGHAST/CMakeLists.txt index 7cb381086..36ec0081d 100644 --- a/lib/BeautifyGHAST/CMakeLists.txt +++ b/lib/BeautifyGHAST/CMakeLists.txt @@ -5,6 +5,5 @@ revng_add_analyses_library(revngcBeautifyGHAST revngc BeautifyGHASTPass.cpp BeautifyGHAST.cpp) -target_link_libraries( - revngcBeautifyGHAST revngcRestructureCFGPass revngcTargetFunctionOption - revngcSupport revng::revngSupport ${LLVM_LIBRARIES}) +target_link_libraries(revngcBeautifyGHAST revngcRestructureCFGPass + revngcSupport revng::revngSupport ${LLVM_LIBRARIES}) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index f077b6f9b..f176966d9 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -15,5 +15,4 @@ add_subdirectory(RemoveLiftingArtifacts) add_subdirectory(RestructureCFGPass) add_subdirectory(Support) add_subdirectory(TypeNames) -add_subdirectory(TargetFunctionOption) add_subdirectory(ValueManipulationAnalysis) diff --git a/lib/IRCanonicalization/CMakeLists.txt b/lib/IRCanonicalization/CMakeLists.txt index a75944933..7316467d9 100644 --- a/lib/IRCanonicalization/CMakeLists.txt +++ b/lib/IRCanonicalization/CMakeLists.txt @@ -9,10 +9,5 @@ revng_add_analyses_library( TwosComplementArithmeticNormalizationPass.cpp) target_link_libraries( - revngcIRCanonicalization - revngcInitModelTypes - revngcSupport - revngcTargetFunctionOption - revng::revngModel - revng::revngSupport - ${LLVM_LIBRARIES}) + revngcIRCanonicalization revngcInitModelTypes revngcSupport revng::revngModel + revng::revngSupport ${LLVM_LIBRARIES}) diff --git a/lib/IRCanonicalization/ExitSSAPass.cpp b/lib/IRCanonicalization/ExitSSAPass.cpp index 2fb26e5b9..974086876 100644 --- a/lib/IRCanonicalization/ExitSSAPass.cpp +++ b/lib/IRCanonicalization/ExitSSAPass.cpp @@ -20,8 +20,6 @@ #include "revng/Support/FunctionTags.h" #include "revng/Support/IRHelpers.h" -#include "revng-c/TargetFunctionOption/TargetFunctionOption.h" - using llvm::AllocaInst; using llvm::AnalysisUsage; using llvm::Argument; @@ -287,12 +285,6 @@ bool ExitSSAPass::runOnFunction(Function &F) { if (not FunctionTags::Isolated.isTagOf(&F)) return false; - // If the `-single-decompilation` option was passed from command line, skip - // decompilation for all the functions that are not the selected one. - if (not TargetFunction.empty()) - if (not F.getName().equals(TargetFunction.c_str())) - return false; - DomTree DT; DT.recalculate(F); diff --git a/lib/IRCanonicalization/MakeModelGEPPass.cpp b/lib/IRCanonicalization/MakeModelGEPPass.cpp index a0b41290a..0d914934c 100644 --- a/lib/IRCanonicalization/MakeModelGEPPass.cpp +++ b/lib/IRCanonicalization/MakeModelGEPPass.cpp @@ -39,7 +39,6 @@ #include "revng-c/Support/FunctionTags.h" #include "revng-c/Support/IRHelpers.h" #include "revng-c/Support/ModelHelpers.h" -#include "revng-c/TargetFunctionOption/TargetFunctionOption.h" using llvm::AnalysisUsage; using llvm::APInt; @@ -2037,12 +2036,6 @@ bool MakeModelGEPPass::runOnFunction(llvm::Function &F) { if (not FunctionTags::Isolated.isTagOf(&F)) return Changed; - // If the `-single-decompilation` option was passed from command line, skip - // decompilation for all the functions that are not the selected one. - if (not TargetFunction.empty()) - if (not F.hasName() or not F.getName().equals(TargetFunction.c_str())) - return Changed; - revng_log(ModelGEPLog, "Make ModelGEP for " << F.getName()); auto Indent = LoggerIndent(ModelGEPLog); diff --git a/lib/IRCanonicalization/MarkAssignments/AddAssignmentMarkerPass.cpp b/lib/IRCanonicalization/MarkAssignments/AddAssignmentMarkerPass.cpp index 337d05112..45aceff9b 100644 --- a/lib/IRCanonicalization/MarkAssignments/AddAssignmentMarkerPass.cpp +++ b/lib/IRCanonicalization/MarkAssignments/AddAssignmentMarkerPass.cpp @@ -21,7 +21,6 @@ #include "revng-c/Support/FunctionTags.h" #include "revng-c/Support/Mangling.h" -#include "revng-c/TargetFunctionOption/TargetFunctionOption.h" #include "MarkAssignments.h" @@ -45,12 +44,6 @@ bool AddAssignmentMarkersPass::runOnFunction(llvm::Function &F) { if (not FTags.contains(FunctionTags::Isolated)) return false; - // If the `-single-decompilation` option was passed from command line, skip - // decompilation for all the functions that are not the selected one. - if (not TargetFunction.empty()) - if (not F.getName().equals(TargetFunction.c_str())) - return false; - MarkAssignments::AssignmentMap Assignments = MarkAssignments::selectAssignments(F); diff --git a/lib/IRCanonicalization/MarkAssignments/CMakeLists.txt b/lib/IRCanonicalization/MarkAssignments/CMakeLists.txt index c7a84a45b..85a46914b 100644 --- a/lib/IRCanonicalization/MarkAssignments/CMakeLists.txt +++ b/lib/IRCanonicalization/MarkAssignments/CMakeLists.txt @@ -6,6 +6,5 @@ revng_add_analyses_library( revngcMarkAssignments revngc AddAssignmentMarkerPass.cpp LivenessAnalysis.cpp MarkAssignments.cpp) -target_link_libraries( - revngcMarkAssignments revngcSupport revngcTargetFunctionOption - revng::revngModel revng::revngSupport ${LLVM_LIBRARIES}) +target_link_libraries(revngcMarkAssignments revngcSupport revng::revngModel + revng::revngSupport ${LLVM_LIBRARIES}) diff --git a/lib/RestructureCFGPass/CMakeLists.txt b/lib/RestructureCFGPass/CMakeLists.txt index 134372034..6fb29ffc0 100644 --- a/lib/RestructureCFGPass/CMakeLists.txt +++ b/lib/RestructureCFGPass/CMakeLists.txt @@ -14,6 +14,5 @@ revng_add_analyses_library( RegionCFGTree.cpp RestructureCFG.cpp) -target_link_libraries( - revngcRestructureCFGPass revng::revngModel revng::revngSupport - revngcTargetFunctionOption ${LLVM_LIBRARIES}) +target_link_libraries(revngcRestructureCFGPass revng::revngModel + revng::revngSupport ${LLVM_LIBRARIES}) diff --git a/lib/RestructureCFGPass/RestructureCFG.cpp b/lib/RestructureCFGPass/RestructureCFG.cpp index e65e906ae..39ca97eb8 100644 --- a/lib/RestructureCFGPass/RestructureCFG.cpp +++ b/lib/RestructureCFGPass/RestructureCFG.cpp @@ -30,7 +30,6 @@ #include "revng-c/RestructureCFGPass/RegionCFGTreeBB.h" #include "revng-c/RestructureCFGPass/RestructureCFG.h" #include "revng-c/RestructureCFGPass/Utils.h" -#include "revng-c/TargetFunctionOption/TargetFunctionOption.h" using namespace llvm; using namespace llvm::cl; @@ -473,14 +472,6 @@ bool restructureCFG(Function &F, ASTTree &AST) { if (not FTags.contains(FunctionTags::Isolated)) return false; - // If we passed the `-single-decompilation` option to the command line, skip - // decompilation for all the functions that are not the selected one. - if (TargetFunction.size() != 0) { - if (!F.getName().equals(TargetFunction.c_str())) { - return false; - } - } - // Clear graph object from the previous pass. RegionCFG RootCFG; diff --git a/lib/TargetFunctionOption/CMakeLists.txt b/lib/TargetFunctionOption/CMakeLists.txt deleted file mode 100644 index 574c69c7e..000000000 --- a/lib/TargetFunctionOption/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -# -# Copyright rev.ng Labs Srl. See LICENSE.md for details. -# - -revng_add_analyses_library(revngcTargetFunctionOption revngc - TargetFunctionOption.cpp) - -target_link_libraries(revngcTargetFunctionOption ${LLVM_LIBRARIES}) diff --git a/lib/TargetFunctionOption/TargetFunctionOption.cpp b/lib/TargetFunctionOption/TargetFunctionOption.cpp deleted file mode 100644 index 9ad46b1c0..000000000 --- a/lib/TargetFunctionOption/TargetFunctionOption.cpp +++ /dev/null @@ -1,17 +0,0 @@ -/// \file TargetFunction.cpp -/// File which defines an option later used by the `CDecompilerPass` and -/// by the `RestructureCFGPass` - -// -// Copyright rev.ng Labs Srl. See LICENSE.md for details. -// - -#include "revng-c/TargetFunctionOption/TargetFunctionOption.h" - -using namespace llvm; - -cl::opt TargetFunction("single-decompilation", - cl::desc("Name of the function to " - "decompile"), - cl::value_desc("function name"), - cl::NumOccurrencesFlag::Optional);