From c883bed7650ceb33822fa854e85dd11162d3c532 Mon Sep 17 00:00:00 2001 From: Alessandro Di Federico Date: Fri, 31 Oct 2025 11:34:52 +0100 Subject: [PATCH] Drop Logger's StaticEnabled feature --- .../revng/DataLayoutAnalysis/DLATypeSystem.h | 2 +- .../AnalyzeRegisterUsage.h | 3 +- include/revng/Lift/CSVOffsets.h | 3 +- include/revng/MFP/MFP.h | 26 +++++------ .../Importer/Binary/BinaryImporterHelper.h | 4 +- include/revng/Model/RawBinaryView.h | 1 - include/revng/Model/VerifyHelper.h | 2 +- include/revng/Pipeline/Context.h | 4 +- include/revng/Pipeline/LLVMContainer.h | 2 +- include/revng/Pipeline/Pipe.h | 6 +-- include/revng/Pipeline/Step.h | 2 +- include/revng/RestructureCFG/GenerateAst.h | 4 +- include/revng/RestructureCFG/Utils.h | 2 +- include/revng/Support/Debug.h | 41 ++++++++---------- include/revng/Support/IRHelpers.h | 6 +-- include/revng/TupleTree/TupleTreeReference.h | 7 ++- include/revng/ValueMaterializer/Helpers.h | 2 +- lib/Backend/DecompileFunction.cpp | 4 +- .../DiscardBrokenDebugInformation.cpp | 2 +- lib/Canonicalize/ExitSSAPass.cpp | 2 +- lib/Canonicalize/FoldModelGEP.cpp | 2 +- lib/Canonicalize/ImplicitModelCastPass.cpp | 2 +- .../LoopRewriteWithCanonicalIV.cpp | 2 +- lib/Canonicalize/MakeModelCastPass.cpp | 2 +- lib/Canonicalize/MakeModelGEPPass.cpp | 2 +- lib/Canonicalize/PeepholeOptimizationPass.cpp | 2 +- lib/Canonicalize/SimplifySwitchPass.cpp | 2 +- lib/Canonicalize/SwitchToStatements.cpp | 2 +- lib/Clifter/Clifter.cpp | 4 +- .../Backend/DLAMakeModelTypes.cpp | 6 +-- .../Backend/DLAUpdateModelTypes.cpp | 4 +- lib/DataLayoutAnalysis/DLAPass.cpp | 2 +- lib/DataLayoutAnalysis/DLATypeSystem.cpp | 8 ++-- .../ArrangeAccessesHierarchically.cpp | 2 +- .../Middleend/CollapseSCC.cpp | 2 +- .../Middleend/DLACollapseSingleChild.cpp | 2 +- .../Middleend/DLAComputeUpperMemberAccess.cpp | 2 +- .../DLAPruneLayoutNodesWithoutLayout.cpp | 2 +- lib/DataLayoutAnalysis/Middleend/DLAStep.cpp | 4 +- .../Middleend/DeduplicateFields.cpp | 4 +- .../Middleend/MergePointeesOfPointerUnion.cpp | 2 +- .../Middleend/MergePointerNodes.cpp | 2 +- .../Middleend/RemoveBackedges.cpp | 2 +- .../Middleend/RemoveInvalidStrideEdges.cpp | 2 +- .../Middleend/SimplifyInstanceAtOffset0.cpp | 2 +- .../AnalyzeRegisterUsage.cpp | 5 +-- lib/EarlyFunctionAnalysis/AttachDebugInfo.cpp | 2 +- lib/EarlyFunctionAnalysis/CFGAnalyzer.cpp | 14 +++--- .../CollectFunctionsFromCalleesPass.cpp | 2 +- ...ollectFunctionsFromUnusedAddressesPass.cpp | 2 +- lib/EarlyFunctionAnalysis/DetectABI.cpp | 16 +++---- .../FunctionSummaryOracle.cpp | 2 +- .../FunctionCallIdentification.cpp | 2 +- lib/FunctionIsolation/EnforceABI.cpp | 2 +- lib/FunctionIsolation/IsolateFunctions.cpp | 2 +- lib/HeadersGeneration/HelpersToHeader.cpp | 2 +- lib/HeadersGeneration/ModelToHeader.cpp | 2 +- .../AnalyzeHelperArguments.cpp | 2 +- .../ArgumentUsageAnalysis.cpp | 12 +++--- lib/HelperArgumentsAnalysis/CPUStateUsage.cpp | 14 +++--- lib/HelperArgumentsAnalysis/FixHelpers.cpp | 12 +++--- lib/HelperArgumentsAnalysis/Function.h | 2 +- lib/ImportFromC/ImportFromCAnalysis.cpp | 2 +- lib/InitModelTypes/InitModelTypes.cpp | 2 +- lib/Lift/CSVOffsets.cpp | 2 +- lib/Lift/CodeGenerator.cpp | 6 +-- lib/Lift/InstructionTranslator.cpp | 2 +- lib/Lift/JumpTargetManager.cpp | 6 +-- lib/Lift/RootAnalyzer.cpp | 6 +-- lib/Lift/VariableManager.cpp | 4 +- lib/Model/Binary.cpp | 2 +- lib/Model/Importer/Binary/ELFImporter.cpp | 2 +- lib/Model/Importer/Binary/ELFImporter.h | 2 +- lib/Model/Importer/Binary/MachOImporter.cpp | 2 +- lib/Model/Importer/Binary/PECOFFImporter.cpp | 2 +- .../Importer/DebugInfo/DwarfImporter.cpp | 6 +-- lib/Model/Importer/DebugInfo/PDBImporter.cpp | 2 +- lib/Model/Pass/DeduplicateEquivalentTypes.cpp | 2 +- .../Pass/PurgeUnnamedAndUnreachableTypes.cpp | 2 +- lib/Pipeline/Context.cpp | 4 +- lib/Pipeline/Pipe.cpp | 2 +- lib/Pipeline/Runner.cpp | 4 +- lib/Pipeline/Step.cpp | 4 +- lib/PipelineC/Tracing/Runner.cpp | 2 +- .../ComputeStackAccessesBoundsPass.cpp | 6 +-- .../DetectStackSizePass.cpp | 8 ++-- .../InstrumentStackAccessesPass.cpp | 4 +- .../PromoteStackPointerPass.cpp | 2 +- .../SegregateStackAccessesPass.cpp | 18 ++++---- lib/RestructureCFG/BeautifyGHAST.cpp | 2 +- lib/RestructureCFG/DAGifyPass.cpp | 2 +- lib/RestructureCFG/GenericRegionInfo.cpp | 2 +- .../MaterializeTrivialGotoPass.cpp | 2 +- lib/RestructureCFG/RestructureCFG.cpp | 4 +- lib/RestructureCFG/SelectScopePass.cpp | 2 +- lib/Support/Debug.cpp | 43 ++++++------------- lib/Support/LDDTree.cpp | 6 +-- lib/Support/PathList.cpp | 4 +- lib/Support/ProgramRunner.cpp | 2 +- lib/TypeNames/DependencyGraph.cpp | 2 +- lib/TypeNames/ModelTypeNames.cpp | 2 +- lib/TypeNames/TypePrinters.cpp | 2 +- lib/UnitTestHelpers/DotGraphObject.cpp | 2 +- lib/ValueMaterializer/AdvancedValueInfo.cpp | 6 +-- lib/ValueMaterializer/DataFlowGraph.cpp | 4 +- .../DataFlowRangeAnalysis.cpp | 6 +-- lib/ValueMaterializer/ValueMaterializer.cpp | 2 +- lib/Yield/Assembly/DisassemblyHelper.cpp | 6 +-- tools/model/import/debug-info/Main.cpp | 2 +- 109 files changed, 235 insertions(+), 262 deletions(-) diff --git a/include/revng/DataLayoutAnalysis/DLATypeSystem.h b/include/revng/DataLayoutAnalysis/DLATypeSystem.h index e221688af..2957e45d6 100644 --- a/include/revng/DataLayoutAnalysis/DLATypeSystem.h +++ b/include/revng/DataLayoutAnalysis/DLATypeSystem.h @@ -152,7 +152,7 @@ public: std::strong_ordering operator<=>(const TypeLinkTag &Other) const = default; friend void - writeToLog(Logger &L, const dla::TypeLinkTag &T, int /* Ignore */); + writeToLog(Logger &L, const dla::TypeLinkTag &T, int /* Ignore */); }; // end class TypeLinkTag diff --git a/include/revng/EarlyFunctionAnalysis/AnalyzeRegisterUsage.h b/include/revng/EarlyFunctionAnalysis/AnalyzeRegisterUsage.h index e458d2416..b01601d71 100644 --- a/include/revng/EarlyFunctionAnalysis/AnalyzeRegisterUsage.h +++ b/include/revng/EarlyFunctionAnalysis/AnalyzeRegisterUsage.h @@ -68,8 +68,7 @@ public: void dump(T &Output, const char *Prefix = "") const; }; -extern template void RUAResults::dump>(Logger &, - const char *) const; +extern template void RUAResults::dump(Logger &, const char *) const; RUAResults analyzeRegisterUsage(llvm::Function *F, const GeneratedCodeBasicInfo &, diff --git a/include/revng/Lift/CSVOffsets.h b/include/revng/Lift/CSVOffsets.h index c84fbd8bf..95e76dd31 100644 --- a/include/revng/Lift/CSVOffsets.h +++ b/include/revng/Lift/CSVOffsets.h @@ -8,7 +8,6 @@ #include "revng/Support/Assert.h" -template class Logger; /// Different types of accesses to the CPU State Variables (CSVs), with a set of @@ -72,7 +71,7 @@ public: } public: - friend void writeToLog(Logger &L, const CSVOffsets &O, int /*Ignore*/); + friend void writeToLog(Logger &L, const CSVOffsets &O, int /*Ignore*/); private: explicit operator Kind() const { return OffsetKind; } diff --git a/include/revng/MFP/MFP.h b/include/revng/MFP/MFP.h index 589cc64c4..fdaf5e2be 100644 --- a/include/revng/MFP/MFP.h +++ b/include/revng/MFP/MFP.h @@ -22,7 +22,7 @@ namespace MFP { -inline Logger<> NullLogger(""); +inline Logger NullLogger(""); template void dump(llvm::raw_ostream &Stream, unsigned Indent, const T &Element) { @@ -87,7 +87,7 @@ getMaximalFixedPoint(const MFIType &MFI, typename MFIType::LatticeElement ExtremalValue, const std::vector &ExtremalLabels, const std::vector &InitialNodes, - Logger<> &Logger = NullLogger) { + Logger &Logger = NullLogger) { using Label = typename MFIType::Label; using LatticeElement = typename MFIType::LatticeElement; @@ -111,13 +111,13 @@ getMaximalFixedPoint(const MFIType &MFI, if (Logger.isEnabled()) { revng_log(Logger, "Initializing extremal labels"); - LoggerIndent<> Indent(Logger); + LoggerIndent Indent(Logger); Logger << "Extremal value:\n"; MFP::dump(*Logger.getAsLLVMStream(), 1, ExtremalValue); Logger << DoLog; Logger << "Extremal labels:" << DoLog; - LoggerIndent<> Indent2(Logger); + LoggerIndent Indent2(Logger); for (Label ExtremalLabel : ExtremalLabels) { MFP::dumpLabel(*Logger.getAsLLVMStream(), ExtremalLabel); Logger << DoLog; @@ -129,13 +129,13 @@ getMaximalFixedPoint(const MFIType &MFI, if (Logger.isEnabled()) { revng_log(Logger, "Initializing initial nodes"); - LoggerIndent<> Indent(Logger); + LoggerIndent Indent(Logger); Logger << "Initial value:\n"; MFP::dump(*Logger.getAsLLVMStream(), 1, InitialValue); Logger << DoLog; Logger << "Initial labels:" << DoLog; - LoggerIndent<> Indent2(Logger); + LoggerIndent Indent2(Logger); for (Label InitialNode : InitialNodes) { MFP::dumpLabel(*Logger.getAsLLVMStream(), InitialNode); Logger << DoLog; @@ -163,7 +163,7 @@ getMaximalFixedPoint(const MFIType &MFI, // Step 2 iterations revng_log(Logger, "Starting the iterations"); - LoggerIndent<> Indent(Logger); + LoggerIndent Indent(Logger); unsigned IterationIndex = 0; while (not Worklist.empty()) { @@ -180,7 +180,7 @@ getMaximalFixedPoint(const MFIType &MFI, Logger << DoLog; } - LoggerIndent<> Indent(Logger); + LoggerIndent Indent(Logger); if (Logger.isEnabled()) { Logger << "Initial value:\n"; @@ -199,7 +199,7 @@ getMaximalFixedPoint(const MFIType &MFI, Logger.unindent(); if (Logger.isEnabled()) { - LoggerIndent<> Indent(Logger); + LoggerIndent Indent(Logger); Logger << "New final value:\n"; MFP::dump(*Logger.getAsLLVMStream(), 1, New); Logger << DoLog; @@ -212,7 +212,7 @@ getMaximalFixedPoint(const MFIType &MFI, // Enqueue successors that need to be recomputed revng_log(Logger, "Processing successors:"); - LoggerIndent<> Indent2(Logger); + LoggerIndent Indent2(Logger); for (Label Successor : successors(Start)) { auto &SuccessorResults = AnalysisResult.at(Successor); @@ -222,12 +222,12 @@ getMaximalFixedPoint(const MFIType &MFI, Logger << DoLog; Logger << "Initial value:\n"; - LoggerIndent<> Indent(Logger); + LoggerIndent Indent(Logger); Logger << DoLog; MFP::dump(*Logger.getAsLLVMStream(), 1, SuccessorResults.InValue); Logger << DoLog; } - LoggerIndent<> Indent(Logger); + LoggerIndent Indent(Logger); if (not MFI.isLessOrEqual(LabelAnalysis.OutValue, SuccessorResults.InValue)) { @@ -265,7 +265,7 @@ getMaximalFixedPoint(const MFI &Instance, typename MFI::LatticeElement InitialValue, typename MFI::LatticeElement ExtremalValue, const std::vector &ExtremalLabels, - Logger<> &Logger = NullLogger) { + Logger &Logger = NullLogger) { using Label = typename MFI::Label; std::vector