Changeset 4102 for proto


Ignore:
Timestamp:
Aug 30, 2014, 10:44:00 PM (5 years ago)
Author:
ksherdy
Message:

Comment out unused carry calls.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/s2k/trunk/framework/src/toolchain/s2k/transformer/visitors/S2K2B2K/S2K2B2KTransformer.java

    r4020 r4102  
    2727import toolchain.b2k.lang.builtin.KernelBuiltins;
    2828import toolchain.b2k.lang.builtin.KernelState;
     29import toolchain.b2k.lang.paramBuiltin.idisa.IDISABuiltin;
     30import toolchain.b2k.lang.paramBuiltin.idisa.IDISABuiltinsTranslator;
    2931import toolchain.b2k.lang.runtimeInfoSet.RuntimeInfoSetEncoder;
    3032import static toolchain.b2k.lang.paramBuiltin.idisa.IDISABuiltin.*;
     
    3335// non-conflicting imports
    3436import toolchain.s2k.lang.builtin.S2KBuiltinsUtil;
     37import toolchain.s2k.lang.paramBuiltin.S2KParamBuiltinsUtil;
    3538import toolchain.s2k.transformer.visitors.infoSet.PropertyInfoSet;
    3639import toolchain.s2k.transformer.visitors.infoSet.PropertyInfoSetMapBuilder;
     
    317320
    318321        private void addCarryAdjustment(KernelFuncDefNode node, Context context, int carry1Count) {
    319             FuncCallNode carryAdjustment = Generators.makeCarryAdjustmentCall(node, context, carry1Count);
    320             ASTNode body = Accessors.body(node);
    321             body.appendChild(carryAdjustment);
     322        //    FuncCallNode carryAdjustment = Generators.makeCarryAdjustmentCall(node, context, carry1Count);
     323        //    ASTNode body = Accessors.body(node);
     324        //    body.appendChild(carryAdjustment);
    322325        }       
    323326       
     
    362365                int carry1Position  = propInfoSetMap.get(snode).carry1Position;
    363366                orCarryRangeIntoCondition(replacement, context, carry1Position, carry1Count);
    364                 appendCarryDequeueEnqueueToElseClause(replacement, context, carry1Position, carry1Count);
     367                // appendCarryDequeueEnqueueToElseClause(replacement, context, carry1Position, carry1Count);
    365368            }
    366369
     
    381384        }
    382385
    383         private void appendCarryDequeueEnqueueToElseClause(IfStmtNode node, Context context, int carry1Position, int carry1Count) {
    384             Locator locator = node.getLocation();
    385             ASTNode carryDequeueEnqueue = Generators.makeCarryDequeueEnqueueCall(locator, context, carry1Position, carry1Count);
    386 
    387             ensureHasElseClause(node); 
    388             Accessors.elseClause(node).appendChild(carryDequeueEnqueue);
    389         }       
     386        // _KH_ no en/dequeue
     387        //private void appendCarryDequeueEnqueueToElseClause(IfStmtNode node, Context context, int carry1Position, int carry1Count) {
     388            //Locator locator = node.getLocation();
     389            //ASTNode carryDequeueEnqueue = Generators.makeCarryDequeueEnqueueCall(locator, context, carry1Position, carry1Count);
     390
     391            //ensureHasElseClause(node); 
     392            //Accessors.elseClause(node).appendChild(carryDequeueEnqueue);
     393        //}       
    390394       
    391395        private void ensureHasElseClause(IfStmtNode node) {
     
    476480            ASTNode outerCondition      = makeOuterIfCondition(condition, carry1Position, carry1Count);   
    477481            BlockStmtNode thenClause    = outerIfThenClause(snode, condition, body, carry1Position, carry1Count);
    478             BlockStmtNode elseClause    = outerIfElseClause(snode, carry1Position, carry1Count);
    479 
    480             return Generators.makeIfStmtNode(locator, outerCondition, thenClause, elseClause);
     482            // _KH_ no en/dequeue : BlockStmtNode elseClause    = outerIfElseClause(snode, carry1Position, carry1Count);
     483
     484            return Generators.makeIfStmtNode(locator, outerCondition, thenClause); // _KH_ no en/dequeue , elseClause);
    481485        }       
    482486       
     
    542546           
    543547            Locator locator                     = Generators.makeTextLocation(snode.getLocation());
    544             FuncCallNode carryDequeueEnqueue    = Generators.makeCarryDequeueEnqueueCall(locator, context, carry1Position, carry1Count);
    545             return Generators.makeBlockStmtNode(locator, carryDequeueEnqueue);
     548            // _KH_ no en/dequeue FuncCallNode carryDequeueEnqueue    = Generators.makeCarryDequeueEnqueueCall(locator, context, carry1Position, carry1Count);
     549            // _KH_ no en/dequeue return Generators.makeBlockStmtNode(locator, carryDequeueEnqueue);
     550            return Generators.makeBlockStmtNode(locator);
    546551        }       
    547552       
     
    578583                        ASTNode funcCallArgsList = childResults.get(1);
    579584                        List<ASTNode> args = funcCallArgsList.getChildren();
    580                         return replacement = translator.translate(b2kBuiltin, snode, context, args);
     585                        replacement = translator.translate(b2kBuiltin, snode, context, args);
     586                        return replacement;
    581587                       
    582588                }
    583589            }
     590           
    584591
    585592            replacement  = new FuncCallNode(Generators.makeToken(snode.getToken()));
     
    588595            return replacement;
    589596        }
     597       
     598        ////////////////////////////////////////////////////////////////////////////////////
     599        // IdisaFuncCall       
     600        //
     601        // Translation of s2k builtin depends on the
     602        // prior execution of the TempifyCarryBuiltinCalls
     603        // transformer.
     604        //
     605        public ASTNode visitLeave(s2k.ast.IdisaFuncCallNode snode, List<ASTNode> childResults) {
     606
     607            ASTNode replacement = null;
     608               
     609            if (S2KParamBuiltinsUtil.isBuiltInCall(snode)) {
     610                IDISABuiltin idisaBuiltin = S2KParam2B2KIDISABuiltins.b2KBuiltin(S2KParamBuiltinsUtil.builtin(snode));
     611                IDISABuiltinsTranslator translator = idisaBuiltin.getTranslator();
     612                FieldWidthNode fieldWidthNode = (FieldWidthNode) childResults.get(1);
     613                ASTNode funcCallArgsList = childResults.get(2);
     614                List<ASTNode> args = funcCallArgsList.getChildren();
     615                replacement = translator.translate(idisaBuiltin, snode, fieldWidthNode, args);
     616
     617                return replacement;
     618//               
     619           }
     620//           
     621//           
     622//
     623            replacement  = new IdisaFuncCallNode(Generators.makeToken(snode.getToken()));
     624            appendChildResults(replacement, childResults);
     625//
     626            return replacement;
     627        }
     628//       
    590629
    591630        ////////////////////////////////////////////////////////////////////////////////////
     
    657696
    658697            String lexeme = b2k.lexicalAnalyzer.Lextant.BITBLOCK.getPrimaryLexeme();
    659 
     698           
    660699            Token token = b2k.tokens.LextantToken.make(Generators.makeTextLocation(snode.getToken().getLocation()),
    661700                    lexeme,
     
    663702
    664703            ASTNode replacement = new BitBlockTypeNode(token);
     704            ((BitBlockTypeNode)replacement).setFieldWidth(snode.getFieldWidth());
    665705            appendChildResults(replacement, childResults);
    666706           
Note: See TracChangeset for help on using the changeset viewer.