From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1011) id 4CB453851143; Thu, 29 Sep 2022 22:34:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4CB453851143 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664490884; bh=beTzQVDwCKzz7MNLMw1/5mhtBzD72Sh5ZO1Kqkpg2oo=; h=From:To:Subject:Date:From; b=Q0LXPL6UVafQHkOAbp0vzThEpYRO3oQGeVwU73W82beWkXYs9lIrD/1KouX2vdAiL bbMRMt3d2V6TC7ChlrTdOSivphEtgfYYoMfzC9VNGVg7+WP3z27SvpX3maqzNAo3zX SmF3MjUCEhOJwlh0o33Z7wOVL7UqccCxru/JVKIk= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Andrew Macleod To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-2972] Move class value_relation the header file. X-Act-Checkin: gcc X-Git-Author: Andrew MacLeod X-Git-Refname: refs/heads/master X-Git-Oldrev: ef9bc3626ceacf9a81c1e6178a5b0eb83ca2e559 X-Git-Newrev: cfa7434c4b09e439ae8b904ad116adf6d3033f8c Message-Id: <20220929223444.4CB453851143@sourceware.org> Date: Thu, 29 Sep 2022 22:34:44 +0000 (GMT) List-Id: https://gcc.gnu.org/g:cfa7434c4b09e439ae8b904ad116adf6d3033f8c commit r13-2972-gcfa7434c4b09e439ae8b904ad116adf6d3033f8c Author: Andrew MacLeod Date: Thu Sep 22 17:27:36 2022 -0400 Move class value_relation the header file. * 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. Diff: --- gcc/value-relation.cc | 55 ------------------------------------------------- gcc/value-relation.h | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 55 deletions(-) diff --git a/gcc/value-relation.cc b/gcc/value-relation.cc index 7fc22d30126..e6f5ef4d5e1 100644 --- a/gcc/value-relation.cc +++ b/gcc/value-relation.cc @@ -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 diff --git a/gcc/value-relation.h b/gcc/value-relation.h index 64884a8eea2..f3b18ac62ef 100644 --- a/gcc/value-relation.h +++ b/gcc/value-relation.h @@ -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 */