|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object scale.clef.ErrorPredicate scale.clef2scribble.Clef2Scribble
public class Clef2Scribble
This class builds a Scribble graph (CFG) out of a Clef tree (AST).
$Id: Clef2Scribble.java,v 1.374 2007-10-04 19:58:09 burrill Exp $
Copyright 2008 by the
Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.
This class builds a Scribble graph out of a Clef graph.
The functionality of building the Scribble graph has been separated from the actual Scribble class to keep each class small.
Methods that convert Clef statements return a range of Scribble statements (or basic blocks) that are equivalent to the Clef statement. Methods that convert Clef expressions return a range of Score statements as well, but also an indication of which variable holds the final value of that expression.
Field Summary | |
---|---|
static boolean |
hasDummyAliases
True if there may be aliases between address arguments to subroutines. |
static boolean |
noBuiltins
Set true if certain standard C library functions should not be inlined. |
Constructor Summary | |
---|---|
Clef2Scribble(RoutineDecl rd,
SourceLanguage lang,
CallGraph cg)
Construct a Scribble graph for a single routine. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static boolean noBuiltins
public static boolean hasDummyAliases
Constructor Detail |
---|
public Clef2Scribble(RoutineDecl rd, SourceLanguage lang, CallGraph cg)
rd
- the node in the call graph that represents thelang
- specifies the source languageMethod Detail |
---|
public static int variables()
public static int regVariables()
public static int equVariables()
public static int formalVariables()
public static int globalVariables()
public static int tempVariables()
public static int newCFGNodes()
public static int redundantTests()
public void visitProcedureDecl(ProcedureDecl n)
visitProcedureDecl
in interface DeclPredicate
visitProcedureDecl
in class ErrorPredicate
public void visitBlockStmt(BlockStmt cs)
visitBlockStmt
in interface StmtPredicate
visitBlockStmt
in class ErrorPredicate
public void visitIfThenElseStmt(IfThenElseStmt cs)
visitIfThenElseStmt
in interface StmtPredicate
visitIfThenElseStmt
in class ErrorPredicate
public void visitArithmeticIfStmt(ArithmeticIfStmt s)
visitArithmeticIfStmt
in interface StmtPredicate
visitArithmeticIfStmt
in class ErrorPredicate
public void visitComputedGotoStmt(ComputedGotoStmt s)
visitComputedGotoStmt
in interface StmtPredicate
visitComputedGotoStmt
in class ErrorPredicate
public void visitSwitchStmt(SwitchStmt s)
visitSwitchStmt
in interface StmtPredicate
visitSwitchStmt
in class ErrorPredicate
public void visitWhileLoopStmt(WhileLoopStmt cs)
visitWhileLoopStmt
in interface StmtPredicate
visitWhileLoopStmt
in class ErrorPredicate
public void visitRepeatWhileLoopStmt(RepeatWhileLoopStmt cs)
visitRepeatWhileLoopStmt
in interface StmtPredicate
visitRepeatWhileLoopStmt
in class ErrorPredicate
public void visitRepeatUntilLoopStmt(RepeatUntilLoopStmt cs)
visitRepeatUntilLoopStmt
in interface StmtPredicate
visitRepeatUntilLoopStmt
in class ErrorPredicate
public void visitDoLoopStmt(DoLoopStmt cs)
visitDoLoopStmt
in interface StmtPredicate
visitDoLoopStmt
in class ErrorPredicate
public void visitForLoopStmt(ForLoopStmt cs)
visitForLoopStmt
in interface StmtPredicate
visitForLoopStmt
in class ErrorPredicate
public void visitBreakStmt(BreakStmt cs)
visitBreakStmt
in interface StmtPredicate
visitBreakStmt
in class ErrorPredicate
public void visitContinueStmt(ContinueStmt cs)
visitContinueStmt
in interface StmtPredicate
visitContinueStmt
in class ErrorPredicate
public void visitGotoStmt(GotoStmt cs)
visitGotoStmt
in interface StmtPredicate
visitGotoStmt
in class ErrorPredicate
public void visitReturnStmt(ReturnStmt cs)
visitReturnStmt
in interface StmtPredicate
visitReturnStmt
in class ErrorPredicate
public void visitExitStmt(ExitStmt cs)
visitExitStmt
in interface StmtPredicate
visitExitStmt
in class ErrorPredicate
public void visitEvalStmt(EvalStmt cs)
visitEvalStmt
in interface StmtPredicate
visitEvalStmt
in class ErrorPredicate
public void visitDeclStmt(DeclStmt cs)
visitDeclStmt
in interface StmtPredicate
visitDeclStmt
in class ErrorPredicate
public void visitNullStmt(NullStmt cs)
visitNullStmt
in interface StmtPredicate
visitNullStmt
in class ErrorPredicate
public void visitLabelStmt(LabelStmt cs)
visitLabelStmt
in interface StmtPredicate
visitLabelStmt
in class ErrorPredicate
public void visitLiteral(Literal li)
visitLiteral
in interface ExprPredicate
visitLiteral
in class ErrorPredicate
public void visitAddressLiteral(AddressLiteral al)
visitAddressLiteral
in interface ExprPredicate
visitAddressLiteral
in class ErrorPredicate
public void visitIntLiteral(IntLiteral ce)
visitIntLiteral
in interface ExprPredicate
visitIntLiteral
in class ErrorPredicate
public void visitFloatLiteral(FloatLiteral ce)
visitFloatLiteral
in interface ExprPredicate
visitFloatLiteral
in class ErrorPredicate
public void visitComplexLiteral(ComplexLiteral ce)
visitComplexLiteral
in interface ExprPredicate
visitComplexLiteral
in class ErrorPredicate
public void visitSizeofLiteral(SizeofLiteral ce)
visitSizeofLiteral
in interface ExprPredicate
visitSizeofLiteral
in class ErrorPredicate
public void visitStringLiteral(StringLiteral sl)
visitStringLiteral
in interface ExprPredicate
visitStringLiteral
in class ErrorPredicate
public void visitFloatArrayLiteral(FloatArrayLiteral fal)
visitFloatArrayLiteral
in interface ExprPredicate
visitFloatArrayLiteral
in class ErrorPredicate
public void visitIntArrayLiteral(IntArrayLiteral fal)
visitIntArrayLiteral
in interface ExprPredicate
visitIntArrayLiteral
in class ErrorPredicate
public void visitAggregationElements(AggregationElements ag)
visitAggregationElements
in interface ExprPredicate
visitAggregationElements
in class ErrorPredicate
public void visitBooleanLiteral(BooleanLiteral ce)
visitBooleanLiteral
in interface ExprPredicate
visitBooleanLiteral
in class ErrorPredicate
public void visitCharLiteral(CharLiteral ce)
visitCharLiteral
in interface ExprPredicate
visitCharLiteral
in class ErrorPredicate
public void visitVaArgOp(VaArgOp va)
visitVaArgOp
in interface ExprPredicate
visitVaArgOp
in class ErrorPredicate
public void visitVaCopyOp(VaCopyOp p)
visitVaCopyOp
in interface ExprPredicate
visitVaCopyOp
in class ErrorPredicate
public void visitVaEndOp(VaEndOp va)
visitVaEndOp
in interface ExprPredicate
visitVaEndOp
in class ErrorPredicate
public void visitVaStartOp(VaStartOp va)
visitVaStartOp
in interface ExprPredicate
visitVaStartOp
in class ErrorPredicate
public void visitIdAddressOp(IdAddressOp ce)
visitIdAddressOp
in interface ExprPredicate
visitIdAddressOp
in class ErrorPredicate
public void visitIdValueOp(IdValueOp ce)
visitIdValueOp
in interface ExprPredicate
visitIdValueOp
in class ErrorPredicate
public void visitStatementOp(StatementOp so)
visitStatementOp
in interface ExprPredicate
visitStatementOp
in class ErrorPredicate
public void visitSeriesOp(SeriesOp op)
visitSeriesOp
in interface ExprPredicate
visitSeriesOp
in class ErrorPredicate
public void visitParenthesesOp(ParenthesesOp p)
visitParenthesesOp
in interface ExprPredicate
visitParenthesesOp
in class ErrorPredicate
public void visitAssignSimpleOp(AssignSimpleOp p)
visitAssignSimpleOp
in interface ExprPredicate
visitAssignSimpleOp
in class ErrorPredicate
public void visitDefOp(DefOp p)
visitDefOp
in interface ExprPredicate
visitDefOp
in class ErrorPredicate
public void visitPositiveOp(PositiveOp p)
visitPositiveOp
in interface ExprPredicate
visitPositiveOp
in class ErrorPredicate
public void visitNegativeOp(NegativeOp no)
visitNegativeOp
in interface ExprPredicate
visitNegativeOp
in class ErrorPredicate
public void visitTranscendentalOp(TranscendentalOp no)
visitTranscendentalOp
in interface ExprPredicate
visitTranscendentalOp
in class ErrorPredicate
public void visitTranscendental2Op(Transcendental2Op no)
visitTranscendental2Op
in interface ExprPredicate
visitTranscendental2Op
in class ErrorPredicate
public void visitAbsoluteValueOp(AbsoluteValueOp no)
visitAbsoluteValueOp
in interface ExprPredicate
visitAbsoluteValueOp
in class ErrorPredicate
public void visitMinimumOp(MinimumOp deo)
min(a,b)
to the series of CFG nodes.
Converted to
check = a < b if (check) then t = a else t = b twhere
t
is the result value.
visitMinimumOp
in interface ExprPredicate
visitMinimumOp
in class ErrorPredicate
public void visitMaximumOp(MaximumOp deo)
max(a,b)
to the series of CFG nodes.
Converted to
check = a > b if (check) then t = a else t = b twhere
t
is the result value.
visitMaximumOp
in interface ExprPredicate
visitMaximumOp
in class ErrorPredicate
public void visitAdditionOp(AdditionOp deo)
visitAdditionOp
in interface ExprPredicate
visitAdditionOp
in class ErrorPredicate
public void visitSubtractionOp(SubtractionOp deo)
visitSubtractionOp
in interface ExprPredicate
visitSubtractionOp
in class ErrorPredicate
public void visitMultiplicationOp(MultiplicationOp deo)
visitMultiplicationOp
in interface ExprPredicate
visitMultiplicationOp
in class ErrorPredicate
public void visitDivisionOp(DivisionOp deo)
visitDivisionOp
in interface ExprPredicate
visitDivisionOp
in class ErrorPredicate
public void visitRemainderOp(RemainderOp deo)
visitRemainderOp
in interface ExprPredicate
visitRemainderOp
in class ErrorPredicate
public void visitExponentiationOp(ExponentiationOp deo)
visitExponentiationOp
in interface ExprPredicate
visitExponentiationOp
in class ErrorPredicate
public void visitPreDecrementOp(PreDecrementOp io)
visitPreDecrementOp
in interface ExprPredicate
visitPreDecrementOp
in class ErrorPredicate
public void visitPreIncrementOp(PreIncrementOp io)
visitPreIncrementOp
in interface ExprPredicate
visitPreIncrementOp
in class ErrorPredicate
public void visitPostDecrementOp(PostDecrementOp io)
visitPostDecrementOp
in interface ExprPredicate
visitPostDecrementOp
in class ErrorPredicate
public void visitPostIncrementOp(PostIncrementOp io)
visitPostIncrementOp
in interface ExprPredicate
visitPostIncrementOp
in class ErrorPredicate
public void visitEqualityOp(EqualityOp deo)
visitEqualityOp
in interface ExprPredicate
visitEqualityOp
in class ErrorPredicate
public void visitGreaterEqualOp(GreaterEqualOp deo)
visitGreaterEqualOp
in interface ExprPredicate
visitGreaterEqualOp
in class ErrorPredicate
public void visitGreaterOp(GreaterOp deo)
visitGreaterOp
in interface ExprPredicate
visitGreaterOp
in class ErrorPredicate
public void visitLessOp(LessOp deo)
visitLessOp
in interface ExprPredicate
visitLessOp
in class ErrorPredicate
public void visitLessEqualOp(LessEqualOp deo)
visitLessEqualOp
in interface ExprPredicate
visitLessEqualOp
in class ErrorPredicate
public void visitNotEqualOp(NotEqualOp deo)
visitNotEqualOp
in interface ExprPredicate
visitNotEqualOp
in class ErrorPredicate
public void visitBitComplementOp(BitComplementOp deo)
visitBitComplementOp
in interface ExprPredicate
visitBitComplementOp
in class ErrorPredicate
public void visitBitAndOp(BitAndOp deo)
visitBitAndOp
in interface ExprPredicate
visitBitAndOp
in class ErrorPredicate
public void visitBitXorOp(BitXorOp deo)
visitBitXorOp
in interface ExprPredicate
visitBitXorOp
in class ErrorPredicate
public void visitBitOrOp(BitOrOp deo)
visitBitOrOp
in interface ExprPredicate
visitBitOrOp
in class ErrorPredicate
public void visitBitShiftOp(BitShiftOp deo)
visitBitShiftOp
in interface ExprPredicate
visitBitShiftOp
in class ErrorPredicate
public void visitMultiplicationAssignmentOp(MultiplicationAssignmentOp deo)
visitMultiplicationAssignmentOp
in interface ExprPredicate
visitMultiplicationAssignmentOp
in class ErrorPredicate
public void visitDivisionAssignmentOp(DivisionAssignmentOp deo)
visitDivisionAssignmentOp
in interface ExprPredicate
visitDivisionAssignmentOp
in class ErrorPredicate
public void visitRemainderAssignmentOp(RemainderAssignmentOp deo)
visitRemainderAssignmentOp
in interface ExprPredicate
visitRemainderAssignmentOp
in class ErrorPredicate
public void visitAdditionAssignmentOp(AdditionAssignmentOp deo)
visitAdditionAssignmentOp
in interface ExprPredicate
visitAdditionAssignmentOp
in class ErrorPredicate
public void visitSubtractionAssignmentOp(SubtractionAssignmentOp deo)
visitSubtractionAssignmentOp
in interface ExprPredicate
visitSubtractionAssignmentOp
in class ErrorPredicate
public void visitBitShiftAssignmentOp(BitShiftAssignmentOp deo)
visitBitShiftAssignmentOp
in interface ExprPredicate
visitBitShiftAssignmentOp
in class ErrorPredicate
public void visitBitAndAssignmentOp(BitAndAssignmentOp deo)
visitBitAndAssignmentOp
in interface ExprPredicate
visitBitAndAssignmentOp
in class ErrorPredicate
public void visitBitXorAssignmentOp(BitXorAssignmentOp deo)
visitBitXorAssignmentOp
in interface ExprPredicate
visitBitXorAssignmentOp
in class ErrorPredicate
public void visitBitOrAssignmentOp(BitOrAssignmentOp deo)
visitBitOrAssignmentOp
in interface ExprPredicate
visitBitOrAssignmentOp
in class ErrorPredicate
public void visitNotOp(NotOp deo)
visitNotOp
in interface ExprPredicate
visitNotOp
in class ErrorPredicate
public void visitAndOp(AndOp deo)
visitAndOp
in interface ExprPredicate
visitAndOp
in class ErrorPredicate
public void visitOrOp(OrOp deo)
visitOrOp
in interface ExprPredicate
visitOrOp
in class ErrorPredicate
public void visitAndConditionalOp(AndConditionalOp cs)
(a && b)
to the series of CFG nodes.
Converted to
t = 0 if (a) then if (b) then t = 1 twhere
t
is the result value.
visitAndConditionalOp
in interface ExprPredicate
visitAndConditionalOp
in class ErrorPredicate
public void visitOrConditionalOp(OrConditionalOp cs)
(a || b)
to the series of CFG nodes.
Converted to
t = 0 if (a) then t = 1 else if (b) then t = 1 twhere
t
is the result value.
visitOrConditionalOp
in interface ExprPredicate
visitOrConditionalOp
in class ErrorPredicate
public void visitExpressionIfOp(ExpressionIfOp cs)
visitExpressionIfOp
in interface ExprPredicate
visitExpressionIfOp
in class ErrorPredicate
public void visitAddressOp(AddressOp aa)
visitAddressOp
in interface ExprPredicate
visitAddressOp
in class ErrorPredicate
public void visitDereferenceOp(DereferenceOp dr)
visitDereferenceOp
in interface ExprPredicate
visitDereferenceOp
in class ErrorPredicate
public void visitNilOp(NilOp deo)
visitNilOp
in interface ExprPredicate
visitNilOp
in class ErrorPredicate
public void visitSelectOp(SelectOp s)
visitSelectOp
in interface ExprPredicate
visitSelectOp
in class ErrorPredicate
public void visitSelectIndirectOp(SelectIndirectOp s)
visitSelectIndirectOp
in interface ExprPredicate
visitSelectIndirectOp
in class ErrorPredicate
public void visitSubscriptValueOp(SubscriptValueOp sub)
visitSubscriptValueOp
in interface ExprPredicate
visitSubscriptValueOp
in class ErrorPredicate
public void visitSubscriptAddressOp(SubscriptAddressOp sub)
visitSubscriptAddressOp
in interface ExprPredicate
visitSubscriptAddressOp
in class ErrorPredicate
public void visitCallFunctionOp(CallFunctionOp co)
visitCallFunctionOp
in interface ExprPredicate
visitCallFunctionOp
in class ErrorPredicate
public void visitTypeConversionOp(TypeConversionOp op)
visitTypeConversionOp
in interface ExprPredicate
visitTypeConversionOp
in class ErrorPredicate
public void visitComplexOp(ComplexOp op)
visitComplexOp
in interface ExprPredicate
visitComplexOp
in class ErrorPredicate
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |