pro64-support
[Top] [All Lists]

Re: multi-entry CFG

To: Peng Zhao <pengzhao@xxxxxxxxxxxxxx>
Subject: Re: multi-entry CFG
From: Chandrasekhar Murthy <murthy@xxxxxxx>
Date: Mon, 27 Aug 2001 11:16:06 -0700
Cc: sgi <pro64-support@xxxxxxxxxxx>
References: <Pine.LNX.4.21.0108262200410.28336-100000@xxxxxxxxxxxxxxxxxxxx>
Sender: owner-pro64-support@xxxxxxxxxxx
>
> 3.  Another question is  about the SWITCH casegotos. In the whirl tree for
>     Programs containing switch structure, why not make the BLOCKs for each
>     "case" the children of the CASES? In pro64, casegotos are used and the
> BLOCKS for the cases are NOT in the subtree rooted from the SWITCH wn.
>
>

In WHIRL a node can appear only once in the tree.

Consider the following example

  switch (c) {
      ...
      case 'a':
      case 'b':
      case 'c':
      case 'd':
      {
          // block of code
          ...
       }
       // fall thru
       case '1':
       case '2':
       {
           // block of code
           ...
           break;
        }
        ...
    }
    ...

You would need to duplicate the blocks for both of the cases above.

Murthy


<Prev in Thread] Current Thread [Next in Thread>