Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
few smells less in MC
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Mon, 22 May 2017 21:38:03 +0000 (23:38 +0200)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Mon, 22 May 2017 21:38:03 +0000 (23:38 +0200)
src/mc/AddressSpace.cpp [deleted file]
src/mc/AddressSpace.hpp
src/mc/ChunkedData.hpp
src/mc/ObjectInformation.cpp
src/mc/ObjectInformation.hpp
src/mc/Type.hpp
src/mc/Variable.hpp
src/mc/checker/SafetyChecker.cpp
src/mc/checker/SafetyChecker.hpp
src/mc/mc_snapshot.cpp
src/mc/mc_snapshot.h

diff --git a/src/mc/AddressSpace.cpp b/src/mc/AddressSpace.cpp
deleted file mode 100644 (file)
index e84bac2..0000000
+++ /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()
-{
-}
-
-}
-}
index 95a938d..050650c 100644 (file)
@@ -112,7 +112,7 @@ private:
   Process* process_;
 public:
   AddressSpace(Process* process) : process_(process) {}
-  virtual ~AddressSpace();
+  virtual ~AddressSpace() = default;
 
   /** The process of this addres space
    *
index 076e607..891e2fa 100644 (file)
@@ -35,7 +35,7 @@ class ChunkedData {
   std::vector<std::size_t> pagenos_;
 public:
 
-  ChunkedData() {}
+  ChunkedData() = default;
   void clear()
   {
     for (std::size_t pageno : pagenos_)
index 7784c6a..3a7b828 100644 (file)
@@ -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
+}
index e65d9d3..1a5b75f 100644 (file)
@@ -52,7 +52,7 @@ struct FunctionIndexEntry {
  */
 class ObjectInformation {
 public:
-  ObjectInformation();
+  ObjectInformation() = default;
 
   // Not copyable:
   ObjectInformation(ObjectInformation const&) = delete;
index 5551e23..d1391bd 100644 (file)
@@ -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;
index 5f43e5c..bf7f86a 100644 (file)
@@ -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;
index 643c734..708f69b 100644 (file)
@@ -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);
index 0efcdae..640d30a 100644 (file)
@@ -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<std::string> getTextualTrace() override;
index f2c7ad6..0dff797 100644 (file)
@@ -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<void> address, int process_index,
   ReadOptions options) const
index c217c97..16b4f2b 100644 (file)
@@ -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<void> 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: