From: Frederic Suter Date: Mon, 22 May 2017 21:38:03 +0000 (+0200) Subject: few smells less in MC X-Git-Tag: v3.16~260 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/17a02864e7ac2f0a531712199939b4fb4282d438 few smells less in MC --- diff --git a/src/mc/AddressSpace.cpp b/src/mc/AddressSpace.cpp deleted file mode 100644 index e84bac215c..0000000000 --- a/src/mc/AddressSpace.cpp +++ /dev/null @@ -1,17 +0,0 @@ -/* Copyright (c) 2008-2015. The SimGrid Team. - * All rights reserved. */ - -/* This program is free software; you can redistribute it and/or modify it - * under the terms of the license (GNU LGPL) which comes with this package. */ - -#include "src/mc/AddressSpace.hpp" - -namespace simgrid { -namespace mc { - -AddressSpace::~AddressSpace() -{ -} - -} -} diff --git a/src/mc/AddressSpace.hpp b/src/mc/AddressSpace.hpp index 95a938da64..050650c0c9 100644 --- a/src/mc/AddressSpace.hpp +++ b/src/mc/AddressSpace.hpp @@ -112,7 +112,7 @@ private: Process* process_; public: AddressSpace(Process* process) : process_(process) {} - virtual ~AddressSpace(); + virtual ~AddressSpace() = default; /** The process of this addres space * diff --git a/src/mc/ChunkedData.hpp b/src/mc/ChunkedData.hpp index 076e607560..891e2fa1e3 100644 --- a/src/mc/ChunkedData.hpp +++ b/src/mc/ChunkedData.hpp @@ -35,7 +35,7 @@ class ChunkedData { std::vector pagenos_; public: - ChunkedData() {} + ChunkedData() = default; void clear() { for (std::size_t pageno : pagenos_) diff --git a/src/mc/ObjectInformation.cpp b/src/mc/ObjectInformation.cpp index 7784c6a4c2..3a7b828d4d 100644 --- a/src/mc/ObjectInformation.cpp +++ b/src/mc/ObjectInformation.cpp @@ -15,8 +15,6 @@ namespace simgrid { namespace mc { -ObjectInformation::ObjectInformation() {} - /* For an executable object, addresses are virtual address * (there is no offset) i.e. * \f$\text{virtual address} = \{dwarf address}\f$; @@ -200,4 +198,4 @@ void ObjectInformation::remove_local_variable( } } -} \ No newline at end of file +} diff --git a/src/mc/ObjectInformation.hpp b/src/mc/ObjectInformation.hpp index e65d9d35fb..1a5b75f81f 100644 --- a/src/mc/ObjectInformation.hpp +++ b/src/mc/ObjectInformation.hpp @@ -52,7 +52,7 @@ struct FunctionIndexEntry { */ class ObjectInformation { public: - ObjectInformation(); + ObjectInformation() = default; // Not copyable: ObjectInformation(ObjectInformation const&) = delete; diff --git a/src/mc/Type.hpp b/src/mc/Type.hpp index 5551e23278..d1391bd9e6 100644 --- a/src/mc/Type.hpp +++ b/src/mc/Type.hpp @@ -33,7 +33,7 @@ public: static constexpr flags_type INHERITANCE_FLAG = 1; static constexpr flags_type VIRTUAL_POINTER_FLAG = 2; - Member() {} + Member() = default; /** Whether this member represent some inherited part of the object */ flags_type flags = 0; @@ -96,7 +96,7 @@ public: /** A type in the model-checked program */ class Type { public: - Type() {} + Type() = default; /** The DWARF TAG of the type (e.g. DW_TAG_array_type) */ int type = 0; diff --git a/src/mc/Variable.hpp b/src/mc/Variable.hpp index 5f43e5c79f..bf7f86a532 100644 --- a/src/mc/Variable.hpp +++ b/src/mc/Variable.hpp @@ -20,7 +20,7 @@ namespace mc { /** A variable (global or local) in the model-checked program */ class Variable { public: - Variable() {} + Variable() = default; std::uint32_t id = 0; bool global = false; std::string name; diff --git a/src/mc/checker/SafetyChecker.cpp b/src/mc/checker/SafetyChecker.cpp index 643c734c5b..708f69b290 100644 --- a/src/mc/checker/SafetyChecker.cpp +++ b/src/mc/checker/SafetyChecker.cpp @@ -332,10 +332,6 @@ SafetyChecker::SafetyChecker(Session& session) : Checker(session) stack_.push_back(std::move(initial_state)); } -SafetyChecker::~SafetyChecker() -{ -} - Checker* createSafetyChecker(Session& session) { return new SafetyChecker(session); diff --git a/src/mc/checker/SafetyChecker.hpp b/src/mc/checker/SafetyChecker.hpp index 0efcdaed57..640d30a746 100644 --- a/src/mc/checker/SafetyChecker.hpp +++ b/src/mc/checker/SafetyChecker.hpp @@ -24,7 +24,7 @@ class XBT_PRIVATE SafetyChecker : public Checker { simgrid::mc::ReductionMode reductionMode_ = simgrid::mc::ReductionMode::unset; public: SafetyChecker(Session& session); - ~SafetyChecker(); + ~SafetyChecker() = default; void run() override; RecordTrace getRecordTrace() override; std::vector getTextualTrace() override; diff --git a/src/mc/mc_snapshot.cpp b/src/mc/mc_snapshot.cpp index f2c7ad6d77..0dff797c92 100644 --- a/src/mc/mc_snapshot.cpp +++ b/src/mc/mc_snapshot.cpp @@ -170,11 +170,6 @@ Snapshot::Snapshot(Process* process, int _num_state) } -Snapshot::~Snapshot() -{ - -} - const void* Snapshot::read_bytes(void* buffer, std::size_t size, RemotePtr address, int process_index, ReadOptions options) const diff --git a/src/mc/mc_snapshot.h b/src/mc/mc_snapshot.h index c217c97590..16b4f2be68 100644 --- a/src/mc/mc_snapshot.h +++ b/src/mc/mc_snapshot.h @@ -131,7 +131,7 @@ namespace mc { class XBT_PRIVATE Snapshot final : public AddressSpace { public: Snapshot(Process* process, int num_state); - ~Snapshot(); + ~Snapshot() = default; const void* read_bytes(void* buffer, std::size_t size, RemotePtr address, int process_index = ProcessIndexAny, ReadOptions options = ReadOptions::none()) const override; @@ -216,11 +216,9 @@ static XBT_ALWAYS_INLINE const void* MC_region_read(mc_mem_region_t region, void { xbt_assert(region); - std::uintptr_t offset = - (std::uintptr_t) addr - (std::uintptr_t) region->start().address(); + std::uintptr_t offset = (std::uintptr_t)addr - (std::uintptr_t)region->start().address(); - xbt_assert(region->contain(simgrid::mc::remote(addr)), - "Trying to read out of the region boundary."); + xbt_assert(region->contain(simgrid::mc::remote(addr)), "Trying to read out of the region boundary."); switch (region->storage_type()) { case simgrid::mc::StorageType::NoData: