Changeset 4101


Ignore:
Timestamp:
Aug 30, 2014, 10:42:34 PM (4 years ago)
Author:
ksherdy
Message:

Tempify IDISA calls.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/s2k/trunk/framework/src/toolchain/s2k/transformer/visitors/S2K2S2K/TempifyCarrySetBuiltinCalls.java

    r4020 r4101  
    11/*
    2  * Converts carry generating builtins expressions to compiled form.
     2 * Converts carry generating builtins expressions to a compiled form.
    33 * Applied before carry variable insertion.
    44 *
     
    5353import toolchain.s2k.ast.Generators;
    5454import toolchain.s2k.lang.builtin.S2KBuiltinsUtil;
     55import toolchain.s2k.lang.builtin.S2KBuiltins.CarryType;
    5556import toolchain.util.Labeller;
    5657import toolchain.util.Pair;
     58import static toolchain.s2k.lang.signatures.SignatureShorthand.sig_II_S;
     59import static toolchain.s2k.lang.signatures.SignatureShorthand.sig_ST_V;
     60import static toolchain.s2k.lang.signatures.SignatureShorthand.sig_S_S;
    5761import static toolchain.util.MapUtil.*;
    5862
     
    132136           
    133137           
    134             if(S2KBuiltinsUtil.isCarry(node)) {
     138            if(S2KBuiltinsUtil.isCarry(node)) { // KH: bug to fix
    135139               
    136140                if(!(node.getParent() instanceof AssignNode)) {
     
    151155        }
    152156       
     157        public void visitLeave(IdisaFuncCallNode node) {
     158            if(!(node.getParent() instanceof AssignNode)) {
     159           
     160                BlockStmtNode blockStmt          = Accessors.getEnclosingBlockStmt(node);
     161                Locator locator                  = blockStmt;
     162                IdentifierNode name              = Generators.makeIdentifierNode(locator, labeller.newLabel());
     163                StreamTypeNode type              = Generators.makeStreamType(locator);
     164                VarDeclNode varDecl              = Generators.makeVarDeclNode(locator, type, name.deepCopy());
     165                AssignNode assignStmt            = Generators.makeAssignNode(locator, name.deepCopy(), node.deepCopy());
     166
     167                addValueToList(enclBlockStmtTempDecls, blockStmt, varDecl);
     168                addValueToList(enclBlockStmtTempAssigns, blockStmt, assignStmt);
     169
     170                node.updateSelf(name);               
     171            }
     172        }       
     173       
    153174        //////////////////////////////////////////////////////////////
    154175        // helpers
Note: See TracChangeset for help on using the changeset viewer.