From 93d9cbb67b9cd31e687d7fb6ae5ca2003bce5be8 Mon Sep 17 00:00:00 2001 From: Pietro Fezzardi Date: Thu, 12 Nov 2020 17:52:46 +0100 Subject: [PATCH] Enforce new include conventions --- .../revng-c/ADT/ReversePostOrderTraversal.h | 1 - include/revng-c/Decompiler/CDecompilerPass.h | 7 ++-- .../DecompilerResourceFinder/ResourceFinder.h | 4 +-- .../PHIASAPAssignmentInfo.h | 6 ++-- .../RemoveCpuLoopStorePass.h | 3 +- .../RemoveExceptionCallsPass.h | 3 +- .../RemoveLLVMAssumeCallsPass.h | 3 +- .../RemoveNewPCCalls/RemoveNewPCCallsPass.h | 3 +- include/revng-c/RestructureCFGPass/ASTNode.h | 13 +++---- include/revng-c/RestructureCFGPass/ASTTree.h | 2 -- .../RestructureCFGPass/BasicBlockNode.h | 15 ++++---- .../RestructureCFGPass/BasicBlockNodeBB.h | 1 - .../RestructureCFGPass/BasicBlockNodeImpl.h | 13 +++---- include/revng-c/RestructureCFGPass/ExprNode.h | 4 +-- .../revng-c/RestructureCFGPass/GenerateAst.h | 35 ++++++++----------- .../revng-c/RestructureCFGPass/MetaRegion.h | 5 +-- .../revng-c/RestructureCFGPass/MetaRegionBB.h | 1 - .../RestructureCFGPass/MetaRegionImpl.h | 2 -- .../RestructureCFGPass/RegionCFGTree.h | 18 ++++------ .../RestructureCFGPass/RegionCFGTreeBB.h | 2 -- .../RestructureCFGPass/RegionCFGTreeImpl.h | 35 ++++++++----------- .../RestructureCFGPass/RestructureCFG.h | 3 -- include/revng-c/RestructureCFGPass/Utils.h | 3 -- .../TargetFunctionOption.h | 3 +- lib/Decompiler/ASTBuildAnalysis.cpp | 25 ++++++------- lib/Decompiler/ASTBuildAnalysis.h | 17 ++++----- lib/Decompiler/CDecompiler.cpp | 15 ++++---- lib/Decompiler/CDecompilerAction.cpp | 25 ++++++------- lib/Decompiler/CDecompilerAction.h | 7 ++-- lib/Decompiler/CDecompilerBeautify.cpp | 21 +++++------ lib/Decompiler/CDecompilerBeautify.h | 1 - lib/Decompiler/CDecompilerPass.cpp | 31 +++++++--------- lib/Decompiler/DecompilationHelpers.cpp | 20 +++++------ lib/Decompiler/DecompilationHelpers.h | 4 +-- lib/Decompiler/FuncDeclCreationAction.cpp | 14 ++++---- lib/Decompiler/FuncDeclCreationAction.h | 8 ++--- lib/Decompiler/GlobalDeclCreationAction.cpp | 14 ++++---- lib/Decompiler/GlobalDeclCreationAction.h | 8 ++--- lib/Decompiler/IRASTTypeTranslation.cpp | 27 +++++++------- lib/Decompiler/IRASTTypeTranslation.h | 9 ++--- lib/Decompiler/Mangling.h | 4 +-- lib/Decompiler/MarkForSerialization.cpp | 7 ++-- lib/Decompiler/MarkForSerialization.h | 9 ++--- lib/Decompiler/TypeDeclCreationAction.cpp | 10 +++--- lib/Decompiler/TypeDeclCreationAction.h | 8 ++--- .../ResourceFinder.cpp | 3 +- .../PHIASAPAssignmentInfo.cpp | 16 ++++----- .../RemoveCpuLoopStorePass.cpp | 11 +++--- .../RemoveExceptionCallsPass.cpp | 11 +++--- .../RemoveLLVMAssumeCallsPass.cpp | 11 +++--- lib/RemoveNewPCCalls/RemoveNewPCCallsPass.cpp | 11 +++--- lib/RestructureCFGPass/ASTNode.cpp | 7 ++-- lib/RestructureCFGPass/ASTTree.cpp | 5 +-- lib/RestructureCFGPass/BasicBlockNode.cpp | 1 - lib/RestructureCFGPass/ExprNode.cpp | 4 +-- lib/RestructureCFGPass/MetaRegion.cpp | 1 - lib/RestructureCFGPass/RegionCFGTree.cpp | 1 - lib/RestructureCFGPass/RestructureCFG.cpp | 31 +++++++--------- .../TargetFunctionOption.cpp | 1 - tests/Unit/CombingPass.cpp | 7 +--- tests/Unit/Reachability/ReachabilityPass.cpp | 5 --- tests/Unit/Reachability/ReachabilityPass.h | 2 -- tests/Unit/ReachabilityPass.cpp | 6 +--- 63 files changed, 220 insertions(+), 383 deletions(-) diff --git a/include/revng-c/ADT/ReversePostOrderTraversal.h b/include/revng-c/ADT/ReversePostOrderTraversal.h index 565fd6011..8a09af993 100644 --- a/include/revng-c/ADT/ReversePostOrderTraversal.h +++ b/include/revng-c/ADT/ReversePostOrderTraversal.h @@ -5,7 +5,6 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// LLVM includes #include "llvm/ADT/PostOrderIterator.h" template -// LLVM includes -#include -#include +#include "llvm/IR/Function.h" +#include "llvm/Support/raw_ostream.h" -// local libraries includes #include "revng-c/PHIASAPAssignmentInfo/PHIASAPAssignmentInfo.h" #include "revng-c/RestructureCFGPass/RestructureCFG.h" diff --git a/include/revng-c/DecompilerResourceFinder/ResourceFinder.h b/include/revng-c/DecompilerResourceFinder/ResourceFinder.h index ed5db1f09..4b1b2286e 100644 --- a/include/revng-c/DecompilerResourceFinder/ResourceFinder.h +++ b/include/revng-c/DecompilerResourceFinder/ResourceFinder.h @@ -4,10 +4,8 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// revng includes -#include +#include "revng/Support/PathList.h" -// Local library includes #include "revng-c/DecompilerResourceFinder/ResourceFinder.h" namespace revng { diff --git a/include/revng-c/PHIASAPAssignmentInfo/PHIASAPAssignmentInfo.h b/include/revng-c/PHIASAPAssignmentInfo/PHIASAPAssignmentInfo.h index e24933001..0d160eab2 100644 --- a/include/revng-c/PHIASAPAssignmentInfo/PHIASAPAssignmentInfo.h +++ b/include/revng-c/PHIASAPAssignmentInfo/PHIASAPAssignmentInfo.h @@ -4,11 +4,9 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// LLVM includes -#include +#include "llvm/Pass.h" -// revng includes -#include +#include "revng/ADT/SmallMap.h" struct PHIASAPAssignmentInfo : public llvm::FunctionPass { diff --git a/include/revng-c/RemoveCpuLoopStore/RemoveCpuLoopStorePass.h b/include/revng-c/RemoveCpuLoopStore/RemoveCpuLoopStorePass.h index a6f6bc595..c885dcfb1 100644 --- a/include/revng-c/RemoveCpuLoopStore/RemoveCpuLoopStorePass.h +++ b/include/revng-c/RemoveCpuLoopStore/RemoveCpuLoopStorePass.h @@ -5,8 +5,7 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// LLVM includes -#include +#include "llvm/Pass.h" class RemoveCpuLoopStorePass : public llvm::FunctionPass { public: diff --git a/include/revng-c/RemoveExceptionCalls/RemoveExceptionCallsPass.h b/include/revng-c/RemoveExceptionCalls/RemoveExceptionCallsPass.h index 577f2e39a..111a50854 100644 --- a/include/revng-c/RemoveExceptionCalls/RemoveExceptionCallsPass.h +++ b/include/revng-c/RemoveExceptionCalls/RemoveExceptionCallsPass.h @@ -5,8 +5,7 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// LLVM includes -#include +#include "llvm/Pass.h" class RemoveExceptionCallsPass : public llvm::FunctionPass { public: diff --git a/include/revng-c/RemoveLLVMAssumeCalls/RemoveLLVMAssumeCallsPass.h b/include/revng-c/RemoveLLVMAssumeCalls/RemoveLLVMAssumeCallsPass.h index cb64eee5e..840a61671 100644 --- a/include/revng-c/RemoveLLVMAssumeCalls/RemoveLLVMAssumeCallsPass.h +++ b/include/revng-c/RemoveLLVMAssumeCalls/RemoveLLVMAssumeCallsPass.h @@ -5,8 +5,7 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// LLVM includes -#include +#include "llvm/Pass.h" class RemoveLLVMAssumeCallsPass : public llvm::FunctionPass { public: diff --git a/include/revng-c/RemoveNewPCCalls/RemoveNewPCCallsPass.h b/include/revng-c/RemoveNewPCCalls/RemoveNewPCCallsPass.h index 6a817b242..6fb6875a8 100644 --- a/include/revng-c/RemoveNewPCCalls/RemoveNewPCCallsPass.h +++ b/include/revng-c/RemoveNewPCCalls/RemoveNewPCCallsPass.h @@ -5,8 +5,7 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// LLVM includes -#include +#include "llvm/Pass.h" class RemoveNewPCCallsPass : public llvm::FunctionPass { public: diff --git a/include/revng-c/RestructureCFGPass/ASTNode.h b/include/revng-c/RestructureCFGPass/ASTNode.h index 74f7327eb..b78e829e0 100644 --- a/include/revng-c/RestructureCFGPass/ASTNode.h +++ b/include/revng-c/RestructureCFGPass/ASTNode.h @@ -5,17 +5,14 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// Standard includes #include -// LLVM includes -#include -#include -#include -#include -#include +#include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/SmallSet.h" +#include "llvm/ADT/SmallVector.h" +#include "llvm/IR/BasicBlock.h" +#include "llvm/Support/Casting.h" -// Local libraries includes #include "revng-c/RestructureCFGPass/BasicBlockNodeBB.h" #include "revng-c/RestructureCFGPass/ExprNode.h" diff --git a/include/revng-c/RestructureCFGPass/ASTTree.h b/include/revng-c/RestructureCFGPass/ASTTree.h index d00bc9922..65ae116d0 100644 --- a/include/revng-c/RestructureCFGPass/ASTTree.h +++ b/include/revng-c/RestructureCFGPass/ASTTree.h @@ -5,11 +5,9 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// Standard includes #include #include -// local libraries includes #include "revng-c/RestructureCFGPass/ASTNode.h" // Forward declarations. diff --git a/include/revng-c/RestructureCFGPass/BasicBlockNode.h b/include/revng-c/RestructureCFGPass/BasicBlockNode.h index 08a457ce0..3f6f589c0 100644 --- a/include/revng-c/RestructureCFGPass/BasicBlockNode.h +++ b/include/revng-c/RestructureCFGPass/BasicBlockNode.h @@ -5,20 +5,17 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// Standard includes #include #include #include -// LLVM includes -#include -#include -#include -#include -#include +#include "llvm/ADT/GraphTraits.h" +#include "llvm/ADT/SmallSet.h" +#include "llvm/ADT/SmallString.h" +#include "llvm/ADT/SmallVector.h" +#include "llvm/IR/BasicBlock.h" -// revng includes -#include +#include "revng/Support/Debug.h" // Forward declarations template diff --git a/include/revng-c/RestructureCFGPass/BasicBlockNodeBB.h b/include/revng-c/RestructureCFGPass/BasicBlockNodeBB.h index 29677fafe..f071ca1ae 100644 --- a/include/revng-c/RestructureCFGPass/BasicBlockNodeBB.h +++ b/include/revng-c/RestructureCFGPass/BasicBlockNodeBB.h @@ -10,7 +10,6 @@ namespace llvm { class BasicBlock; } // namespace llvm -// Local libraries includes #include "revng-c/RestructureCFGPass/BasicBlockNode.h" extern template class BasicBlockNode; diff --git a/include/revng-c/RestructureCFGPass/BasicBlockNodeImpl.h b/include/revng-c/RestructureCFGPass/BasicBlockNodeImpl.h index 24239bf9c..a6d7998f2 100644 --- a/include/revng-c/RestructureCFGPass/BasicBlockNodeImpl.h +++ b/include/revng-c/RestructureCFGPass/BasicBlockNodeImpl.h @@ -5,19 +5,16 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// Standard includes #include #include #include -// LLVM includes -#include -#include +#include "llvm/IR/BasicBlock.h" +#include "llvm/IR/Instructions.h" -// Local libraries includes -#include -#include -#include +#include "revng-c/RestructureCFGPass/BasicBlockNode.h" +#include "revng-c/RestructureCFGPass/RegionCFGTreeBB.h" +#include "revng-c/RestructureCFGPass/Utils.h" // Trait exposing the weight of a generic object wrapped by `BasicBlockNode`. template diff --git a/include/revng-c/RestructureCFGPass/ExprNode.h b/include/revng-c/RestructureCFGPass/ExprNode.h index 543fd184f..6fa4d5088 100644 --- a/include/revng-c/RestructureCFGPass/ExprNode.h +++ b/include/revng-c/RestructureCFGPass/ExprNode.h @@ -5,11 +5,9 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// Standard includes #include -// LLVM includes -#include +#include "llvm/Support/Casting.h" class AtomicNode; class NotNode; diff --git a/include/revng-c/RestructureCFGPass/GenerateAst.h b/include/revng-c/RestructureCFGPass/GenerateAst.h index 17fa55a47..5f5782315 100644 --- a/include/revng-c/RestructureCFGPass/GenerateAst.h +++ b/include/revng-c/RestructureCFGPass/GenerateAst.h @@ -5,33 +5,28 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// Standard includes #include #include #include #include -#include -// LLVM includes -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "llvm/ADT/DepthFirstIterator.h" +#include "llvm/ADT/GraphTraits.h" +#include "llvm/ADT/PostOrderIterator.h" +#include "llvm/ADT/SCCIterator.h" +#include "llvm/ADT/SmallPtrSet.h" +#include "llvm/ADT/SmallSet.h" +#include "llvm/IR/BasicBlock.h" +#include "llvm/IR/Dominators.h" +#include "llvm/IR/IRBuilder.h" +#include "llvm/IR/Instructions.h" +#include "llvm/Support/Casting.h" +#include "llvm/Support/GenericDomTreeConstruction.h" +#include "llvm/Support/raw_os_ostream.h" -// revng includes -#include -#include +#include "revng/BasicAnalyses/GeneratedCodeBasicInfo.h" +#include "revng/Support/IRHelpers.h" -// Local libraries includes #include "revng-c/ADT/ReversePostOrderTraversal.h" #include "revng-c/RestructureCFGPass/ASTTree.h" #include "revng-c/RestructureCFGPass/BasicBlockNodeBB.h" diff --git a/include/revng-c/RestructureCFGPass/MetaRegion.h b/include/revng-c/RestructureCFGPass/MetaRegion.h index cde541d35..41d7ea9ee 100644 --- a/include/revng-c/RestructureCFGPass/MetaRegion.h +++ b/include/revng-c/RestructureCFGPass/MetaRegion.h @@ -5,17 +5,14 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// Standard includes #include #include #include #include -// LLVM includes #include "llvm/ADT/PostOrderIterator.h" -#include +#include "llvm/ADT/iterator_range.h" -// Local libraries include #include "revng-c/RestructureCFGPass/RegionCFGTreeBB.h" template diff --git a/include/revng-c/RestructureCFGPass/MetaRegionBB.h b/include/revng-c/RestructureCFGPass/MetaRegionBB.h index 55a17973f..99d4adb41 100644 --- a/include/revng-c/RestructureCFGPass/MetaRegionBB.h +++ b/include/revng-c/RestructureCFGPass/MetaRegionBB.h @@ -10,7 +10,6 @@ namespace llvm { class BasicBlock; } // namespace llvm -// Local libraries include #include "revng-c/RestructureCFGPass/MetaRegion.h" extern template class MetaRegion; diff --git a/include/revng-c/RestructureCFGPass/MetaRegionImpl.h b/include/revng-c/RestructureCFGPass/MetaRegionImpl.h index b6419cd84..2e20e3952 100644 --- a/include/revng-c/RestructureCFGPass/MetaRegionImpl.h +++ b/include/revng-c/RestructureCFGPass/MetaRegionImpl.h @@ -5,13 +5,11 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// std includes #include #include #include #include -// Local libraries includes #include "revng-c/RestructureCFGPass/BasicBlockNodeBB.h" #include "revng-c/RestructureCFGPass/MetaRegion.h" diff --git a/include/revng-c/RestructureCFGPass/RegionCFGTree.h b/include/revng-c/RestructureCFGPass/RegionCFGTree.h index 0ccdb8969..f1b247ed7 100644 --- a/include/revng-c/RestructureCFGPass/RegionCFGTree.h +++ b/include/revng-c/RestructureCFGPass/RegionCFGTree.h @@ -5,22 +5,18 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// Standard includes #include #include -// LLVM includes -#include -#include -#include -#include -#include +#include "llvm/ADT/STLExtras.h" +#include "llvm/IR/Dominators.h" +#include "llvm/IR/Instructions.h" +#include "llvm/Support/FileSystem.h" +#include "llvm/Support/GenericDomTreeConstruction.h" -// revng includes -#include -#include +#include "revng/ADT/FilteredGraphTraits.h" +#include "revng/ADT/SmallMap.h" -// Local libraries includes #include "revng-c/RestructureCFGPass/ASTTree.h" #include "revng-c/RestructureCFGPass/BasicBlockNodeBB.h" #include "revng-c/RestructureCFGPass/Utils.h" diff --git a/include/revng-c/RestructureCFGPass/RegionCFGTreeBB.h b/include/revng-c/RestructureCFGPass/RegionCFGTreeBB.h index a4f8d665c..481393841 100644 --- a/include/revng-c/RestructureCFGPass/RegionCFGTreeBB.h +++ b/include/revng-c/RestructureCFGPass/RegionCFGTreeBB.h @@ -5,7 +5,6 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// Standard includes #include #include @@ -14,7 +13,6 @@ namespace llvm { class BasicBlock; } // namespace llvm -// Local libraries includes #include "revng-c/RestructureCFGPass/BasicBlockNodeBB.h" #include "revng-c/RestructureCFGPass/RegionCFGTree.h" extern template class RegionCFG; diff --git a/include/revng-c/RestructureCFGPass/RegionCFGTreeImpl.h b/include/revng-c/RestructureCFGPass/RegionCFGTreeImpl.h index a1b246b7e..4caa33bb7 100644 --- a/include/revng-c/RestructureCFGPass/RegionCFGTreeImpl.h +++ b/include/revng-c/RestructureCFGPass/RegionCFGTreeImpl.h @@ -5,33 +5,28 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// Standard includes #include #include #include #include -#include -// LLVM includes -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "llvm/ADT/DepthFirstIterator.h" +#include "llvm/ADT/GraphTraits.h" +#include "llvm/ADT/PostOrderIterator.h" +#include "llvm/ADT/SCCIterator.h" +#include "llvm/ADT/SmallPtrSet.h" +#include "llvm/ADT/SmallSet.h" +#include "llvm/ADT/SmallVector.h" +#include "llvm/IR/Dominators.h" +#include "llvm/IR/IRBuilder.h" +#include "llvm/IR/Instructions.h" +#include "llvm/Support/Casting.h" +#include "llvm/Support/GenericDomTreeConstruction.h" +#include "llvm/Support/raw_os_ostream.h" -// revng includes -#include -#include +#include "revng/BasicAnalyses/GeneratedCodeBasicInfo.h" +#include "revng/Support/IRHelpers.h" -// Local libraries includes #include "revng-c/ADT/ReversePostOrderTraversal.h" #include "revng-c/RestructureCFGPass/ASTTree.h" #include "revng-c/RestructureCFGPass/BasicBlockNodeBB.h" diff --git a/include/revng-c/RestructureCFGPass/RestructureCFG.h b/include/revng-c/RestructureCFGPass/RestructureCFG.h index ad7e010e5..e2a1335c1 100644 --- a/include/revng-c/RestructureCFGPass/RestructureCFG.h +++ b/include/revng-c/RestructureCFGPass/RestructureCFG.h @@ -5,13 +5,10 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// Standard includes #include -// LLVM includes #include "llvm/Pass.h" -// Local libraries includes #include "revng-c/RestructureCFGPass/ASTTree.h" #include "revng-c/RestructureCFGPass/RegionCFGTreeBB.h" diff --git a/include/revng-c/RestructureCFGPass/Utils.h b/include/revng-c/RestructureCFGPass/Utils.h index 786b69aba..7ad96f2a5 100644 --- a/include/revng-c/RestructureCFGPass/Utils.h +++ b/include/revng-c/RestructureCFGPass/Utils.h @@ -5,14 +5,11 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// Standard includes #include #include #include #include -#include -// Local libraries includes #include "revng-c/RestructureCFGPass/ASTNode.h" #include "revng-c/RestructureCFGPass/BasicBlockNodeBB.h" diff --git a/include/revng-c/TargetFunctionOption/TargetFunctionOption.h b/include/revng-c/TargetFunctionOption/TargetFunctionOption.h index aa478a2fc..cde21ad7d 100644 --- a/include/revng-c/TargetFunctionOption/TargetFunctionOption.h +++ b/include/revng-c/TargetFunctionOption/TargetFunctionOption.h @@ -5,8 +5,7 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// LLVM includes -#include +#include "llvm/Support/CommandLine.h" extern llvm::cl::opt TargetFunction; diff --git a/lib/Decompiler/ASTBuildAnalysis.cpp b/lib/Decompiler/ASTBuildAnalysis.cpp index e3dddcfc7..6effe7695 100644 --- a/lib/Decompiler/ASTBuildAnalysis.cpp +++ b/lib/Decompiler/ASTBuildAnalysis.cpp @@ -4,24 +4,21 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// LLVM includes -#include -#include -#include +#include "llvm/IR/DerivedTypes.h" +#include "llvm/IR/Instruction.h" +#include "llvm/IR/Instructions.h" -// clang includes -#include -#include -#include -#include -#include -#include +#include "clang/AST/ASTContext.h" +#include "clang/AST/Decl.h" +#include "clang/AST/DeclGroup.h" +#include "clang/AST/Expr.h" +#include "clang/AST/OperationKinds.h" +#include "clang/AST/Stmt.h" -// revng includes -#include +#include "revng/Support/IRHelpers.h" -// local includes #include "ASTBuildAnalysis.h" + #include "DecompilationHelpers.h" #include "IRASTTypeTranslation.h" #include "Mangling.h" diff --git a/lib/Decompiler/ASTBuildAnalysis.h b/lib/Decompiler/ASTBuildAnalysis.h index 6af080216..65f1d5024 100644 --- a/lib/Decompiler/ASTBuildAnalysis.h +++ b/lib/Decompiler/ASTBuildAnalysis.h @@ -6,18 +6,15 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// LLVM includes -#include -#include -#include +#include "llvm/ADT/SmallVector.h" +#include "llvm/IR/Dominators.h" +#include "llvm/IR/Instructions.h" -// clang includes -#include +#include "clang/Basic/Specifiers.h" -// revng includes -#include -#include -#include +#include "revng/ADT/SmallMap.h" +#include "revng/Support/Assert.h" +#include "revng/Support/MonotoneFramework.h" namespace clang { class ASTContext; diff --git a/lib/Decompiler/CDecompiler.cpp b/lib/Decompiler/CDecompiler.cpp index a7cb44ce2..9a68f6a04 100644 --- a/lib/Decompiler/CDecompiler.cpp +++ b/lib/Decompiler/CDecompiler.cpp @@ -2,18 +2,15 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// STL includes #include -// LLVM includes -#include -#include -#include -#include -#include -#include +#include "llvm/CodeGen/Passes.h" +#include "llvm/IR/LegacyPassManager.h" +#include "llvm/IR/Module.h" +#include "llvm/Transforms/InstCombine/InstCombine.h" +#include "llvm/Transforms/Scalar.h" +#include "llvm/Transforms/Utils/Cloning.h" -// Local library includes #include "revng-c/Decompiler/CDecompiler.h" #include "revng-c/Decompiler/CDecompilerPass.h" #include "revng-c/RemoveCpuLoopStore/RemoveCpuLoopStorePass.h" diff --git a/lib/Decompiler/CDecompilerAction.cpp b/lib/Decompiler/CDecompilerAction.cpp index e6da54623..74d662fe6 100644 --- a/lib/Decompiler/CDecompilerAction.cpp +++ b/lib/Decompiler/CDecompilerAction.cpp @@ -2,26 +2,23 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// LLVM includes -#include -#include -#include -#include +#include "llvm/IR/Constants.h" +#include "llvm/IR/Module.h" +#include "llvm/IR/Type.h" -// clang includes -#include -#include -#include +#include "clang/AST/Decl.h" +#include "clang/AST/Expr.h" +#include "clang/AST/Stmt.h" +#include "clang/Basic/SourceLocation.h" -// revng includes -#include +#include "revng/Support/Assert.h" -// local libraries includes #include "revng-c/RestructureCFGPass/ASTTree.h" #include "revng-c/RestructureCFGPass/ExprNode.h" #include "revng-c/RestructureCFGPass/RegionCFGTree.h" -// local includes +#include "CDecompilerAction.h" + #include "ASTBuildAnalysis.h" #include "DecompilationHelpers.h" #include "FuncDeclCreationAction.h" @@ -30,8 +27,6 @@ #include "MarkForSerialization.h" #include "TypeDeclCreationAction.h" -#include "CDecompilerAction.h" - namespace clang { namespace tooling { diff --git a/lib/Decompiler/CDecompilerAction.h b/lib/Decompiler/CDecompilerAction.h index fce1103a5..19fce43c4 100644 --- a/lib/Decompiler/CDecompilerAction.h +++ b/lib/Decompiler/CDecompilerAction.h @@ -5,14 +5,11 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// std includes #include -// clang includes -#include -#include +#include "clang/Frontend/ASTConsumers.h" +#include "clang/Frontend/FrontendAction.h" -// Local directory includes #include "CDecompilerBeautify.h" class ASTTree; diff --git a/lib/Decompiler/CDecompilerBeautify.cpp b/lib/Decompiler/CDecompilerBeautify.cpp index 3e1215179..cb606105f 100644 --- a/lib/Decompiler/CDecompilerBeautify.cpp +++ b/lib/Decompiler/CDecompilerBeautify.cpp @@ -6,22 +6,19 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// LLVM includes -#include -#include +#include "llvm/IR/Instructions.h" +#include "llvm/Support/Casting.h" -// revng includes -#include -#include +#include "revng/Support/Assert.h" +#include "revng/Support/Debug.h" -// local libraries includes -#include -#include -#include -#include +#include "revng-c/RestructureCFGPass/ASTTree.h" +#include "revng-c/RestructureCFGPass/ExprNode.h" +#include "revng-c/RestructureCFGPass/GenerateAst.h" +#include "revng-c/RestructureCFGPass/RegionCFGTree.h" -// local includes #include "CDecompilerBeautify.h" + #include "MarkForSerialization.h" static Logger<> BeautifyLogger("beautify"); diff --git a/lib/Decompiler/CDecompilerBeautify.h b/lib/Decompiler/CDecompilerBeautify.h index 9c132e3b1..34c228613 100644 --- a/lib/Decompiler/CDecompilerBeautify.h +++ b/lib/Decompiler/CDecompilerBeautify.h @@ -5,7 +5,6 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// local libraries includes #include "revng-c/RestructureCFGPass/ASTTree.h" extern unsigned ShortCircuitCounter; diff --git a/lib/Decompiler/CDecompilerPass.cpp b/lib/Decompiler/CDecompilerPass.cpp index ae3624fc9..ed3f00a87 100644 --- a/lib/Decompiler/CDecompilerPass.cpp +++ b/lib/Decompiler/CDecompilerPass.cpp @@ -2,26 +2,22 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// LLVM includes -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "llvm/ADT/SmallString.h" +#include "llvm/IR/LegacyPassManager.h" +#include "llvm/IR/Module.h" +#include "llvm/IRReader/IRReader.h" +#include "llvm/Support/Error.h" +#include "llvm/Support/FileSystem.h" +#include "llvm/Support/Path.h" +#include "llvm/Support/SourceMgr.h" +#include "llvm/Support/raw_ostream.h" +#include "llvm/Transforms/Scalar.h" -// clang includes -#include -#include +#include "clang/Tooling/CommonOptionsParser.h" +#include "clang/Tooling/Tooling.h" -// revng includes -#include +#include "revng/Support/IRHelpers.h" -// local libraries includes #include "revng-c/Decompiler/CDecompilerPass.h" #include "revng-c/DecompilerResourceFinder/ResourceFinder.h" #include "revng-c/PHIASAPAssignmentInfo/PHIASAPAssignmentInfo.h" @@ -29,7 +25,6 @@ #include "revng-c/RestructureCFGPass/RestructureCFG.h" #include "revng-c/TargetFunctionOption/TargetFunctionOption.h" -// local includes #include "CDecompilerAction.h" using namespace llvm; diff --git a/lib/Decompiler/DecompilationHelpers.cpp b/lib/Decompiler/DecompilationHelpers.cpp index 916c44699..7191a6858 100644 --- a/lib/Decompiler/DecompilationHelpers.cpp +++ b/lib/Decompiler/DecompilationHelpers.cpp @@ -2,21 +2,17 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// LLVM includes -#include -#include -#include -#include +#include "llvm/ADT/SmallSet.h" +#include "llvm/IR/Function.h" +#include "llvm/IR/GlobalVariable.h" +#include "llvm/IR/Module.h" -// clang includes -#include -#include -#include +#include "clang/AST/ASTContext.h" +#include "clang/AST/Expr.h" +#include "clang/AST/Stmt.h" -// revng includes -#include +#include "revng/Support/IRHelpers.h" -// local includes #include "DecompilationHelpers.h" using namespace llvm; diff --git a/lib/Decompiler/DecompilationHelpers.h b/lib/Decompiler/DecompilationHelpers.h index ccb624232..bb3eddfb5 100644 --- a/lib/Decompiler/DecompilationHelpers.h +++ b/lib/Decompiler/DecompilationHelpers.h @@ -5,11 +5,9 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// std includes #include -// clang includes -#include +#include "clang/AST/Type.h" namespace llvm { class Function; diff --git a/lib/Decompiler/FuncDeclCreationAction.cpp b/lib/Decompiler/FuncDeclCreationAction.cpp index 3bce8e5ac..ef6d849a6 100644 --- a/lib/Decompiler/FuncDeclCreationAction.cpp +++ b/lib/Decompiler/FuncDeclCreationAction.cpp @@ -2,17 +2,15 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// LLVM includes -#include -#include -#include +#include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/SmallVector.h" +#include "llvm/IR/Module.h" -// revng includes -#include +#include "revng/Support/Assert.h" -// local includes -#include "DecompilationHelpers.h" #include "FuncDeclCreationAction.h" + +#include "DecompilationHelpers.h" #include "IRASTTypeTranslation.h" #include "Mangling.h" diff --git a/lib/Decompiler/FuncDeclCreationAction.h b/lib/Decompiler/FuncDeclCreationAction.h index 45fcb9fae..798c5522f 100644 --- a/lib/Decompiler/FuncDeclCreationAction.h +++ b/lib/Decompiler/FuncDeclCreationAction.h @@ -5,12 +5,10 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// clang includes -#include +#include "llvm/ADT/SmallVector.h" -// clang includes -#include -#include +#include "clang/Frontend/ASTConsumers.h" +#include "clang/Frontend/FrontendAction.h" namespace llvm { class Function; diff --git a/lib/Decompiler/GlobalDeclCreationAction.cpp b/lib/Decompiler/GlobalDeclCreationAction.cpp index d10020cc7..b3e597aeb 100644 --- a/lib/Decompiler/GlobalDeclCreationAction.cpp +++ b/lib/Decompiler/GlobalDeclCreationAction.cpp @@ -2,18 +2,16 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// LLVM includes -#include -#include -#include +#include "llvm/ADT/SmallVector.h" +#include "llvm/IR/Constants.h" +#include "llvm/IR/Module.h" -// revng includes -#include +#include "revng/Support/Assert.h" + +#include "GlobalDeclCreationAction.h" -// local includes #include "ASTBuildAnalysis.h" #include "DecompilationHelpers.h" -#include "GlobalDeclCreationAction.h" #include "IRASTTypeTranslation.h" #include "Mangling.h" diff --git a/lib/Decompiler/GlobalDeclCreationAction.h b/lib/Decompiler/GlobalDeclCreationAction.h index ca0500543..671e99316 100644 --- a/lib/Decompiler/GlobalDeclCreationAction.h +++ b/lib/Decompiler/GlobalDeclCreationAction.h @@ -5,12 +5,10 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// LLVM includes -#include +#include "llvm/ADT/SmallVector.h" -// clang includes -#include -#include +#include "clang/Frontend/ASTConsumers.h" +#include "clang/Frontend/FrontendAction.h" namespace llvm { class Function; diff --git a/lib/Decompiler/IRASTTypeTranslation.cpp b/lib/Decompiler/IRASTTypeTranslation.cpp index b9db08859..34eb02340 100644 --- a/lib/Decompiler/IRASTTypeTranslation.cpp +++ b/lib/Decompiler/IRASTTypeTranslation.cpp @@ -2,25 +2,22 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// LLVM includes -#include -#include -#include -#include -#include -#include -#include -#include +#include "llvm/IR/DerivedTypes.h" +#include "llvm/IR/Function.h" +#include "llvm/IR/GlobalVariable.h" +#include "llvm/IR/InstrTypes.h" +#include "llvm/IR/Instruction.h" +#include "llvm/IR/Type.h" +#include "llvm/IR/Value.h" +#include "llvm/Support/Casting.h" -// clang includes -#include -#include +#include "clang/AST/ASTContext.h" +#include "clang/AST/Decl.h" -// revng includes -#include +#include "revng/Support/Assert.h" -// local includes #include "IRASTTypeTranslation.h" + #include "Mangling.h" namespace IRASTTypeTranslation { diff --git a/lib/Decompiler/IRASTTypeTranslation.h b/lib/Decompiler/IRASTTypeTranslation.h index 82d396098..f2fad3baa 100644 --- a/lib/Decompiler/IRASTTypeTranslation.h +++ b/lib/Decompiler/IRASTTypeTranslation.h @@ -5,15 +5,12 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// std includes #include -// LLVM includes -#include -#include +#include "llvm/ADT/Optional.h" +#include "llvm/ADT/SmallVector.h" -// clang includes -#include +#include "clang/AST/Type.h" namespace llvm { class GlobalVariable; diff --git a/lib/Decompiler/Mangling.h b/lib/Decompiler/Mangling.h index 7c211ac93..dbb81c2e3 100644 --- a/lib/Decompiler/Mangling.h +++ b/lib/Decompiler/Mangling.h @@ -5,11 +5,9 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// Standard includes #include -// LLVM includes -#include +#include "llvm/ADT/STLExtras.h" // This is very simple for now. // In the future we might consider making it more robust using something like diff --git a/lib/Decompiler/MarkForSerialization.cpp b/lib/Decompiler/MarkForSerialization.cpp index a96ab8b87..a37d86280 100644 --- a/lib/Decompiler/MarkForSerialization.cpp +++ b/lib/Decompiler/MarkForSerialization.cpp @@ -4,15 +4,12 @@ /// \brief Dataflow analysis to identify which Instructions must be serialized -// LLVM includes -#include -#include +#include "llvm/IR/BasicBlock.h" +#include "llvm/IR/Instructions.h" -// local libraries includes #include "revng-c/RestructureCFGPass/BasicBlockNode.h" #include "revng-c/RestructureCFGPass/RegionCFGTree.h" -// local includes #include "MarkForSerialization.h" static Logger<> MarkLog("mark-serialization"); diff --git a/lib/Decompiler/MarkForSerialization.h b/lib/Decompiler/MarkForSerialization.h index 6d97a4505..842378d8f 100644 --- a/lib/Decompiler/MarkForSerialization.h +++ b/lib/Decompiler/MarkForSerialization.h @@ -6,15 +6,12 @@ /// \brief Dataflow analysis to identify which Instructions must be serialized -// std includes #include -// LLVM includes -#include -#include +#include "llvm/IR/Function.h" -// revng includes -#include +#include "revng/Support/IRHelpers.h" +#include "revng/Support/MonotoneFramework.h" template class RegionCFG; diff --git a/lib/Decompiler/TypeDeclCreationAction.cpp b/lib/Decompiler/TypeDeclCreationAction.cpp index 88744e54c..97ddf24d6 100644 --- a/lib/Decompiler/TypeDeclCreationAction.cpp +++ b/lib/Decompiler/TypeDeclCreationAction.cpp @@ -2,16 +2,14 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// LLVM includes -#include +#include "llvm/IR/Module.h" -// revng includes -#include +#include "revng/Support/Assert.h" + +#include "TypeDeclCreationAction.h" -// local includes #include "DecompilationHelpers.h" #include "IRASTTypeTranslation.h" -#include "TypeDeclCreationAction.h" using namespace llvm; diff --git a/lib/Decompiler/TypeDeclCreationAction.h b/lib/Decompiler/TypeDeclCreationAction.h index d138f9f43..772aae62e 100644 --- a/lib/Decompiler/TypeDeclCreationAction.h +++ b/lib/Decompiler/TypeDeclCreationAction.h @@ -5,12 +5,10 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// LLVM includes -#include +#include "llvm/ADT/SmallVector.h" -// clang includes -#include -#include +#include "clang/Frontend/ASTConsumers.h" +#include "clang/Frontend/FrontendAction.h" namespace llvm { class Function; diff --git a/lib/DecompilerResourceFinder/ResourceFinder.cpp b/lib/DecompilerResourceFinder/ResourceFinder.cpp index 376aa52eb..57b867f19 100644 --- a/lib/DecompilerResourceFinder/ResourceFinder.cpp +++ b/lib/DecompilerResourceFinder/ResourceFinder.cpp @@ -2,8 +2,7 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// LLVM includes -#include +#include "llvm/Support/Path.h" #include "revng-c/DecompilerResourceFinder/ResourceFinder.h" diff --git a/lib/PHIASAPAssignmentInfo/PHIASAPAssignmentInfo.cpp b/lib/PHIASAPAssignmentInfo/PHIASAPAssignmentInfo.cpp index 153dc914c..3245f5931 100644 --- a/lib/PHIASAPAssignmentInfo/PHIASAPAssignmentInfo.cpp +++ b/lib/PHIASAPAssignmentInfo/PHIASAPAssignmentInfo.cpp @@ -2,16 +2,14 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// LLVM includes -#include -#include -#include -#include -#include -#include -#include +#include "llvm/ADT/SmallSet.h" +#include "llvm/ADT/SmallVector.h" +#include "llvm/IR/BasicBlock.h" +#include "llvm/IR/Dominators.h" +#include "llvm/IR/Function.h" +#include "llvm/IR/Instructions.h" +#include "llvm/Support/Casting.h" -// local library includes #include "revng-c/PHIASAPAssignmentInfo/PHIASAPAssignmentInfo.h" using namespace llvm; diff --git a/lib/RemoveCpuLoopStore/RemoveCpuLoopStorePass.cpp b/lib/RemoveCpuLoopStore/RemoveCpuLoopStorePass.cpp index fd0fadb76..60b75649c 100644 --- a/lib/RemoveCpuLoopStore/RemoveCpuLoopStorePass.cpp +++ b/lib/RemoveCpuLoopStore/RemoveCpuLoopStorePass.cpp @@ -2,15 +2,12 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// LLVM includes -#include -#include -#include +#include "llvm/ADT/SmallVector.h" +#include "llvm/IR/Function.h" +#include "llvm/IR/Module.h" -// revng includes -#include +#include "revng/Support/IRHelpers.h" -// Local libraries includes #include "revng-c/RemoveCpuLoopStore/RemoveCpuLoopStorePass.h" using namespace llvm; diff --git a/lib/RemoveExceptionCalls/RemoveExceptionCallsPass.cpp b/lib/RemoveExceptionCalls/RemoveExceptionCallsPass.cpp index bd0c44c13..505955a02 100644 --- a/lib/RemoveExceptionCalls/RemoveExceptionCallsPass.cpp +++ b/lib/RemoveExceptionCalls/RemoveExceptionCallsPass.cpp @@ -2,15 +2,12 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// LLVM includes -#include -#include -#include +#include "llvm/ADT/SmallVector.h" +#include "llvm/IR/Function.h" +#include "llvm/IR/Module.h" -// revng includes -#include +#include "revng/Support/IRHelpers.h" -// Local libraries includes #include "revng-c/RemoveExceptionCalls/RemoveExceptionCallsPass.h" using namespace llvm; diff --git a/lib/RemoveLLVMAssumeCalls/RemoveLLVMAssumeCallsPass.cpp b/lib/RemoveLLVMAssumeCalls/RemoveLLVMAssumeCallsPass.cpp index 2cffa8c04..091ccb494 100644 --- a/lib/RemoveLLVMAssumeCalls/RemoveLLVMAssumeCallsPass.cpp +++ b/lib/RemoveLLVMAssumeCalls/RemoveLLVMAssumeCallsPass.cpp @@ -2,15 +2,12 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// LLVM includes -#include -#include -#include +#include "llvm/ADT/SmallVector.h" +#include "llvm/IR/Function.h" +#include "llvm/IR/Module.h" -// revng includes -#include +#include "revng/Support/IRHelpers.h" -// Local libraries includes #include "revng-c/RemoveLLVMAssumeCalls/RemoveLLVMAssumeCallsPass.h" using namespace llvm; diff --git a/lib/RemoveNewPCCalls/RemoveNewPCCallsPass.cpp b/lib/RemoveNewPCCalls/RemoveNewPCCallsPass.cpp index 2863ea6af..cfc5e7c84 100644 --- a/lib/RemoveNewPCCalls/RemoveNewPCCallsPass.cpp +++ b/lib/RemoveNewPCCalls/RemoveNewPCCallsPass.cpp @@ -2,15 +2,12 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// LLVM includes -#include -#include -#include +#include "llvm/ADT/SmallVector.h" +#include "llvm/IR/Function.h" +#include "llvm/IR/Module.h" -// revng includes -#include +#include "revng/Support/IRHelpers.h" -// Local libraries includes #include "revng-c/RemoveNewPCCalls/RemoveNewPCCallsPass.h" using namespace llvm; diff --git a/lib/RestructureCFGPass/ASTNode.cpp b/lib/RestructureCFGPass/ASTNode.cpp index 25a9fed22..40d29190d 100644 --- a/lib/RestructureCFGPass/ASTNode.cpp +++ b/lib/RestructureCFGPass/ASTNode.cpp @@ -5,16 +5,13 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// Standard includes #include #include #include -// LLVM includes -#include -#include +#include "llvm/ADT/STLExtras.h" +#include "llvm/IR/Constants.h" -// Local libraries includes #include "revng-c/RestructureCFGPass/ASTNode.h" using namespace llvm; diff --git a/lib/RestructureCFGPass/ASTTree.cpp b/lib/RestructureCFGPass/ASTTree.cpp index a162830d1..d5e179877 100644 --- a/lib/RestructureCFGPass/ASTTree.cpp +++ b/lib/RestructureCFGPass/ASTTree.cpp @@ -5,13 +5,10 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// Standard includes #include -// LLVM includes -#include +#include "llvm/Support/raw_os_ostream.h" -// Local libraries includes #include "revng-c/RestructureCFGPass/ASTNode.h" #include "revng-c/RestructureCFGPass/ASTTree.h" #include "revng-c/RestructureCFGPass/Utils.h" diff --git a/lib/RestructureCFGPass/BasicBlockNode.cpp b/lib/RestructureCFGPass/BasicBlockNode.cpp index 9af46cb5b..4ae7bc284 100644 --- a/lib/RestructureCFGPass/BasicBlockNode.cpp +++ b/lib/RestructureCFGPass/BasicBlockNode.cpp @@ -5,7 +5,6 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// Local libraries includes #include "revng-c/RestructureCFGPass/BasicBlockNodeImpl.h" // Explicit instantation for the `RegionCFG` template class. diff --git a/lib/RestructureCFGPass/ExprNode.cpp b/lib/RestructureCFGPass/ExprNode.cpp index 0b6d0f31e..bf8cc4f4b 100644 --- a/lib/RestructureCFGPass/ExprNode.cpp +++ b/lib/RestructureCFGPass/ExprNode.cpp @@ -2,10 +2,8 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// revng includes -#include +#include "revng/Support/Debug.h" -// Local libraries includes #include "revng-c/RestructureCFGPass/ExprNode.h" void ExprNode::deleteExprNode(ExprNode *E) { diff --git a/lib/RestructureCFGPass/MetaRegion.cpp b/lib/RestructureCFGPass/MetaRegion.cpp index 2a219b303..6706012b9 100644 --- a/lib/RestructureCFGPass/MetaRegion.cpp +++ b/lib/RestructureCFGPass/MetaRegion.cpp @@ -5,7 +5,6 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// Local libraries includes #include "revng-c/RestructureCFGPass/MetaRegionImpl.h" // Explicit instantation for the `Metaregion` template class for diff --git a/lib/RestructureCFGPass/RegionCFGTree.cpp b/lib/RestructureCFGPass/RegionCFGTree.cpp index 1cd4e36fc..6c49e8a0b 100644 --- a/lib/RestructureCFGPass/RegionCFGTree.cpp +++ b/lib/RestructureCFGPass/RegionCFGTree.cpp @@ -5,7 +5,6 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// Local libraries includes #include "revng-c/RestructureCFGPass/RegionCFGTreeImpl.h" // Explicit instantation for the `RegionCFG` template class. diff --git a/lib/RestructureCFGPass/RestructureCFG.cpp b/lib/RestructureCFGPass/RestructureCFG.cpp index fa00163e0..680b2e171 100644 --- a/lib/RestructureCFGPass/RestructureCFG.cpp +++ b/lib/RestructureCFGPass/RestructureCFG.cpp @@ -5,35 +5,28 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// Standard includes #include -#include -// LLVM includes -#include -#include -#include -#include -#include -#include -#include -#include +#include "llvm/ADT/PostOrderIterator.h" +#include "llvm/IR/BasicBlock.h" +#include "llvm/IR/Dominators.h" +#include "llvm/IR/Function.h" +#include "llvm/Support/Casting.h" +#include "llvm/Support/FileSystem.h" +#include "llvm/Support/GenericDomTreeConstruction.h" +#include "llvm/Support/raw_os_ostream.h" -// revng includes -#include -#include +#include "revng/Support/Debug.h" +#include "revng/Support/IRHelpers.h" -// revng-c includes -#include "revng-c/RestructureCFGPass/BasicBlockNodeImpl.h" -#include "revng-c/TargetFunctionOption/TargetFunctionOption.h" - -// Local libraries includes #include "revng-c/RestructureCFGPass/ASTTree.h" +#include "revng-c/RestructureCFGPass/BasicBlockNodeImpl.h" #include "revng-c/RestructureCFGPass/GenerateAst.h" #include "revng-c/RestructureCFGPass/MetaRegionBB.h" #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; diff --git a/lib/TargetFunctionOption/TargetFunctionOption.cpp b/lib/TargetFunctionOption/TargetFunctionOption.cpp index bda1c5ff4..3f9af96ea 100644 --- a/lib/TargetFunctionOption/TargetFunctionOption.cpp +++ b/lib/TargetFunctionOption/TargetFunctionOption.cpp @@ -6,7 +6,6 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// Local libraries includes #include "revng-c/TargetFunctionOption/TargetFunctionOption.h" using namespace llvm; diff --git a/tests/Unit/CombingPass.cpp b/tests/Unit/CombingPass.cpp index f64ace653..c31b5738f 100644 --- a/tests/Unit/CombingPass.cpp +++ b/tests/Unit/CombingPass.cpp @@ -5,26 +5,21 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// Standard includes #include -// Boost includes #define BOOST_TEST_MODULE CombingPass bool init_unit_test(); -#include +#include "boost/test/unit_test.hpp" -// LLVM includes #include "llvm/IR/Dominators.h" #include "llvm/IR/LegacyPassManager.h" #include "llvm/IR/Module.h" #include "llvm/IRReader/IRReader.h" #include "llvm/Support/SourceMgr.h" -// revng includes #include "revng/Support/Debug.h" #include "revng/UnitTestHelpers/DotGraphObject.h" -// Local libraries includes #include "revng-c/RestructureCFGPass/BasicBlockNode.h" #include "revng-c/RestructureCFGPass/BasicBlockNodeImpl.h" #include "revng-c/RestructureCFGPass/RegionCFGTree.h" diff --git a/tests/Unit/Reachability/ReachabilityPass.cpp b/tests/Unit/Reachability/ReachabilityPass.cpp index e053ba67e..bfa14ed42 100644 --- a/tests/Unit/Reachability/ReachabilityPass.cpp +++ b/tests/Unit/Reachability/ReachabilityPass.cpp @@ -6,22 +6,17 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// Standard includes #include -#include -// LLVM includes #include "llvm/ADT/PostOrderIterator.h" #include "llvm/ADT/SmallVector.h" #include "llvm/IR/Function.h" #include "llvm/Support/FileSystem.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" -// revng includes #include "revng/Support/Debug.h" #include "revng/Support/IRHelpers.h" -// Local includes #include "ReachabilityPass.h" using namespace llvm; diff --git a/tests/Unit/Reachability/ReachabilityPass.h b/tests/Unit/Reachability/ReachabilityPass.h index a7ca8a842..2c8c3bd55 100644 --- a/tests/Unit/Reachability/ReachabilityPass.h +++ b/tests/Unit/Reachability/ReachabilityPass.h @@ -5,11 +5,9 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// Standard includes #include #include -// LLVM includes #include "llvm/Pass.h" class ReachabilityPass : public llvm::FunctionPass { diff --git a/tests/Unit/ReachabilityPass.cpp b/tests/Unit/ReachabilityPass.cpp index 99ee981c0..bcaf5dde5 100644 --- a/tests/Unit/ReachabilityPass.cpp +++ b/tests/Unit/ReachabilityPass.cpp @@ -5,22 +5,18 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -// Boost includes #define BOOST_TEST_MODULE ReachabilityPass bool init_unit_test(); -#include +#include "boost/test/unit_test.hpp" -// LLVM includes #include "llvm/IR/Dominators.h" #include "llvm/IR/LegacyPassManager.h" #include "llvm/IR/Module.h" #include "llvm/IRReader/IRReader.h" #include "llvm/Support/SourceMgr.h" -// revng includes #include "revng/Support/Debug.h" -// Local libraries includes #include "Reachability/ReachabilityPass.h" using namespace llvm;