at.dms.kjc.spacetime
Class SafeFileReaderWriterPositions

java.lang.Object
  extended by at.dms.kjc.spacetime.SafeFileReaderWriterPositions

public class SafeFileReaderWriterPositions
extends Object

Separate FileReaders from splitters, FileWriters from joiners.

The spacetime compiler can not cope with a FileReader directly before a splitter or a FileWriter directly after a joiner. This little pass inserts identity filters to avoid these cases. The filters are not the SIRIdentity builtin filter which sir/lowering/fusion/Lifter removes (and possibly other optimization passes also remove).

Author:
dimock

Method Summary
static void doit(SIRStream str)
          Make FileReader positions safe with respect to splitters and FileWriter positions safe with respect to joiners.
static SIRFilter makeIdentityFilter(CType typ)
          Create a new identity filter at a specified type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

doit

public static void doit(SIRStream str)
Make FileReader positions safe with respect to splitters and FileWriter positions safe with respect to joiners.

Parameters:
str - the root SIRStream

makeIdentityFilter

public static SIRFilter makeIdentityFilter(CType typ)
Create a new identity filter at a specified type.

Parameters:
typ - input and output CType for identity filter
Returns:
a new identity filter of the requested type that will need a setParent before being usable.