Skip to content

Commit

Permalink
Deleted constructors should be public.
Browse files Browse the repository at this point in the history
  • Loading branch information
hzeller committed Nov 9, 2024
1 parent 04bf989 commit 8587f4c
Show file tree
Hide file tree
Showing 26 changed files with 33 additions and 49 deletions.
4 changes: 2 additions & 2 deletions include/Surelog/API/PythonAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ struct parser_rule_context;
class PythonAPI {
public:
PythonAPI() = default;
PythonAPI(const PythonAPI& orig) = delete;

virtual ~PythonAPI() = default;

/* Main interpreter (in main thread) */
Expand Down Expand Up @@ -74,8 +76,6 @@ class PythonAPI {
static void setStrictMode(bool mode) { m_strictMode = mode; }

private:
PythonAPI(const PythonAPI& orig) = delete;

static void initInterp_();
static void loadScriptsInInterp_();
static bool loadScript_(const std::filesystem::path& name,
Expand Down
4 changes: 1 addition & 3 deletions include/Surelog/Cache/Cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class VObject;

class Cache {
public:
Cache(const Cache& orig) = delete;
static constexpr uint64_t Capacity = 0x000000000FFFFFFF;

protected:
Expand Down Expand Up @@ -94,9 +95,6 @@ class Cache {
void restoreSymbols(
SymbolTable& targetSymbols,
const ::capnp::List<::capnp::Text>::Reader& sourceSymbols);

private:
Cache(const Cache& orig) = delete;
};

} // namespace SURELOG
Expand Down
3 changes: 1 addition & 2 deletions include/Surelog/Cache/PPCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,13 @@ class PreprocessFile;
class PPCache : Cache {
public:
explicit PPCache(PreprocessFile* pp);
PPCache(const PPCache& orig) = delete;

bool restore(bool errorsOnly);
bool save();
bool isValid();

private:
PPCache(const PPCache& orig) = delete;

PathId getCacheFileId(PathId sourceFileId) const;

bool checkCacheIsValid(PathId cacheFileId,
Expand Down
3 changes: 1 addition & 2 deletions include/Surelog/Cache/ParseCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,13 @@ class ParseFile;
class ParseCache final : Cache {
public:
explicit ParseCache(ParseFile* pp);
ParseCache(const ParseCache& orig) = delete;

bool restore();
bool save();
bool isValid();

private:
ParseCache(const ParseCache& orig) = delete;

PathId getCacheFileId(PathId ppFileId) const;

bool checkCacheIsValid(PathId cacheFileId,
Expand Down
3 changes: 1 addition & 2 deletions include/Surelog/Cache/PythonAPICache.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,13 @@ class PythonListen;
class PythonAPICache final : Cache {
public:
explicit PythonAPICache(PythonListen* listener);
PythonAPICache(const PythonAPICache& orig) = delete;

bool restore();
bool save();
bool isValid() const;

private:
PythonAPICache(const PythonAPICache& orig) = delete;

PathId getCacheFileId(PathId sourceFileId) const;

bool checkCacheIsValid(PathId cacheFileId,
Expand Down
4 changes: 2 additions & 2 deletions include/Surelog/CommandLine/CommandLineParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ class CommandLineParser final {
public:
CommandLineParser(ErrorContainer* errors, SymbolTable* symbolTable,
bool diffCompMode = false, bool fileUnit = false);
CommandLineParser(const CommandLineParser& orig) = delete;

bool parseCommandLine(int32_t argc, const char** argv);

/* Verilog command line content */
Expand Down Expand Up @@ -250,8 +252,6 @@ class CommandLineParser final {
bool cleanCache();

private:
CommandLineParser(const CommandLineParser& orig) = delete;

std::pair<PathId, std::filesystem::path> addWorkingDirectory_(
const std::filesystem::path& wd, const std::filesystem::path& rwd);
bool plus_arguments_(std::string_view s, const std::filesystem::path& cd);
Expand Down
2 changes: 1 addition & 1 deletion include/Surelog/Common/FileSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ class FileSystem {
protected:
FileSystem() = default;

private:
public:
FileSystem(const FileSystem &rhs) = delete;
FileSystem &operator=(const FileSystem &rhs) = delete;
};
Expand Down
2 changes: 1 addition & 1 deletion include/Surelog/Common/PlatformFileSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ class PlatformFileSystem /*final*/ : public FileSystem {
Mappings m_mappings;
std::filesystem::path m_outputDir;

private:
public:
PlatformFileSystem(const PlatformFileSystem &rhs) = delete;
PlatformFileSystem &operator=(const PlatformFileSystem &rhs) = delete;
};
Expand Down
3 changes: 1 addition & 2 deletions include/Surelog/DesignCompile/CompileClass.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,11 @@ class CompileClass final {
m_helper.seterrorReporting(errors, symbols);
builtins_ = {"constraint_mode", "randomize", "rand_mode", "srandom"};
}
CompileClass(const CompileClass&) = delete;

bool compile();

private:
CompileClass(const CompileClass&) = delete;

CompileDesign* const m_compileDesign;
ClassDefinition* const m_class;
Design* const m_design;
Expand Down
3 changes: 1 addition & 2 deletions include/Surelog/DesignCompile/CompileDesign.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class CompileDesign {
public:
// Note: takes owernship of compiler
explicit CompileDesign(Compiler* compiler);
CompileDesign(const CompileDesign& orig) = delete;
virtual ~CompileDesign(); // Used in MockCompileDesign

bool compile();
Expand All @@ -65,8 +66,6 @@ class CompileDesign {
}

private:
CompileDesign(const CompileDesign& orig) = delete;

template <class ObjectType, class ObjectMapType, typename FunctorType>
void compileMT_(ObjectMapType& objects, int32_t maxThreadCount);

Expand Down
3 changes: 1 addition & 2 deletions include/Surelog/DesignCompile/CompileFileContent.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,11 @@ class CompileFileContent final {
m_declOnly(declOnly) {
m_helper.seterrorReporting(errors, symbols);
}
CompileFileContent(const CompileFileContent&) = delete;

bool compile();

private:
CompileFileContent(const CompileFileContent&) = delete;

bool collectObjects_();
CompileDesign* const m_compileDesign;
FileContent* const m_fileContent;
Expand Down
3 changes: 1 addition & 2 deletions include/Surelog/DesignCompile/CompileHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ enum class Reduce : bool { Yes = true, No = false };
class CompileHelper final {
public:
CompileHelper() = default;
CompileHelper(const CompileHelper&) = delete;

void seterrorReporting(ErrorContainer* errors, SymbolTable* symbols) {
m_errors = errors;
Expand Down Expand Up @@ -625,8 +626,6 @@ class CompileHelper final {
void setElabMode(bool on) { m_elabMode = on; }

private:
CompileHelper(const CompileHelper&) = delete;

ErrorContainer* m_errors = nullptr;
SymbolTable* m_symbols = nullptr;
ExprBuilder m_exprBuilder;
Expand Down
2 changes: 1 addition & 1 deletion include/Surelog/DesignCompile/CompileModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ class CompileModule final {
m_instance(instance) {
m_helper.seterrorReporting(errors, symbols);
}
CompileModule(const CompileModule&) = delete;

bool compile();

private:
CompileModule(const CompileModule&) = delete;
enum CollectType { FUNCTION, DEFINITION, GENERATE_REGIONS, OTHER };
bool collectModuleObjects_(CollectType collectType);
bool checkModule_();
Expand Down
4 changes: 2 additions & 2 deletions include/Surelog/ErrorReporting/ErrorContainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ class ErrorContainer final {

explicit ErrorContainer(SymbolTable* symbolTable,
LogListener* logListener = nullptr);
ErrorContainer(const ErrorContainer& orig) = delete;

virtual ~ErrorContainer();

LogListener* getLogListener() { return m_logListener; }
Expand All @@ -86,8 +88,6 @@ class ErrorContainer final {
void setPythonInterp(void* interpState) { m_interpState = interpState; }

private:
ErrorContainer(const ErrorContainer& orig) = delete;

std::pair<std::string, bool> createReport_() const;
std::pair<std::string, bool> createReport_(const Error& error) const;
std::vector<Error> m_errors;
Expand Down
2 changes: 1 addition & 1 deletion include/Surelog/ErrorReporting/LogListener.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class LogListener {
int32_t droppedCount = 0;
uint32_t maxQueuedMessageCount = DEFAULT_MAX_QUEUED_MESSAGE_COUNT;

private:
public:
LogListener(const LogListener&) = delete;
LogListener& operator=(const LogListener&) = delete;
};
Expand Down
5 changes: 2 additions & 3 deletions include/Surelog/ErrorReporting/Report.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,10 @@ class SymbolTable;
class Report final {
public:
Report() = default;
Report(const Report& orig) = delete;

std::pair<bool, bool> makeDiffCompUnitReport(CommandLineParser* clp,
SymbolTable* st);

private:
Report(const Report& orig) = delete;
};

} // namespace SURELOG
Expand Down
6 changes: 3 additions & 3 deletions include/Surelog/ErrorReporting/Waiver.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ namespace SURELOG {

class Waiver final {
public:
Waiver() = delete;
Waiver(const Waiver& orig) = delete;

static void initWaivers();

static bool macroArgCheck(std::string_view name);
Expand All @@ -64,9 +67,6 @@ class Waiver final {
}

private:
Waiver() = delete;
Waiver(const Waiver& orig) = delete;

static std::set<std::string, std::less<>> m_macroArgCheck;
static std::multimap<ErrorDefinition::ErrorType, WaiverData> m_waivers;
};
Expand Down
4 changes: 2 additions & 2 deletions include/Surelog/Expression/ExprBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ class ValuedComponentI;
class ExprBuilder final {
public:
ExprBuilder() = default;
ExprBuilder(const ExprBuilder& orig) = delete;

Value* evalExpr(const FileContent*, NodeId id,
ValuedComponentI* instance = nullptr,
bool muteErrors = false);
Expand All @@ -56,8 +58,6 @@ class ExprBuilder final {
ValueFactory& getValueFactory() { return m_valueFactory; }

private:
ExprBuilder(const ExprBuilder& orig) = delete;

ValueFactory m_valueFactory;
ErrorContainer* m_errors = nullptr;
SymbolTable* m_symbols = nullptr;
Expand Down
3 changes: 1 addition & 2 deletions include/Surelog/Library/ParseLibraryDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class ParseLibraryDef final {
ParseLibraryDef(CommandLineParser* commandLineParser, ErrorContainer* errors,
SymbolTable* symbolTable, LibrarySet* librarySet,
ConfigSet* configSet);
ParseLibraryDef(const ParseLibraryDef& orig) = delete;

bool parseLibrariesDefinition();
bool parseLibraryDefinition(PathId file, Library* lib = nullptr);
Expand All @@ -62,8 +63,6 @@ class ParseLibraryDef final {
ConfigSet* getConfigSet() const { return m_configSet; }

private:
ParseLibraryDef(const ParseLibraryDef& orig) = delete;

PathId m_fileId;
CommandLineParser* const m_commandLineParser;
ErrorContainer* const m_errors;
Expand Down
2 changes: 1 addition & 1 deletion include/Surelog/Package/Precompiled.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class SymbolTable;
class Precompiled final {
public:
static Precompiled* getSingleton();
Precompiled(const Precompiled&) = delete;

void addPrecompiled(std::string_view package_name, std::string_view fileName);

Expand All @@ -50,7 +51,6 @@ class Precompiled final {

private:
Precompiled(); // Only accessed via singleton.
Precompiled(const Precompiled&) = delete;

std::map<std::string, std::string, std::less<>> m_packageMap;
std::set<std::string, std::less<>> m_packageFileSet;
Expand Down
2 changes: 1 addition & 1 deletion include/Surelog/SourceCompile/Compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class Compiler {
SymbolTable* symbolTable);
Compiler(CommandLineParser* commandLineParser, ErrorContainer* errors,
SymbolTable* symbolTable, std::string_view text);
Compiler(const Compiler& orig) = delete;
virtual ~Compiler();

bool compile();
Expand Down Expand Up @@ -104,7 +105,6 @@ class Compiler {
#endif

private:
Compiler(const Compiler& orig) = delete;
bool parseLibrariesDef_();

bool ppinit_();
Expand Down
3 changes: 1 addition & 2 deletions include/Surelog/SourceCompile/LoopCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ namespace SURELOG {
class LoopCheck {
public:
LoopCheck() = default;
LoopCheck(const LoopCheck& orig) = delete;
~LoopCheck();

void clear();
Expand All @@ -46,8 +47,6 @@ class LoopCheck {
std::vector<SymbolId> reportLoop() const;

private:
LoopCheck(const LoopCheck& orig) = delete;

class Node {
public:
explicit Node(SymbolId objId) : m_objId(objId), m_visited(false) {}
Expand Down
3 changes: 1 addition & 2 deletions include/Surelog/Testbench/ClassObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,14 @@ class ClassObject final {
std::map<std::string, std::pair<Property*, Value*>, std::less<>>;

explicit ClassObject(ClassDefinition* class_def) : m_class(class_def) {}
ClassObject(const ClassObject& orig) = delete;
ClassDefinition* getClass() { return m_class; }

const PropertyValueMap& getProperties() const { return m_properties; }
bool setValue(std::string_view property, Value* value);
Value* getValue(std::string_view property) const;

private:
ClassObject(const ClassObject& orig) = delete;

ClassDefinition* const m_class;
PropertyValueMap m_properties;
};
Expand Down
3 changes: 1 addition & 2 deletions include/Surelog/Testbench/Constraint.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,13 @@ class Constraint final {
public:
Constraint(const FileContent* fC, NodeId id, std::string_view name)
: m_fileContent(fC), m_nodeId(id), m_name(name) {}
Constraint(const Constraint&) = delete;

std::string_view getName() const { return m_name; }
const FileContent* getFileContent() const { return m_fileContent; }
NodeId getNodeId() const { return m_nodeId; }

private:
Constraint(const Constraint&) = delete;

const FileContent* const m_fileContent;
const NodeId m_nodeId;
const std::string m_name;
Expand Down
3 changes: 1 addition & 2 deletions include/Surelog/Testbench/CoverGroupDefinition.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class CoverGroupDefinition final {
public:
CoverGroupDefinition(const FileContent* fC, NodeId id, std::string_view name)
: m_fileContent(fC), m_nodeId(id), m_name(name) {}
CoverGroupDefinition(const CoverGroupDefinition&) = delete;

std::string_view getName() const { return m_name; }

Expand All @@ -46,8 +47,6 @@ class CoverGroupDefinition final {
NodeId getNodeId() const { return m_nodeId; }

private:
CoverGroupDefinition(const CoverGroupDefinition&) = delete;

// Set in constructor, never updated, no copy constructor. Can be const.
const FileContent* const m_fileContent;
const NodeId m_nodeId;
Expand Down
Loading

0 comments on commit 8587f4c

Please sign in to comment.