-/*-----------------------------------------------------------------*/
-/* markVisited - will set the visited flag for the given Block */
-/*-----------------------------------------------------------------*/
-DEFSETFUNC (markVisited)
-{
- eBBlock *ebp = item;
-
- if (ebp->visited)
- return 0;
- ebp->visited = 1;
- applyToSet (ebp->succList, markVisited);
- return 0;
-}
-
-/*-----------------------------------------------------------------*/
-/* isOpAlive - checks to see if the usage in this block is the */
-/* uses the same definitions as this one */
-/*-----------------------------------------------------------------*/
-DEFSETFUNC (isOpAlive)
-{
- eBBlock *ebp = item;
- V_ARG (operand *, op);
- V_ARG (eBBlock *, orig);
- V_ARG (iCode *, ic);
-
- if (ebp->visited)
- return 0;
-
- ebp->visited = 1;
-
- /* if we have reached the originating block */
- /* or this block has some definiton for it */
- /* then check if it is used between start & */
- /* this point */
- if (ebp == orig ||
- bitVectBitsInCommon (OP_DEFS (op), ebp->defSet))
- if (usedBetweenPoints (op, ebp->sch, ic))
- return 1;
- else
- {
- applyToSet (ebp->succList, markVisited);
- return 0;
- }
- else
- /* choosing this more expensive one since
- killDeadCode will take away some definitions
- but there is not way right now to take away
- the usage information for the corresponding
- usages, this will lead to longer live ranges */
- if (usedInRemaining (op, ebp->sch))
- return 1;
-
-
- return (applyToSet (ebp->succList, isOpAlive, op, orig, ic));
-}
-
-/*-----------------------------------------------------------------*/
-/* isLastUse - return TRUE if no usage of this operand after this */
-/*-----------------------------------------------------------------*/
-int
-isLastUse (operand * op, eBBlock * ebp, iCode * ic,
- eBBlock ** ebbs, int count)
-{
- int i;
-
- /* if this is used in the remaining */
- if (usedInRemaining (op, ic))
- return 0;
-
- /* if not then check any of the successor blocks use it */
- for (i = 0; i < count; ebbs[i++]->visited = 0);
- if (applyToSet (ebp->succList, isOpAlive, op, ebp, ic))
- return 0;
-
- /* this is the last use */
- return 1;
-}
-
-/*-----------------------------------------------------------------*/
-/* unionDefsUsed - unions the defsUsed in a block */
-/*-----------------------------------------------------------------*/
-DEFSETFUNC (unionDefsUsed)
-{
- eBBlock *ebp = item;
- V_ARG (bitVect **, bvp);
-
- if (ebp->visited)
- return 0;
-
- ebp->visited = 1;
-
- *bvp = bitVectUnion (*bvp, ebp->usesDefs);
- applyToSet (ebp->succList, unionDefsUsed, bvp);
- return 0;
-}
-