From a27eec056d90e248a071bea6912e5ab09dea8242 Mon Sep 17 00:00:00 2001
From: Brian Norris <banorris@uci.edu>
Date: Wed, 3 Oct 2012 16:29:59 -0700
Subject: [PATCH] action: remove clockvector flag from print() method

We don't actually need to tell ModelAction::print() when to print the
associated clock vector. The introduction of the 'print_cv' boolean flag
was to fix a separate bug that has been fixed. Now the clock vector can
be printed unconditionally, when it exists.
---
 action.cc | 11 +++--------
 action.h  |  2 +-
 model.cc  |  2 +-
 3 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/action.cc b/action.cc
index c5912ff2..08fe1067 100644
--- a/action.cc
+++ b/action.cc
@@ -293,13 +293,8 @@ bool ModelAction::happens_before(const ModelAction *act) const
 	return act->cv->synchronized_since(this);
 }
 
-/**
- * Print nicely-formatted info about this ModelAction
- *
- * @param print_cv True if we want to print clock vector data. Might be false,
- * for instance, in situations where the clock vector might be invalid
- */
-void ModelAction::print(bool print_cv) const
+/** @brief Print nicely-formatted info about this ModelAction */
+void ModelAction::print() const
 {
 	const char *type_str, *mo_str;
 	switch (this->type) {
@@ -383,7 +378,7 @@ void ModelAction::print(bool print_cv) const
 		else
 			printf(" Rf: ?");
 	}
-	if (cv && print_cv) {
+	if (cv) {
 		printf("\t");
 		cv->print();
 	} else
diff --git a/action.h b/action.h
index 8dc88430..32cada2b 100644
--- a/action.h
+++ b/action.h
@@ -66,7 +66,7 @@ class ModelAction {
 public:
 	ModelAction(action_type_t type, memory_order order, void *loc, uint64_t value = VALUE_NONE);
 	~ModelAction();
-	void print(bool print_cv = true) const;
+	void print() const;
 
 	thread_id_t get_tid() const { return tid; }
 	action_type get_type() const { return type; }
diff --git a/model.cc b/model.cc
index 21b2b77b..e3d9203e 100644
--- a/model.cc
+++ b/model.cc
@@ -199,7 +199,7 @@ bool ModelChecker::next_execution()
 	if (isfinalfeasible()) {
 		printf("Earliest divergence point since last feasible execution:\n");
 		if (earliest_diverge)
-			earliest_diverge->print(false);
+			earliest_diverge->print();
 		else
 			printf("(Not set)\n");
 
-- 
2.34.1