From 98983f621a499c1bbc643a63231f1cf29241ea55 Mon Sep 17 00:00:00 2001 From: Henner Zeller Date: Fri, 8 Nov 2024 21:43:49 -0800 Subject: [PATCH] Fix run-clang-format.sh to also run over headers. Since the headers moved to its include/... directory a while back, the run-clang-format.sh was not seeing them anymore, as it only was looking in src. Fix that, and run clang-format. --- .github/bin/run-clang-format.sh | 2 +- include/Surelog/API/SLAPI.h | 17 ++++--- include/Surelog/Cache/PPCache.h | 2 +- include/Surelog/Cache/ParseCache.h | 8 +-- .../Surelog/CommandLine/CommandLineParser.h | 6 +-- include/Surelog/Common/FileSystem.h | 45 +++++++++------- include/Surelog/Common/NodeId.h | 51 ++++++++++++++----- include/Surelog/Common/PathId.h | 12 ++--- include/Surelog/Common/PlatformFileSystem.h | 10 ++-- include/Surelog/Common/SymbolId.h | 6 +-- include/Surelog/Design/ClockingBlock.h | 11 ++-- include/Surelog/Design/DefParam.h | 2 +- include/Surelog/Design/Design.h | 11 ++-- include/Surelog/Design/DesignComponent.h | 18 ++++--- include/Surelog/Design/Enum.h | 7 +-- include/Surelog/Design/FileContent.h | 19 +++---- include/Surelog/Design/Function.h | 4 +- include/Surelog/Design/ModuleDefinition.h | 10 ++-- include/Surelog/Design/ModuleInstance.h | 13 +++-- include/Surelog/Design/Netlist.h | 4 +- include/Surelog/Design/Parameter.h | 3 +- include/Surelog/Design/Scope.h | 6 +-- include/Surelog/Design/Signal.h | 4 +- include/Surelog/Design/Statement.h | 8 +-- include/Surelog/Design/Task.h | 2 +- include/Surelog/Design/TfPortItem.h | 3 +- include/Surelog/Design/VObject.h | 6 +-- include/Surelog/Design/ValuedComponentI.h | 3 +- include/Surelog/DesignCompile/CompileClass.h | 5 +- include/Surelog/DesignCompile/CompileDesign.h | 8 ++- .../DesignCompile/CompileFileContent.h | 15 +++--- include/Surelog/DesignCompile/CompileHelper.h | 30 ++++++----- include/Surelog/DesignCompile/CompileModule.h | 4 +- .../Surelog/DesignCompile/DesignElaboration.h | 11 ++-- .../Surelog/DesignCompile/ElaborationStep.h | 13 +++-- .../Surelog/DesignCompile/ElaboratorHarness.h | 2 +- .../DesignCompile/NetlistElaboration.h | 3 +- .../Surelog/DesignCompile/ResolveSymbols.h | 4 +- include/Surelog/DesignCompile/UhdmChecker.h | 4 +- include/Surelog/DesignCompile/UhdmWriter.h | 26 ++++++---- .../Surelog/ErrorReporting/ErrorContainer.h | 4 +- .../Surelog/ErrorReporting/ErrorDefinition.h | 36 ++++++------- include/Surelog/ErrorReporting/LogListener.h | 6 +-- include/Surelog/ErrorReporting/Waiver.h | 4 +- include/Surelog/Expression/ExprBuilder.h | 3 +- include/Surelog/Expression/Value.h | 9 +++- .../Library/AntlrLibParserErrorListener.h | 5 +- include/Surelog/Library/SVLibShapeListener.h | 8 +-- include/Surelog/SourceCompile/AnalyzeFile.h | 8 ++- .../SourceCompile/AntlrParserErrorListener.h | 8 +-- .../SourceCompile/CommonListenerHelper.h | 5 +- .../Surelog/SourceCompile/CompilationUnit.h | 5 +- .../Surelog/SourceCompile/CompileSourceFile.h | 2 +- include/Surelog/SourceCompile/Compiler.h | 3 +- include/Surelog/SourceCompile/ParseFile.h | 4 +- include/Surelog/SourceCompile/ParserHarness.h | 6 +-- .../Surelog/SourceCompile/PreprocessFile.h | 6 +-- .../Surelog/SourceCompile/PreprocessHarness.h | 5 +- .../SV3_1aPpTreeListenerHelper.h | 7 ++- .../SourceCompile/SV3_1aTreeShapeHelper.h | 7 ++- include/Surelog/Testbench/ClassDefinition.h | 8 ++- include/Surelog/Testbench/ClassObject.h | 4 +- include/Surelog/Testbench/FunctionMethod.h | 3 +- include/Surelog/Testbench/Program.h | 3 +- include/Surelog/Testbench/Property.h | 3 +- include/Surelog/Testbench/TaskMethod.h | 4 +- include/Surelog/Testbench/TypeDef.h | 2 +- include/Surelog/Utils/ParseUtils.h | 5 +- include/Surelog/Utils/StringUtils.h | 2 +- 69 files changed, 330 insertions(+), 263 deletions(-) diff --git a/.github/bin/run-clang-format.sh b/.github/bin/run-clang-format.sh index 9ff61b9d72..62e33db6f2 100755 --- a/.github/bin/run-clang-format.sh +++ b/.github/bin/run-clang-format.sh @@ -16,7 +16,7 @@ FORMAT_OUT=${TMPDIR:-/tmp}/clang-format-diff.out # Run on all c++ files. -find src -name "*.h" -o -name "*.cpp" | xargs clang-format --style=Google -i +find include src -name "*.h" -o -name "*.cpp" | xargs clang-format --style=Google -i # Check if we got any diff, then print it out in in the CI. # TODO: make these suggested diffs in the pull request. diff --git a/include/Surelog/API/SLAPI.h b/include/Surelog/API/SLAPI.h index a0a2680ca6..6a3f6864b5 100644 --- a/include/Surelog/API/SLAPI.h +++ b/include/Surelog/API/SLAPI.h @@ -78,16 +78,17 @@ void SLaddMLErrorContext(SV3_1aPythonListener* prog, void SLaddMLError(ErrorContainer* container, const char* messageId, const char* fileName1, uint32_t line1, uint32_t col1, const char* objectName1, const char* fileName2, - uint32_t line2, uint32_t col2, - const char* objectName2); + uint32_t line2, uint32_t col2, const char* objectName2); /* File Listener API */ std::string SLgetFile(SV3_1aPythonListener* prog, antlr4::ParserRuleContext* context); -int32_t SLgetLine(SV3_1aPythonListener* prog, antlr4::ParserRuleContext* context); +int32_t SLgetLine(SV3_1aPythonListener* prog, + antlr4::ParserRuleContext* context); -int32_t SLgetColumn(SV3_1aPythonListener* prog, antlr4::ParserRuleContext* context); +int32_t SLgetColumn(SV3_1aPythonListener* prog, + antlr4::ParserRuleContext* context); std::string SLgetText(SV3_1aPythonListener* prog, antlr4::ParserRuleContext* context); @@ -119,10 +120,10 @@ std::string SLgetName(FileContent* fC, RawNodeId index); uint32_t SLgetType(FileContent* fC, RawNodeId index); RawNodeId SLgetChild(FileContent* fC, RawNodeId parent, - uint32_t type); // Get first child item of type + uint32_t type); // Get first child item of type RawNodeId SLgetParent(FileContent* fC, RawNodeId parent, - uint32_t type); // Get first parent item of type + uint32_t type); // Get first parent item of type UIntVector SLgetAll(FileContent* fC, RawNodeId parent, uint32_t type); // get all child items of type @@ -143,8 +144,8 @@ UIntVector SLcollectAll( bool first); // Recursively search for all items of types UIntVector SLcollectAll(FileContent* fC, RawNodeId parent, - const UIntVector& types, - const UIntVector& stopPoints, bool first); + const UIntVector& types, const UIntVector& stopPoints, + bool first); // Recursively search for all items of types // and stops at types stopPoints /* Design API */ diff --git a/include/Surelog/Cache/PPCache.h b/include/Surelog/Cache/PPCache.h index ec3e35f53d..2bebb5876d 100644 --- a/include/Surelog/Cache/PPCache.h +++ b/include/Surelog/Cache/PPCache.h @@ -73,7 +73,7 @@ class PPCache : Cache { const SymbolTable& sourceSymbols); void cacheTimeInfos(::PPCache::Builder builder, SymbolTable& targetSymbols, - const SymbolTable& sourceSymbols); + const SymbolTable& sourceSymbols); void cacheLineTranslationInfos(::PPCache::Builder builder, SymbolTable& targetSymbols, diff --git a/include/Surelog/Cache/ParseCache.h b/include/Surelog/Cache/ParseCache.h index 16af42748b..5b49c9114d 100644 --- a/include/Surelog/Cache/ParseCache.h +++ b/include/Surelog/Cache/ParseCache.h @@ -62,11 +62,11 @@ class ParseCache final : Cache { // to IDs used on the cache on disk. // Updates "targetSymbols" if new IDs are needed. void cacheVObjects(::ParseCache::Builder builder, const FileContent* fC, - SymbolTable& targetSymbols, const SymbolTable& sourceSymbols, - PathId fileId); + SymbolTable& targetSymbols, + const SymbolTable& sourceSymbols, PathId fileId); - void cacheDesignElements(::ParseCache::Builder builder, - const FileContent* fC, SymbolTable& targetSymbols, + void cacheDesignElements(::ParseCache::Builder builder, const FileContent* fC, + SymbolTable& targetSymbols, const SymbolTable& sourceSymbols); bool restore(PathId cacheFileId); diff --git a/include/Surelog/CommandLine/CommandLineParser.h b/include/Surelog/CommandLine/CommandLineParser.h index 9861b4ab74..e963de823f 100644 --- a/include/Surelog/CommandLine/CommandLineParser.h +++ b/include/Surelog/CommandLine/CommandLineParser.h @@ -25,16 +25,16 @@ #define SURELOG_COMMANDLINEPARSER_H #pragma once -#include -#include -#include #include #include #include +#include #include #include #include +#include +#include #include namespace SURELOG { diff --git a/include/Surelog/Common/FileSystem.h b/include/Surelog/Common/FileSystem.h index dfbde3361c..e0bb7cd343 100644 --- a/include/Surelog/Common/FileSystem.h +++ b/include/Surelog/Common/FileSystem.h @@ -25,20 +25,20 @@ #define SURELOG_FILESYSTEM_H #pragma once -#include -#include -#include -#include #include #include #include +#include #include #include #include +#include #include #include #include +#include +#include namespace SURELOG { class SymbolTable; @@ -77,7 +77,8 @@ class SymbolTable; * * NOTE: * toPath(id) == toPath(toPathId(toPath(id))) but - * toPlatformAbsPath(id) <> toPlatformAbsPath(toPathId(toPlatformAbsPath(id))) + * toPlatformAbsPath(id) <> + * toPlatformAbsPath(toPathId(toPlatformAbsPath(id))) * * i.e. string representation can be converted to id (and vice-versa) * using toPathId & toPath but the same is not necessarily guaranteed @@ -132,7 +133,7 @@ class FileSystem { // and can be used for, say, system commands. virtual std::filesystem::path toPlatformAbsPath(PathId id) = 0; virtual std::filesystem::path toPlatformRelPath(PathId id) = 0; - // Returns base and relative paths + // Returns base and relative paths virtual std::pair toSplitPlatformPath(PathId id) = 0; @@ -147,7 +148,8 @@ class FileSystem { // Open/Close an input stream represented by the input PathId. // openForRead defaults the ios_base::openmode to ios_base::text // openForLoad defaults the ios_base::openmode to ios_base::binary - virtual std::istream &openInput(PathId fileId, std::ios_base::openmode mode) = 0; + virtual std::istream &openInput(PathId fileId, + std::ios_base::openmode mode) = 0; std::istream &openForRead(PathId fileId); std::istream &openForLoad(PathId fileId); virtual bool close(std::istream &strm) = 0; @@ -155,7 +157,8 @@ class FileSystem { // Open/Close an output stream represented by the input PathId. // openForWrite defaults the ios_base::openmode to ios_base::text // openForSave defaults the ios_base::openmode to ios_base::binary - virtual std::ostream &openOutput(PathId fileId, std::ios_base::openmode mode) = 0; + virtual std::ostream &openOutput(PathId fileId, + std::ios_base::openmode mode) = 0; std::ostream &openForWrite(PathId fileId); std::ostream &openForSave(PathId fileId); virtual bool close(std::ostream &strm) = 0; @@ -203,9 +206,12 @@ class FileSystem { virtual PathId getProgramFile(std::string_view hint, SymbolTable *symbolTable) = 0; - virtual PathId getWorkingDir(std::string_view dir, SymbolTable *symbolTable) = 0; - virtual PathId getOutputDir(std::string_view dir, SymbolTable *symbolTable) = 0; - virtual PathId getPrecompiledDir(PathId programId, SymbolTable *symbolTable) = 0; + virtual PathId getWorkingDir(std::string_view dir, + SymbolTable *symbolTable) = 0; + virtual PathId getOutputDir(std::string_view dir, + SymbolTable *symbolTable) = 0; + virtual PathId getPrecompiledDir(PathId programId, + SymbolTable *symbolTable) = 0; virtual PathId getLogFile(bool isUnitCompilation, std::string_view filename, SymbolTable *symbolTable) = 0; @@ -222,23 +228,23 @@ class FileSystem { std::string_view libraryName, SymbolTable *symbolTable) = 0; PathId getPpOutputFile(bool isUnitCompilation, PathId sourceFileId, - SymbolId libraryNameId, - SymbolTable *symbolTable); + SymbolId libraryNameId, SymbolTable *symbolTable); virtual PathId getPpCacheFile(bool isUnitCompilation, PathId sourceFileId, std::string_view libraryName, - bool isPrecompiled, SymbolTable *symbolTable) = 0; + bool isPrecompiled, + SymbolTable *symbolTable) = 0; PathId getPpCacheFile(bool isUnitCompilation, PathId sourceFileId, - SymbolId libraryNameId, bool isPrecompiled, - SymbolTable *symbolTable); + SymbolId libraryNameId, bool isPrecompiled, + SymbolTable *symbolTable); virtual PathId getParseCacheFile(bool isUnitCompilation, PathId ppFileId, std::string_view libraryName, bool isPrecompiled, SymbolTable *symbolTable) = 0; PathId getParseCacheFile(bool isUnitCompilation, PathId ppFileId, - SymbolId libraryNameId, bool isPrecompiled, - SymbolTable *symbolTable); + SymbolId libraryNameId, bool isPrecompiled, + SymbolTable *symbolTable); virtual PathId getPythonCacheFile(bool isUnitCompilation, PathId sourceFileId, std::string_view libraryName, @@ -257,7 +263,8 @@ class FileSystem { virtual PathId getCheckerDir(bool isUnitCompilation, SymbolTable *symbolTable) = 0; - virtual PathId getCheckerFile(PathId uhdmFileId, SymbolTable *symbolTable) = 0; + virtual PathId getCheckerFile(PathId uhdmFileId, + SymbolTable *symbolTable) = 0; virtual PathId getCheckerHtmlFile(PathId uhdmFileId, SymbolTable *symbolTable) = 0; virtual PathId getCheckerHtmlFile(PathId uhdmFileId, int32_t index, diff --git a/include/Surelog/Common/NodeId.h b/include/Surelog/Common/NodeId.h index 540adaa587..365950f2ee 100644 --- a/include/Surelog/Common/NodeId.h +++ b/include/Surelog/Common/NodeId.h @@ -21,8 +21,8 @@ #include #include #include -#include #include +#include namespace SURELOG { /** @@ -33,7 +33,8 @@ namespace SURELOG { * */ typedef uint32_t RawNodeId; -inline static constexpr RawNodeId InvalidRawNodeId = 0; // Max of 28 bits as per cache! +inline static constexpr RawNodeId InvalidRawNodeId = + 0; // Max of 28 bits as per cache! class NodeId final { public: constexpr NodeId() : NodeId(InvalidRawNodeId) {} @@ -64,28 +65,54 @@ class NodeId final { NodeId operator-(const NodeId &rhs) const { return NodeId(id - rhs.id); } NodeId operator+(const NodeId &rhs) const { return NodeId(id + rhs.id); } - NodeId &operator-=(const NodeId &rhs) { id -= rhs.id; return *this; } - NodeId &operator+=(const NodeId &rhs) { id += rhs.id; return *this; } + NodeId &operator-=(const NodeId &rhs) { + id -= rhs.id; + return *this; + } + NodeId &operator+=(const NodeId &rhs) { + id += rhs.id; + return *this; + } template ::value>::type> - bool operator<(const U &rhs) const { return id < rhs; } + bool operator<(const U &rhs) const { + return id < rhs; + } template ::value>::type> - bool operator<=(const U &rhs) const { return id <= rhs; } + bool operator<=(const U &rhs) const { + return id <= rhs; + } template ::value>::type> - bool operator>(const U &rhs) const { return id > rhs; } + bool operator>(const U &rhs) const { + return id > rhs; + } template ::value>::type> - bool operator>=(const U &rhs) const { return id >= rhs; } + bool operator>=(const U &rhs) const { + return id >= rhs; + } - NodeId &operator++() { ++id; return *this; } - NodeId operator++(int) { const NodeId rid(id++); return rid; } + NodeId &operator++() { + ++id; + return *this; + } + NodeId operator++(int) { + const NodeId rid(id++); + return rid; + } - NodeId &operator--() { --id; return *this; } - NodeId operator--(int) { const NodeId rid(id--); return rid; } + NodeId &operator--() { + --id; + return *this; + } + NodeId operator--(int) { + const NodeId rid(id--); + return rid; + } NodeId &operator=(const NodeId &rhs) { if (this != &rhs) { diff --git a/include/Surelog/Common/PathId.h b/include/Surelog/Common/PathId.h index dc6c194c93..8b3ce94166 100644 --- a/include/Surelog/Common/PathId.h +++ b/include/Surelog/Common/PathId.h @@ -18,8 +18,6 @@ #define SURELOG_PATHID_H #pragma once -#include "Surelog/config.h" - #include #include @@ -29,6 +27,8 @@ #include #include +#include "Surelog/config.h" + namespace SURELOG { /** * class PathId @@ -52,8 +52,7 @@ class SymbolTable; class PathId final { public: #if SURELOG_PATHID_DEBUG_ENABLED - PathId() - : m_symbolTable(nullptr), m_id(BadRawPathId), m_value(BadRawPath) {} + PathId() : m_symbolTable(nullptr), m_id(BadRawPathId), m_value(BadRawPath) {} PathId(const SymbolTable *const symbolTable, RawPathId id, std::string_view value) : m_symbolTable(symbolTable), m_id(id), m_value(value) {} @@ -66,8 +65,7 @@ class PathId final { PathId(const SymbolTable *const symbolTable, RawPathId id, std::string_view value) : m_symbolTable(symbolTable), m_id(id) {} - PathId(const PathId &rhs) - : PathId(rhs.m_symbolTable, rhs.m_id, BadRawPath) {} + PathId(const PathId &rhs) : PathId(rhs.m_symbolTable, rhs.m_id, BadRawPath) {} PathId(const SymbolTable *const symbolTable, SymbolId id) : PathId(symbolTable, (RawSymbolId)id, BadRawPath) {} #endif @@ -117,7 +115,7 @@ inline std::ostream &operator<<(std::ostream &strm, const PathId &pathId) { return strm << pathId.m_id; } -struct PathIdPP final { // Pretty Printer +struct PathIdPP final { // Pretty Printer const PathId &m_id; explicit PathIdPP(const PathId &id) : m_id(id) {} diff --git a/include/Surelog/Common/PlatformFileSystem.h b/include/Surelog/Common/PlatformFileSystem.h index 635d7a1a2a..fc1cc46334 100644 --- a/include/Surelog/Common/PlatformFileSystem.h +++ b/include/Surelog/Common/PlatformFileSystem.h @@ -25,16 +25,16 @@ #define SURELOG_PLATFORMFILESYSTEM_H #pragma once -#include -#include -#include -#include -#include #include +#include #include #include #include +#include +#include +#include +#include namespace SURELOG { class SymbolTable; diff --git a/include/Surelog/Common/SymbolId.h b/include/Surelog/Common/SymbolId.h index a18d6e5bf9..d66f6fc116 100644 --- a/include/Surelog/Common/SymbolId.h +++ b/include/Surelog/Common/SymbolId.h @@ -10,15 +10,15 @@ using UHDM::RawSymbolId; using UHDM::SymbolId; using UHDM::SymbolIdPP; -using UHDM::BadRawSymbolId; using UHDM::BadRawSymbol; +using UHDM::BadRawSymbolId; using UHDM::BadSymbolId; using UHDM::operator<<; -using UHDM::SymbolIdLessThanComparer; -using UHDM::SymbolIdHasher; using UHDM::SymbolIdEqualityComparer; +using UHDM::SymbolIdHasher; +using UHDM::SymbolIdLessThanComparer; using UHDM::SymbolIdSet; using UHDM::SymbolIdUnorderedSet; diff --git a/include/Surelog/Design/ClockingBlock.h b/include/Surelog/Design/ClockingBlock.h index ca3297fcdc..4a94de6e95 100644 --- a/include/Surelog/Design/ClockingBlock.h +++ b/include/Surelog/Design/ClockingBlock.h @@ -41,13 +41,10 @@ class ClockingBlock final { public: enum Type { Global, Default, Regular }; // TODO: some of these parameters are not used. Correct or oversight ? - ClockingBlock([[maybe_unused]] const FileContent* fileContent, - NodeId blockId, - [[maybe_unused]] NodeId clockingBlockId, - Type type, UHDM::clocking_block* actual) - : m_blockId(blockId), - m_actual(actual), - m_type(type) {} + ClockingBlock([[maybe_unused]] const FileContent* fileContent, NodeId blockId, + [[maybe_unused]] NodeId clockingBlockId, Type type, + UHDM::clocking_block* actual) + : m_blockId(blockId), m_actual(actual), m_type(type) {} void addSignal(Signal& signal) { m_signals.push_back(signal); } NodeId getNodeId() const { return m_blockId; } diff --git a/include/Surelog/Design/DefParam.h b/include/Surelog/Design/DefParam.h index 917bbe299a..50622842c2 100644 --- a/include/Surelog/Design/DefParam.h +++ b/include/Surelog/Design/DefParam.h @@ -25,11 +25,11 @@ #define SURELOG_DEFPARAM_H #pragma once -#include #include #include #include +#include namespace SURELOG { diff --git a/include/Surelog/Design/Design.h b/include/Surelog/Design/Design.h index 41354248c1..647c5c986f 100644 --- a/include/Surelog/Design/Design.h +++ b/include/Surelog/Design/Design.h @@ -25,16 +25,16 @@ #define SURELOG_DESIGN_H #pragma once -#include -#include -#include -#include #include #include #include +#include #include #include +#include +#include +#include #include namespace SURELOG { @@ -130,8 +130,7 @@ class Design final { std::string reportInstanceTree() const; - void reportInstanceTreeStats(uint32_t& nbTopLevelModules, - uint32_t& maxDepth, + void reportInstanceTreeStats(uint32_t& nbTopLevelModules, uint32_t& maxDepth, uint32_t& numberOfInstances, uint32_t& numberOfLeafInstances, uint32_t& nbUndefinedModules, diff --git a/include/Surelog/Design/DesignComponent.h b/include/Surelog/Design/DesignComponent.h index c3ea8b716c..ae416d26ef 100644 --- a/include/Surelog/Design/DesignComponent.h +++ b/include/Surelog/Design/DesignComponent.h @@ -25,12 +25,6 @@ #define SURELOG_DESIGNCOMPONENT_H #pragma once -#include -#include -#include -#include -#include -#include #include #include #include @@ -40,6 +34,13 @@ #include #include +#include +#include +#include +#include +#include +#include + // UHDM #include @@ -99,7 +100,8 @@ class DesignComponent : public ValuedComponentI, public PortNetHolder { typedef std::map, StringViewCompare> NamedObjectMap; - typedef std::vector> FuncNameTypespecVec; + typedef std::vector> + FuncNameTypespecVec; void addFileContent(const FileContent* fileContent, NodeId nodeId); const std::vector& getFileContents() const { @@ -244,7 +246,7 @@ class DesignComponent : public ValuedComponentI, public PortNetHolder { std::vector m_imported_symbols; std::vector m_elab_sys_calls; std::vector m_property_decls; - std::vector m_sequence_decls; + std::vector m_sequence_decls; std::vector m_needLateBinding; std::vector m_needLateTypedefBinding; FuncNameTypespecVec m_lateResolutionFunctions; diff --git a/include/Surelog/Design/Enum.h b/include/Surelog/Design/Enum.h index b52c15ccda..c84c93c904 100644 --- a/include/Surelog/Design/Enum.h +++ b/include/Surelog/Design/Enum.h @@ -25,12 +25,13 @@ #define SURELOG_ENUM_H #pragma once -#include -#include -#include #include #include +#include +#include +#include + // UHDM #include diff --git a/include/Surelog/Design/FileContent.h b/include/Surelog/Design/FileContent.h index 9759729e0d..5eece2f2ed 100644 --- a/include/Surelog/Design/FileContent.h +++ b/include/Surelog/Design/FileContent.h @@ -25,16 +25,16 @@ #define SURELOG_FILECONTENT_H #pragma once -#include -#include -#include -#include -#include #include #include #include #include +#include +#include +#include +#include +#include #include #include #include @@ -118,14 +118,15 @@ class FileContent final : public DesignComponent { PathId* getMutableFileId(NodeId id); Library* getLibrary() const { return m_library; } std::vector& getDesignElements() { return m_elements; } - const std::vector& getDesignElements() const { return m_elements; } + const std::vector& getDesignElements() const { + return m_elements; + } void addDesignElement(std::string_view name, DesignElement* elem); const DesignElement* getDesignElement(std::string_view name) const; using DesignComponent::addObject; NodeId addObject(SymbolId name, PathId fileId, VObjectType type, - uint32_t line, uint16_t column, - uint32_t endLine, uint16_t endColumn, - NodeId parent = InvalidNodeId, + uint32_t line, uint16_t column, uint32_t endLine, + uint16_t endColumn, NodeId parent = InvalidNodeId, NodeId definition = InvalidNodeId, NodeId child = InvalidNodeId, NodeId sibling = InvalidNodeId); diff --git a/include/Surelog/Design/Function.h b/include/Surelog/Design/Function.h index 3c7f932751..edbd8134a7 100644 --- a/include/Surelog/Design/Function.h +++ b/include/Surelog/Design/Function.h @@ -25,14 +25,14 @@ #define SURELOG_FUNCTION_H #pragma once -#include -#include #include #include #include #include #include +#include +#include namespace SURELOG { diff --git a/include/Surelog/Design/ModuleDefinition.h b/include/Surelog/Design/ModuleDefinition.h index 12a4eacbab..41f07b782a 100644 --- a/include/Surelog/Design/ModuleDefinition.h +++ b/include/Surelog/Design/ModuleDefinition.h @@ -25,15 +25,16 @@ #define SURELOG_MODULEDEFINITION_H #pragma once -#include -#include -#include #include #include #include #include #include +#include +#include +#include + // UHDM #include @@ -45,7 +46,8 @@ namespace SURELOG { class CompileModule; class FileContent; -class ModuleDefinition final : public DesignComponent, public ClockingBlockHolder { +class ModuleDefinition final : public DesignComponent, + public ClockingBlockHolder { SURELOG_IMPLEMENT_RTTI(ModuleDefinition, DesignComponent) friend CompileModule; diff --git a/include/Surelog/Design/ModuleInstance.h b/include/Surelog/Design/ModuleInstance.h index b1a5dbf2d1..3d5008b0a4 100644 --- a/include/Surelog/Design/ModuleInstance.h +++ b/include/Surelog/Design/ModuleInstance.h @@ -25,18 +25,18 @@ #define SURELOG_MODULEINSTANCE_H #pragma once -#include -#include -#include -#include #include #include #include #include #include +#include +#include +#include +#include #include -#include +#include namespace SURELOG { @@ -104,8 +104,7 @@ class ModuleInstance final : public ValuedComponentI { std::vector& getTypeParams() { return m_typeParams; } - Value* getValue(std::string_view name, - ExprBuilder& exprBuilder) const final; + Value* getValue(std::string_view name, ExprBuilder& exprBuilder) const final; UHDM::expr* getComplexValue(std::string_view name) const final; ModuleInstance* getInstanceBinding() { return m_boundInstance; } diff --git a/include/Surelog/Design/Netlist.h b/include/Surelog/Design/Netlist.h index 150f37441c..6b6266b8c8 100644 --- a/include/Surelog/Design/Netlist.h +++ b/include/Surelog/Design/Netlist.h @@ -26,12 +26,12 @@ #pragma once // UHDM -#include -#include #include +#include #include #include +#include #include namespace SURELOG { diff --git a/include/Surelog/Design/Parameter.h b/include/Surelog/Design/Parameter.h index 478ae797ac..7e52ee5bf6 100644 --- a/include/Surelog/Design/Parameter.h +++ b/include/Surelog/Design/Parameter.h @@ -25,10 +25,11 @@ #define SURELOG_PARAMETER_H #pragma once -#include #include #include +#include + // UHDM #include diff --git a/include/Surelog/Design/Scope.h b/include/Surelog/Design/Scope.h index e13d41a7ef..182dc32f64 100644 --- a/include/Surelog/Design/Scope.h +++ b/include/Surelog/Design/Scope.h @@ -25,12 +25,12 @@ #define SURELOG_SCOPE_H #pragma once -#include -#include #include -#include +#include #include +#include +#include #include namespace SURELOG { diff --git a/include/Surelog/Design/Signal.h b/include/Surelog/Design/Signal.h index 4afd26361e..4d7f707c02 100644 --- a/include/Surelog/Design/Signal.h +++ b/include/Surelog/Design/Signal.h @@ -25,13 +25,13 @@ #define SURELOG_SIGNAL_H #pragma once -#include -#include #include #include #include #include +#include +#include namespace SURELOG { diff --git a/include/Surelog/Design/Statement.h b/include/Surelog/Design/Statement.h index 9dff298a45..3d71e95390 100644 --- a/include/Surelog/Design/Statement.h +++ b/include/Surelog/Design/Statement.h @@ -25,14 +25,14 @@ #define SURELOG_STATEMENT_H #pragma once -#include -#include #include #include #include #include #include +#include +#include #include namespace SURELOG { @@ -67,7 +67,9 @@ class Statement : public RTTI { virtual Function* getFunction() { return nullptr; } virtual void setFunction(Function* function) {} - void addStatement(Statement* statement) { m_statements.emplace_back(statement); } + void addStatement(Statement* statement) { + m_statements.emplace_back(statement); + } const StatementVector& getStatements() const { return m_statements; } private: diff --git a/include/Surelog/Design/Task.h b/include/Surelog/Design/Task.h index 26f5c5aa52..e3105326c6 100644 --- a/include/Surelog/Design/Task.h +++ b/include/Surelog/Design/Task.h @@ -25,11 +25,11 @@ #define SURELOG_TASK_H #pragma once -#include #include #include #include +#include namespace SURELOG { diff --git a/include/Surelog/Design/TfPortItem.h b/include/Surelog/Design/TfPortItem.h index b492cca587..86e08cc7ff 100644 --- a/include/Surelog/Design/TfPortItem.h +++ b/include/Surelog/Design/TfPortItem.h @@ -25,10 +25,11 @@ #define SURELOG_TFPORTITEM_H #pragma once -#include #include #include +#include + namespace SURELOG { class Procedure; diff --git a/include/Surelog/Design/VObject.h b/include/Surelog/Design/VObject.h index 3813522d13..c7bde4015b 100644 --- a/include/Surelog/Design/VObject.h +++ b/include/Surelog/Design/VObject.h @@ -25,7 +25,6 @@ #define SURELOG_VOBJECT_H #pragma once -#include #include #include #include @@ -33,6 +32,7 @@ #include #include +#include namespace SURELOG { @@ -48,8 +48,8 @@ class VObject final { InvalidNodeId /* sibling */) {} VObject(SymbolId name, PathId fileId, VObjectType type, uint32_t line, - uint16_t column, uint32_t endLine, uint16_t endColumn, - NodeId parent, NodeId definition, NodeId child, NodeId sibling) + uint16_t column, uint32_t endLine, uint16_t endColumn, NodeId parent, + NodeId definition, NodeId child, NodeId sibling) : m_name(name), m_fileId(fileId), m_type(type), diff --git a/include/Surelog/Design/ValuedComponentI.h b/include/Surelog/Design/ValuedComponentI.h index 9b6b175363..520a95aa93 100644 --- a/include/Surelog/Design/ValuedComponentI.h +++ b/include/Surelog/Design/ValuedComponentI.h @@ -25,10 +25,11 @@ #define SURELOG_VALUEDCOMPONENTI_H #pragma once -#include #include #include +#include + // UHDM #include diff --git a/include/Surelog/DesignCompile/CompileClass.h b/include/Surelog/DesignCompile/CompileClass.h index 7582c5a59b..30f9328cde 100644 --- a/include/Surelog/DesignCompile/CompileClass.h +++ b/include/Surelog/DesignCompile/CompileClass.h @@ -25,11 +25,12 @@ #define SURELOG_COMPILECLASS_H #pragma once -#include -#include #include #include +#include +#include + namespace SURELOG { struct FunctorCompileClass { diff --git a/include/Surelog/DesignCompile/CompileDesign.h b/include/Surelog/DesignCompile/CompileDesign.h index b645d45320..c112cc41f7 100644 --- a/include/Surelog/DesignCompile/CompileDesign.h +++ b/include/Surelog/DesignCompile/CompileDesign.h @@ -25,9 +25,10 @@ #define SURELOG_COMPILEDESIGN_H #pragma once +#include + #include #include -#include // UHDM #include @@ -59,7 +60,10 @@ class CompileDesign { void lockSerializer() { m_serializerMutex.lock(); } void unlockSerializer() { m_serializerMutex.unlock(); } UHDM::VectorOfinclude_file_info* getFileInfo() { return m_fileInfo; } - std::map& getSwapedObjects() { return m_typespecSwapMap; } + std::map& getSwapedObjects() { + return m_typespecSwapMap; + } + private: CompileDesign(const CompileDesign& orig) = delete; diff --git a/include/Surelog/DesignCompile/CompileFileContent.h b/include/Surelog/DesignCompile/CompileFileContent.h index def2794116..56e3f4254a 100644 --- a/include/Surelog/DesignCompile/CompileFileContent.h +++ b/include/Surelog/DesignCompile/CompileFileContent.h @@ -37,8 +37,8 @@ class ErrorContainer; struct FunctorCompileFileContentDecl { FunctorCompileFileContentDecl(CompileDesign* compiler, FileContent* file, - Design* design, SymbolTable* symbols, - ErrorContainer* errors) + Design* design, SymbolTable* symbols, + ErrorContainer* errors) : m_compileDesign(compiler), m_fileContent(file), m_design(design), @@ -75,12 +75,13 @@ struct FunctorCompileFileContent { class CompileFileContent final { public: - CompileFileContent(CompileDesign* compiler, FileContent* file, - Design* design, - bool declOnly, - [[maybe_unused]] SymbolTable* symbols, + CompileFileContent(CompileDesign* compiler, FileContent* file, Design* design, + bool declOnly, [[maybe_unused]] SymbolTable* symbols, [[maybe_unused]] ErrorContainer* errors) - : m_compileDesign(compiler), m_fileContent(file), m_design(design), m_declOnly(declOnly) { + : m_compileDesign(compiler), + m_fileContent(file), + m_design(design), + m_declOnly(declOnly) { m_helper.seterrorReporting(errors, symbols); } diff --git a/include/Surelog/DesignCompile/CompileHelper.h b/include/Surelog/DesignCompile/CompileHelper.h index 461830ba62..b94f15e663 100644 --- a/include/Surelog/DesignCompile/CompileHelper.h +++ b/include/Surelog/DesignCompile/CompileHelper.h @@ -25,16 +25,16 @@ #define SURELOG_COMPILEHELPER_H #pragma once -#include -#include -#include #include #include #include #include #include +#include #include +#include +#include // UHDM #include @@ -287,18 +287,20 @@ class CompileHelper final { CompileDesign* compileDesign, UHDM::any* pstmt, ValuedComponentI* instance); - + UHDM::property_decl* compilePropertyDeclaration(DesignComponent* component, - const FileContent* fC, NodeId nodeId, - CompileDesign* compileDesign, - UHDM::any* pstmt, - ValuedComponentI* instance); - + const FileContent* fC, + NodeId nodeId, + CompileDesign* compileDesign, + UHDM::any* pstmt, + ValuedComponentI* instance); + UHDM::sequence_decl* compileSequenceDeclaration(DesignComponent* component, - const FileContent* fC, NodeId nodeId, - CompileDesign* compileDesign, - UHDM::any* pstmt, - ValuedComponentI* instance); + const FileContent* fC, + NodeId nodeId, + CompileDesign* compileDesign, + UHDM::any* pstmt, + ValuedComponentI* instance); UHDM::initial* compileInitialBlock(DesignComponent* component, const FileContent* fC, NodeId id, @@ -509,7 +511,7 @@ class CompileHelper final { int32_t opIndex, UHDM::expr* rhs, DesignComponent* component, CompileDesign* compileDesign, ValuedComponentI* instance); - + void adjustUnsized(UHDM::constant* c, int32_t size); UHDM::any* defaultPatternAssignment(const UHDM::typespec* tps, UHDM::any* exp, diff --git a/include/Surelog/DesignCompile/CompileModule.h b/include/Surelog/DesignCompile/CompileModule.h index 87bfb8764f..606fcfa217 100644 --- a/include/Surelog/DesignCompile/CompileModule.h +++ b/include/Surelog/DesignCompile/CompileModule.h @@ -60,8 +60,8 @@ struct FunctorCompileModule { class CompileModule final { public: - CompileModule(CompileDesign* compiler, ModuleDefinition* mdl, - Design* design, SymbolTable* symbols, ErrorContainer* errors, + CompileModule(CompileDesign* compiler, ModuleDefinition* mdl, Design* design, + SymbolTable* symbols, ErrorContainer* errors, ValuedComponentI* instance = nullptr) : m_compileDesign(compiler), m_module(mdl), diff --git a/include/Surelog/DesignCompile/DesignElaboration.h b/include/Surelog/DesignCompile/DesignElaboration.h index e7a51de1b5..7b668312c2 100644 --- a/include/Surelog/DesignCompile/DesignElaboration.h +++ b/include/Surelog/DesignCompile/DesignElaboration.h @@ -25,15 +25,16 @@ #define SURELOG_DESIGNELABORATION_H #pragma once +#include +#include + #include -#include #include +#include +#include +#include #include #include -#include -#include -#include -#include namespace SURELOG { diff --git a/include/Surelog/DesignCompile/ElaborationStep.h b/include/Surelog/DesignCompile/ElaborationStep.h index 97ebee70e0..33a47c8f6f 100644 --- a/include/Surelog/DesignCompile/ElaborationStep.h +++ b/include/Surelog/DesignCompile/ElaborationStep.h @@ -25,12 +25,13 @@ #define SURELOG_ELABORATIONSTEP_H #pragma once -#include -#include #include #include #include +#include +#include + // UHDM #include @@ -107,8 +108,12 @@ class ElaborationStep { UHDM::VectorOfvariables* vars, UHDM::expr* assignExp, UHDM::typespec* tps); - void swapTypespecPointersInUhdm(UHDM::Serializer& s, std::map& typespecSwapMap); - void swapTypespecPointersInTypedef(Design* design, std::map& typespecSwapMap); + void swapTypespecPointersInUhdm( + UHDM::Serializer& s, + std::map& typespecSwapMap); + void swapTypespecPointersInTypedef( + Design* design, + std::map& typespecSwapMap); CompileDesign* m_compileDesign; ExprBuilder m_exprBuilder; diff --git a/include/Surelog/DesignCompile/ElaboratorHarness.h b/include/Surelog/DesignCompile/ElaboratorHarness.h index 3c4c9f8c4f..329708eec0 100644 --- a/include/Surelog/DesignCompile/ElaboratorHarness.h +++ b/include/Surelog/DesignCompile/ElaboratorHarness.h @@ -25,8 +25,8 @@ #define SURELOG_ELABORATORHARNESS_H #pragma once -#include #include +#include namespace SURELOG { diff --git a/include/Surelog/DesignCompile/NetlistElaboration.h b/include/Surelog/DesignCompile/NetlistElaboration.h index 1969fcffbb..ad534d9a85 100644 --- a/include/Surelog/DesignCompile/NetlistElaboration.h +++ b/include/Surelog/DesignCompile/NetlistElaboration.h @@ -25,9 +25,10 @@ #define SURELOG_NETLISTELABORATION_H #pragma once +#include + #include #include -#include namespace SURELOG { diff --git a/include/Surelog/DesignCompile/ResolveSymbols.h b/include/Surelog/DesignCompile/ResolveSymbols.h index 3c51d298d0..da58aa0404 100644 --- a/include/Surelog/DesignCompile/ResolveSymbols.h +++ b/include/Surelog/DesignCompile/ResolveSymbols.h @@ -25,12 +25,12 @@ #define SURELOG_RESOLVESYMBOLS_H #pragma once -#include -#include #include #include +#include #include +#include namespace SURELOG { diff --git a/include/Surelog/DesignCompile/UhdmChecker.h b/include/Surelog/DesignCompile/UhdmChecker.h index 7ee487a538..e87c3b59dd 100644 --- a/include/Surelog/DesignCompile/UhdmChecker.h +++ b/include/Surelog/DesignCompile/UhdmChecker.h @@ -25,12 +25,12 @@ #define SURELOG_UHDMCHECKER_H #pragma once -#include -#include #include #include #include +#include +#include #include namespace SURELOG { diff --git a/include/Surelog/DesignCompile/UhdmWriter.h b/include/Surelog/DesignCompile/UhdmWriter.h index 90d4298874..b160298ef9 100644 --- a/include/Surelog/DesignCompile/UhdmWriter.h +++ b/include/Surelog/DesignCompile/UhdmWriter.h @@ -25,14 +25,15 @@ #define SURELOG_UHDMWRITER_H #pragma once -#include -#include -#include -#include #include #include #include +#include +#include +#include +#include + // UHDM #include @@ -86,9 +87,11 @@ class UhdmWriter final { SignalMap& signalMap, SignalMap& portMap, ModuleInstance* instance = nullptr); void writeDataTypes(const DesignComponent::DataTypeMap& datatypeMap, - UHDM::BaseClass* parent, UHDM::VectorOftypespec* dest_typespecs, - UHDM::Serializer& s, bool setParent); - void writeImportedSymbols(DesignComponent* mod, UHDM::Serializer& s, UHDM::VectorOftypespec* typespecs); + UHDM::BaseClass* parent, + UHDM::VectorOftypespec* dest_typespecs, + UHDM::Serializer& s, bool setParent); + void writeImportedSymbols(DesignComponent* mod, UHDM::Serializer& s, + UHDM::VectorOftypespec* typespecs); void writeVariables(const DesignComponent::VariableMap& orig_vars, UHDM::BaseClass* parent, UHDM::VectorOfvariables* dest_vars, UHDM::Serializer& s); @@ -127,10 +130,11 @@ class UhdmWriter final { void lateBinding(UHDM::Serializer& s, DesignComponent* mod, UHDM::scope* m); UHDM::any* swapForSpecifiedVar(UHDM::Serializer& s, DesignComponent* mod, - UHDM::any* tmp, - UHDM::VectorOfvariables* lvariables, - UHDM::variables* lvariable, std::string_view name, - const UHDM::any* var, const UHDM::any* parent); + UHDM::any* tmp, + UHDM::VectorOfvariables* lvariables, + UHDM::variables* lvariable, + std::string_view name, const UHDM::any* var, + const UHDM::any* parent); void lateTypedefBinding(UHDM::Serializer& s, DesignComponent* mod, UHDM::scope* m); diff --git a/include/Surelog/ErrorReporting/ErrorContainer.h b/include/Surelog/ErrorReporting/ErrorContainer.h index c6b503e2d8..fe1f563596 100644 --- a/include/Surelog/ErrorReporting/ErrorContainer.h +++ b/include/Surelog/ErrorReporting/ErrorContainer.h @@ -25,12 +25,12 @@ #define SURELOG_ERRORCONTAINER_H #pragma once -#include -#include #include #include #include +#include +#include #include namespace SURELOG { diff --git a/include/Surelog/ErrorReporting/ErrorDefinition.h b/include/Surelog/ErrorReporting/ErrorDefinition.h index 8a07c3f183..7729dd3f9d 100644 --- a/include/Surelog/ErrorReporting/ErrorDefinition.h +++ b/include/Surelog/ErrorReporting/ErrorDefinition.h @@ -26,24 +26,24 @@ #pragma once #if defined(_WIN32) - #if defined(FATAL) - #undef FATAL - #endif - #if defined(SYNTAX) - #undef SYNTAX - #endif - #if defined(ERROR) - #undef ERROR - #endif - #if defined(WARNING) - #undef WARNING - #endif - #if defined(INFO) - #undef INFO - #endif - #if defined(NOTE) - #undef NOTE - #endif +#if defined(FATAL) +#undef FATAL +#endif +#if defined(SYNTAX) +#undef SYNTAX +#endif +#if defined(ERROR) +#undef ERROR +#endif +#if defined(WARNING) +#undef WARNING +#endif +#if defined(INFO) +#undef INFO +#endif +#if defined(NOTE) +#undef NOTE +#endif #endif #include diff --git a/include/Surelog/ErrorReporting/LogListener.h b/include/Surelog/ErrorReporting/LogListener.h index d493f170b6..e910e4c576 100644 --- a/include/Surelog/ErrorReporting/LogListener.h +++ b/include/Surelog/ErrorReporting/LogListener.h @@ -25,13 +25,13 @@ #define SURELOG_LOGLISTENER_H #pragma once -#include +#include + #include #include #include #include - -#include +#include namespace SURELOG { diff --git a/include/Surelog/ErrorReporting/Waiver.h b/include/Surelog/ErrorReporting/Waiver.h index fd9cf14d5d..b5483b6362 100644 --- a/include/Surelog/ErrorReporting/Waiver.h +++ b/include/Surelog/ErrorReporting/Waiver.h @@ -25,13 +25,13 @@ #define SURELOG_WAIVER_H #pragma once -#include #include +#include +#include #include #include #include -#include #include namespace SURELOG { diff --git a/include/Surelog/Expression/ExprBuilder.h b/include/Surelog/Expression/ExprBuilder.h index 3a9737e8da..6191c6ae8b 100644 --- a/include/Surelog/Expression/ExprBuilder.h +++ b/include/Surelog/Expression/ExprBuilder.h @@ -25,9 +25,10 @@ #define SURELOG_EXPRBUILDER_H #pragma once -#include #include +#include + namespace SURELOG { class Design; diff --git a/include/Surelog/Expression/Value.h b/include/Surelog/Expression/Value.h index d42c65a105..1a608151b9 100644 --- a/include/Surelog/Expression/Value.h +++ b/include/Surelog/Expression/Value.h @@ -443,9 +443,14 @@ class StValue final : public Value { friend LValue; public: - StValue() : m_type(Type::String), m_size(0), m_valid(false), m_typespec(nullptr) {} + StValue() + : m_type(Type::String), m_size(0), m_valid(false), m_typespec(nullptr) {} explicit StValue(std::string_view val) - : m_type(Type::String), m_value(val), m_size(val.size()), m_valid(true), m_typespec(nullptr) {} + : m_type(Type::String), + m_value(val), + m_size(val.size()), + m_valid(true), + m_typespec(nullptr) {} ~StValue() final; int32_t getSize() const final { return m_size; } diff --git a/include/Surelog/Library/AntlrLibParserErrorListener.h b/include/Surelog/Library/AntlrLibParserErrorListener.h index 9ebfd371f1..13ee04735e 100644 --- a/include/Surelog/Library/AntlrLibParserErrorListener.h +++ b/include/Surelog/Library/AntlrLibParserErrorListener.h @@ -25,11 +25,11 @@ #define SURELOG_ANTLRLIBPARSERERRORLISTENER_H #pragma once -#include #include #include #include +#include namespace SURELOG { @@ -37,7 +37,8 @@ class ParseLibraryDef; class AntlrLibParserErrorListener final : public antlr4::ANTLRErrorListener { public: - explicit AntlrLibParserErrorListener(ParseLibraryDef *parser) : m_parser(parser) {} + explicit AntlrLibParserErrorListener(ParseLibraryDef *parser) + : m_parser(parser) {} ~AntlrLibParserErrorListener() final{}; diff --git a/include/Surelog/Library/SVLibShapeListener.h b/include/Surelog/Library/SVLibShapeListener.h index f6d32102b3..acb47c139b 100644 --- a/include/Surelog/Library/SVLibShapeListener.h +++ b/include/Surelog/Library/SVLibShapeListener.h @@ -25,20 +25,22 @@ #define SURELOG_SVLIBSHAPELISTENER_H #pragma once -#include #include #include #include +#include + namespace SURELOG { class Config; class ParseLibraryDef; class SVLibShapeListener final : public SV3_1aParserBaseListener, - public SV3_1aTreeShapeHelper { + public SV3_1aTreeShapeHelper { public: - SVLibShapeListener(ParseLibraryDef* parser, antlr4::CommonTokenStream* tokens); + SVLibShapeListener(ParseLibraryDef* parser, + antlr4::CommonTokenStream* tokens); SymbolId registerSymbol(std::string_view symbol) final; diff --git a/include/Surelog/SourceCompile/AnalyzeFile.h b/include/Surelog/SourceCompile/AnalyzeFile.h index a18ea0ccc4..9727d827b6 100644 --- a/include/Surelog/SourceCompile/AnalyzeFile.h +++ b/include/Surelog/SourceCompile/AnalyzeFile.h @@ -44,8 +44,8 @@ class AnalyzeFile final { public: class FileChunk final { public: - FileChunk(DesignElement::ElemType type, uint64_t from, - uint64_t to, uint64_t startChar, uint64_t endChar) + FileChunk(DesignElement::ElemType type, uint64_t from, uint64_t to, + uint64_t startChar, uint64_t endChar) : m_chunkType(type), m_fromLine(from), m_toLine(to), @@ -73,9 +73,7 @@ class AnalyzeFile final { void analyze(); const std::vector& getSplitFiles() const { return m_splitFiles; } - const std::vector& getLineOffsets() const { - return m_lineOffsets; - } + const std::vector& getLineOffsets() const { return m_lineOffsets; } AnalyzeFile(const AnalyzeFile& orig) = delete; ~AnalyzeFile() = default; diff --git a/include/Surelog/SourceCompile/AntlrParserErrorListener.h b/include/Surelog/SourceCompile/AntlrParserErrorListener.h index d6bbf3a761..0def579382 100644 --- a/include/Surelog/SourceCompile/AntlrParserErrorListener.h +++ b/include/Surelog/SourceCompile/AntlrParserErrorListener.h @@ -25,13 +25,12 @@ #define SURELOG_ANTLRPARSERERRORLISTENER_H #pragma once -#include -#include #include +#include +#include #include - namespace SURELOG { class ParseFile; @@ -39,7 +38,8 @@ class ParseFile; class AntlrParserErrorListener final : public antlr4::ANTLRErrorListener { public: AntlrParserErrorListener(ParseFile *parser, bool watchDogOn, - uint32_t lineOffset, PathId fileId, bool printExtraPpLineInfo) + uint32_t lineOffset, PathId fileId, + bool printExtraPpLineInfo) : m_parser(parser), m_reportedSyntaxError(0), m_watchDogOn(watchDogOn), diff --git a/include/Surelog/SourceCompile/CommonListenerHelper.h b/include/Surelog/SourceCompile/CommonListenerHelper.h index 63b0a97410..8e47df46f1 100644 --- a/include/Surelog/SourceCompile/CommonListenerHelper.h +++ b/include/Surelog/SourceCompile/CommonListenerHelper.h @@ -25,13 +25,13 @@ #define SURELOG_COMMONLISTENERHELPER_H #pragma once -#include #include #include #include #include #include +#include namespace antlr4 { class CommonTokenStream; @@ -86,8 +86,7 @@ class CommonListenerHelper { NodeId getObjectId(antlr4::ParserRuleContext* ctx) const; - virtual std::tuple + virtual std::tuple getFileLine(antlr4::ParserRuleContext* ctx, antlr4::Token* token) const = 0; NodeId& MutableChild(NodeId index); diff --git a/include/Surelog/SourceCompile/CompilationUnit.h b/include/Surelog/SourceCompile/CompilationUnit.h index adffefd6d7..4c183ae3b3 100644 --- a/include/Surelog/SourceCompile/CompilationUnit.h +++ b/include/Surelog/SourceCompile/CompilationUnit.h @@ -25,12 +25,13 @@ #define SURELOG_COMPILATIONUNIT_H #pragma once -#include -#include #include #include #include +#include +#include + namespace SURELOG { class MacroInfo; diff --git a/include/Surelog/SourceCompile/CompileSourceFile.h b/include/Surelog/SourceCompile/CompileSourceFile.h index 59e0c3bccd..17eaca18d2 100644 --- a/include/Surelog/SourceCompile/CompileSourceFile.h +++ b/include/Surelog/SourceCompile/CompileSourceFile.h @@ -25,12 +25,12 @@ #define SURELOG_COMPILESOURCEFILE_H #pragma once -#include #include #include #include #include +#include #include #ifdef SURELOG_WITH_PYTHON diff --git a/include/Surelog/SourceCompile/Compiler.h b/include/Surelog/SourceCompile/Compiler.h index a7ba267181..91bf613163 100644 --- a/include/Surelog/SourceCompile/Compiler.h +++ b/include/Surelog/SourceCompile/Compiler.h @@ -25,7 +25,6 @@ limitations under the License. #define SURELOG_COMPILER_H #pragma once -#include #include #include #include @@ -33,6 +32,8 @@ limitations under the License. #include #include +#include + #ifdef USETBB #include #include diff --git a/include/Surelog/SourceCompile/ParseFile.h b/include/Surelog/SourceCompile/ParseFile.h index 3db1467718..579b749c44 100644 --- a/include/Surelog/SourceCompile/ParseFile.h +++ b/include/Surelog/SourceCompile/ParseFile.h @@ -25,11 +25,11 @@ #define SURELOG_PARSEFILE_H #pragma once -#include -#include #include #include +#include +#include namespace SURELOG { diff --git a/include/Surelog/SourceCompile/ParserHarness.h b/include/Surelog/SourceCompile/ParserHarness.h index 46b7bbe2c2..4d3055d5d4 100644 --- a/include/Surelog/SourceCompile/ParserHarness.h +++ b/include/Surelog/SourceCompile/ParserHarness.h @@ -25,11 +25,11 @@ #define SURELOG_PARSERHARNESS_H #pragma once -#include +#include + #include #include - -#include +#include namespace SURELOG { diff --git a/include/Surelog/SourceCompile/PreprocessFile.h b/include/Surelog/SourceCompile/PreprocessFile.h index a5495b3ac3..b34d336be2 100644 --- a/include/Surelog/SourceCompile/PreprocessFile.h +++ b/include/Surelog/SourceCompile/PreprocessFile.h @@ -25,9 +25,6 @@ #define SURELOG_PREPROCESSFILE_H #pragma once -#include -#include -#include #include #include #include @@ -35,6 +32,9 @@ #include #include +#include +#include +#include #include namespace antlr4 { diff --git a/include/Surelog/SourceCompile/PreprocessHarness.h b/include/Surelog/SourceCompile/PreprocessHarness.h index 2c75df9403..e5a4735986 100644 --- a/include/Surelog/SourceCompile/PreprocessHarness.h +++ b/include/Surelog/SourceCompile/PreprocessHarness.h @@ -25,12 +25,13 @@ #define SURELOG_PREPROCESSHARNESS_H #pragma once -#include -#include #include #include #include +#include +#include + namespace SURELOG { class PreprocessHarness { diff --git a/include/Surelog/SourceCompile/SV3_1aPpTreeListenerHelper.h b/include/Surelog/SourceCompile/SV3_1aPpTreeListenerHelper.h index 148c741d41..f6bca88e0a 100644 --- a/include/Surelog/SourceCompile/SV3_1aPpTreeListenerHelper.h +++ b/include/Surelog/SourceCompile/SV3_1aPpTreeListenerHelper.h @@ -25,7 +25,6 @@ #define SURELOG_SV3_1APPTREELISTENERHELPER_H #pragma once -#include #include #include #include @@ -33,6 +32,7 @@ #include #include +#include #include namespace SURELOG { @@ -75,9 +75,8 @@ class SV3_1aPpTreeListenerHelper : public CommonListenerHelper { SymbolTable* getSymbolTable() const; SymbolId registerSymbol(std::string_view symbol) final; - std::tuple - getFileLine(antlr4::ParserRuleContext* ctx, - antlr4::Token* token) const final; + std::tuple getFileLine( + antlr4::ParserRuleContext* ctx, antlr4::Token* token) const final; protected: SV3_1aPpTreeListenerHelper(PreprocessFile* pp, diff --git a/include/Surelog/SourceCompile/SV3_1aTreeShapeHelper.h b/include/Surelog/SourceCompile/SV3_1aTreeShapeHelper.h index 0e08b96b42..13497cb5c3 100644 --- a/include/Surelog/SourceCompile/SV3_1aTreeShapeHelper.h +++ b/include/Surelog/SourceCompile/SV3_1aTreeShapeHelper.h @@ -25,7 +25,6 @@ #define SURELOG_SV3_1ATREESHAPEHELPER_H #pragma once -#include #include #include #include @@ -35,6 +34,7 @@ #include #include +#include namespace antlr4 { class CommonTokenStream; @@ -80,9 +80,8 @@ class SV3_1aTreeShapeHelper : public CommonListenerHelper { std::pair getTimeValue( SV3_1aParser::Time_literalContext* ctx); - std::tuple - getFileLine(antlr4::ParserRuleContext* ctx, - antlr4::Token* token) const final; + std::tuple getFileLine( + antlr4::ParserRuleContext* ctx, antlr4::Token* token) const final; protected: SV3_1aTreeShapeHelper(ParseFile* pf, antlr4::CommonTokenStream* tokens, diff --git a/include/Surelog/Testbench/ClassDefinition.h b/include/Surelog/Testbench/ClassDefinition.h index 7efce7e6c0..3bc7b8681e 100644 --- a/include/Surelog/Testbench/ClassDefinition.h +++ b/include/Surelog/Testbench/ClassDefinition.h @@ -25,13 +25,13 @@ #define SURELOG_CLASSDEFINITION_H #pragma once -#include -#include #include #include #include #include +#include +#include #include // UHDM @@ -61,9 +61,7 @@ class ClassDefinition final : public DesignComponent, public DataType { ~ClassDefinition() final = default; uint32_t getSize() const final; - VObjectType getType() const final { - return VObjectType::paClass_declaration; - } + VObjectType getType() const final { return VObjectType::paClass_declaration; } bool isInstance() const final { return false; } std::string_view getName() const final { return m_name; } Library* getLibrary() { return m_library; } diff --git a/include/Surelog/Testbench/ClassObject.h b/include/Surelog/Testbench/ClassObject.h index 8e0999d9c9..aed84f0fd2 100644 --- a/include/Surelog/Testbench/ClassObject.h +++ b/include/Surelog/Testbench/ClassObject.h @@ -26,10 +26,10 @@ #pragma once #include -#include -#include #include #include +#include +#include namespace SURELOG { diff --git a/include/Surelog/Testbench/FunctionMethod.h b/include/Surelog/Testbench/FunctionMethod.h index fb4d8ed893..8c05c11fa9 100644 --- a/include/Surelog/Testbench/FunctionMethod.h +++ b/include/Surelog/Testbench/FunctionMethod.h @@ -25,9 +25,10 @@ #define SURELOG_FUNCTIONMETHOD_H #pragma once -#include #include +#include + namespace SURELOG { class FunctionMethod final : public Function { diff --git a/include/Surelog/Testbench/Program.h b/include/Surelog/Testbench/Program.h index 17c3b22461..cd7c44fcb1 100644 --- a/include/Surelog/Testbench/Program.h +++ b/include/Surelog/Testbench/Program.h @@ -25,12 +25,13 @@ #define SURELOG_PROGRAM_H #pragma once -#include #include #include #include #include +#include + // UHDM #include diff --git a/include/Surelog/Testbench/Property.h b/include/Surelog/Testbench/Property.h index e3cf011560..6d3c574653 100644 --- a/include/Surelog/Testbench/Property.h +++ b/include/Surelog/Testbench/Property.h @@ -25,9 +25,10 @@ #define SURELOG_PROPERTY_H #pragma once -#include #include +#include + namespace SURELOG { class DataType; diff --git a/include/Surelog/Testbench/TaskMethod.h b/include/Surelog/Testbench/TaskMethod.h index 9fcc2c9297..9235b2afe1 100644 --- a/include/Surelog/Testbench/TaskMethod.h +++ b/include/Surelog/Testbench/TaskMethod.h @@ -25,10 +25,10 @@ #define SURELOG_TASKMETHOD_H #pragma once -#include - #include +#include + namespace SURELOG { class TaskMethod final : public Task { diff --git a/include/Surelog/Testbench/TypeDef.h b/include/Surelog/Testbench/TypeDef.h index d114eb3654..2148ac6f6a 100644 --- a/include/Surelog/Testbench/TypeDef.h +++ b/include/Surelog/Testbench/TypeDef.h @@ -25,11 +25,11 @@ #define SURELOG_TYPEDEF_H #pragma once -#include #include #include #include +#include namespace SURELOG { diff --git a/include/Surelog/Utils/ParseUtils.h b/include/Surelog/Utils/ParseUtils.h index 78a1e555a9..caf06fe1f8 100644 --- a/include/Surelog/Utils/ParseUtils.h +++ b/include/Surelog/Utils/ParseUtils.h @@ -25,10 +25,11 @@ #define SURELOG_PARSEUTILS_H #pragma once +#include + +#include #include #include -#include -#include namespace SURELOG { namespace ParseUtils { diff --git a/include/Surelog/Utils/StringUtils.h b/include/Surelog/Utils/StringUtils.h index bda24919c5..8da16759e0 100644 --- a/include/Surelog/Utils/StringUtils.h +++ b/include/Surelog/Utils/StringUtils.h @@ -25,8 +25,8 @@ #define SURELOG_STRINGUTILS_H #pragma once -#include #include +#include #include #include