base, sim, dev: Remove SWIG
Remove SWIG guards and SWIG-specific C++ code.
Change-Id: Icaad6720513b6f48153727ef3f70e0dba0df4bee
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2921
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Tony Gutierrez <anthony.gutierrez@amd.com>
diff --git a/src/base/addr_range.hh b/src/base/addr_range.hh
index ed0259f..1137efa 100644
--- a/src/base/addr_range.hh
+++ b/src/base/addr_range.hh
@@ -346,11 +346,6 @@
return false;
}
-/**
- * Keep the operators away from SWIG.
- */
-#ifndef SWIG
-
/**
* Less-than operator used to turn an STL map into a binary search
* tree of non-overlapping address ranges.
@@ -384,7 +379,6 @@
{
return !(*this == r);
}
-#endif // SWIG
};
/**
diff --git a/src/base/types.cc b/src/base/types.cc
index 38b6bf2..ee918a4 100644
--- a/src/base/types.cc
+++ b/src/base/types.cc
@@ -30,8 +30,6 @@
#include "base/types.hh"
-#ifndef SWIG // keep the operators away from SWIG
-
std::ostream&
operator<<(std::ostream &out, const Cycles & cycles)
{
@@ -39,5 +37,3 @@
return out;
}
-#endif // SWIG not touching operators
-
diff --git a/src/base/types.hh b/src/base/types.hh
index 7b11590..05a29f8 100644
--- a/src/base/types.hh
+++ b/src/base/types.hh
@@ -73,8 +73,7 @@
* typedef, aiming to avoid unintentional mixing of cycles and ticks
* in the code base.
*
- * Operators are defined inside an ifndef block to avoid swig touching
- * them. Note that there is no overloading of the bool operator as the
+ * Note that there is no overloading of the bool operator as the
* compiler is allowed to turn booleans into integers and this causes
* a whole range of issues in a handful locations. The solution to
* this problem would be to use the safe bool idiom, but for now we
@@ -91,18 +90,12 @@
public:
-#ifndef SWIG // SWIG gets confused by constexpr
/** Explicit constructor assigning a value. */
explicit constexpr Cycles(uint64_t _c) : c(_c) { }
-#else
- explicit Cycles(uint64_t _c) : c(_c) { }
-#endif
/** Default constructor for parameter classes. */
Cycles() : c(0) { }
-#ifndef SWIG // keep the operators away from SWIG
-
/** Converting back to the value type. */
constexpr operator uint64_t() const { return c; }
@@ -138,9 +131,6 @@
{ return Cycles(c >> shift); }
friend std::ostream& operator<<(std::ostream &out, const Cycles & cycles);
-
-#endif // SWIG not touching operators
-
};
/**
@@ -194,11 +184,9 @@
class FaultBase;
typedef std::shared_ptr<FaultBase> Fault;
-#ifndef SWIG // Swig gets really confused by decltype
// Rather than creating a shared_ptr instance and assigning it nullptr,
// we just create an alias.
constexpr decltype(nullptr) NoFault = nullptr;
-#endif
struct AtomicOpFunctor
{