From 2d6afc6e2621fe67df09d4824ccd678a503b3517 Mon Sep 17 00:00:00 2001 From: Rekai Gonzalez-Alberquilla Date: Fri, 10 Feb 2017 17:27:33 +0000 Subject: sim: Make Stats truly non-copy-constructible The stats are silently non-copy constructible. Therefore, when someone copy-constructs any object with stats, asserts happen when registering the stats, as they were not constructed in the intended way. This patch solves that by explicitly deleting the copy constructor, trading an obscure run-time assert for a compile-time somehow more meaningful error meassage. This triggers some compilation errors as the FaultStats in the fault definitions of ARM and SPARC use brace-enclosed initialisations in which one of the elements derives from DataWrap, which is not copy-constructible anymore. To fix that, this patch also adds a constructor for the FaultVals in both ISAs. Change-Id: I340e203b9386609b32c66e3b8918a015afe415a4 Reviewed-by: Curtis Dunham Reviewed-by: Sascha Bischoff Reviewed-on: https://gem5-review.googlesource.com/8082 Reviewed-by: Jason Lowe-Power Reviewed-by: Andreas Sandberg Reviewed-by: Gabe Black Maintainer: Andreas Sandberg --- src/base/statistics.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/base') diff --git a/src/base/statistics.hh b/src/base/statistics.hh index d0f77297a..3e1758ab8 100644 --- a/src/base/statistics.hh +++ b/src/base/statistics.hh @@ -232,7 +232,7 @@ class DataWrap : public InfoAccess /** * Copy constructor, copies are not allowed. */ - DataWrap(const DataWrap &stat) {} + DataWrap(const DataWrap &stat) = delete; /** * Can't copy stats. -- cgit v1.2.3