]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Move class value_relation the header file.
authorAndrew MacLeod <amacleod@redhat.com>
Thu, 22 Sep 2022 21:27:36 +0000 (17:27 -0400)
committerAndrew MacLeod <amacleod@redhat.com>
Thu, 29 Sep 2022 22:34:18 +0000 (18:34 -0400)
* value-relation.cc (class value_relation): Move to .h file.
(value_relation::set_relation): Ditto.
(value_relation::value_relation): ditto.
* value-relation.h (class value_relation): Move from .cc file.
(value_relation::set_relation): Ditto
(value_relation::value_relation): Ditto.

gcc/value-relation.cc
gcc/value-relation.h

index 7fc22d30126d89364557d2b00c3c96100ab7b2bd..e6f5ef4d5e1fea0baf18bbb691d2e360f94ca545 100644 (file)
@@ -635,61 +635,6 @@ equiv_oracle::dump (FILE *f) const
 
 
 // --------------------------------------------------------------------------
-
-// The value-relation class is used to encapsulate the represention of an
-// individual relation between 2 ssa-names, and to facilitate operating on
-// the relation.
-
-class value_relation
-{
-public:
-  value_relation ();
-  value_relation (relation_kind kind, tree n1, tree n2);
-  void set_relation (relation_kind kind, tree n1, tree n2);
-
-  inline relation_kind kind () const { return related; }
-  inline tree op1 () const { return name1; }
-  inline tree op2 () const { return name2; }
-
-  bool union_ (value_relation &p);
-  bool intersect (value_relation &p);
-  void negate ();
-  bool apply_transitive (const value_relation &rel);
-
-  void dump (FILE *f) const;
-private:
-  relation_kind related;
-  tree name1, name2;
-};
-
-// Set relation R between ssa_name N1 and N2.
-
-inline void
-value_relation::set_relation (relation_kind r, tree n1, tree n2)
-{
-  related = r;
-  name1 = n1;
-  name2 = n2;
-}
-
-// Default constructor.
-
-inline
-value_relation::value_relation ()
-{
-  related = VREL_VARYING;
-  name1 = NULL_TREE;
-  name2 = NULL_TREE;
-}
-
-// Constructor for relation R between SSA version N1 nd N2.
-
-inline
-value_relation::value_relation (relation_kind kind, tree n1, tree n2)
-{
-  set_relation (kind, n1, n2);
-}
-
 // Negate the current relation.
 
 void
index 64884a8eea20c9ea055379ad191656d0051db5e5..f3b18ac62efc57acdd15417a1b5b4aa67f14802b 100644 (file)
@@ -256,4 +256,61 @@ private:
   bitmap_obstack m_bitmaps;
   struct obstack m_chain_obstack;
 };
+
+// The value-relation class is used to encapsulate the represention of an
+// individual relation between 2 ssa-names, and to facilitate operating on
+// the relation.
+
+class value_relation
+{
+public:
+  value_relation ();
+  value_relation (relation_kind kind, tree n1, tree n2);
+  void set_relation (relation_kind kind, tree n1, tree n2);
+
+  inline relation_kind kind () const { return related; }
+  inline tree op1 () const { return name1; }
+  inline tree op2 () const { return name2; }
+
+  bool union_ (value_relation &p);
+  bool intersect (value_relation &p);
+  void negate ();
+  bool apply_transitive (const value_relation &rel);
+
+  void dump (FILE *f) const;
+private:
+  relation_kind related;
+  tree name1, name2;
+};
+
+// Set relation R between ssa_name N1 and N2.
+
+inline void
+value_relation::set_relation (relation_kind r, tree n1, tree n2)
+{
+  gcc_checking_assert (TREE_CODE (n1) == SSA_NAME
+                      && TREE_CODE (n2) == SSA_NAME);
+  related = r;
+  name1 = n1;
+  name2 = n2;
+}
+
+// Default constructor.
+
+inline
+value_relation::value_relation ()
+{
+  related = VREL_VARYING;
+  name1 = NULL_TREE;
+  name2 = NULL_TREE;
+}
+
+// Constructor for relation R between SSA version N1 nd N2.
+
+inline
+value_relation::value_relation (relation_kind kind, tree n1, tree n2)
+{
+  set_relation (kind, n1, n2);
+}
+
 #endif  /* GCC_VALUE_RELATION_H */