[phc-internals] [phc commit] r2675 - Implement get_value.

codesite-noreply at google.com codesite-noreply at google.com
Mon May 25 19:35:26 IST 2009


Author: paul.biggar
Date: Mon May 25 11:34:36 2009
New Revision: 2675

Modified:
    branches/dataflow/src/optimize/wpa/Points_to.h

Log:
Implement get_value.
Fix (in)equality of Empty.


Modified: branches/dataflow/src/optimize/wpa/Points_to.h
==============================================================================
--- branches/dataflow/src/optimize/wpa/Points_to.h	(original)
+++ branches/dataflow/src/optimize/wpa/Points_to.h	Mon May 25 11:34:36 2009
@@ -206,7 +206,7 @@

  struct Empty
  {
-	bool operator!= (const Empty&) const { return true; }
+	bool operator!= (const Empty&) const { return false; }
  	bool operator== (const Empty&) const { return true; }
  };

@@ -241,7 +241,9 @@

  	Value_type get_value (Source_type* source, Target_type* target)
  	{
-		phc_TODO ();
+		assert (by_source[source->name ()].has (target->name()));
+
+		return values[source->name ()][target->name ()];
  	}

  	void set_value (Edge_type* pair, Value_type value)
@@ -295,7 +297,6 @@
  				return false;

  		// Check the values
-
  		foreach (Edge_type* e, *other->get_edges ())
  			if (this->get_value (e) != other->get_value (e))
  				return false;


More information about the phc-internals mailing list