if (KjcOptions.ptraccess) {    print(ident + "_Alloc");   stackAllocateArray(ident);   print(";\n"); print(baseType + " *" + ident + " = " + ident + "_Alloc"); } else {  left.accept(this);  stackAllocateArray(ident); }
stackAllocateArray(ident);
    public void visitAssignmentExpression(JAssignmentExpression self,                                          JExpression left,                                          JExpression right) {	//print the correct code for array assignment	//this must be run after renaming!!!!!!	if (left.getType() == null || right.getType() == null) {	    lastLeft=left;	    print("(");	    left.accept(this);	    print(" = ");	    right.accept(this);	    print(")");	    return; 	}	if ((left.getType().isArrayType()) &&	     ((right.getType().isArrayType() || right instanceof SIRPopExpression) &&	      !(right instanceof JNewArrayExpression))) {	    	    	    String ident = "";	    	    	    if (left instanceof JFieldAccessExpression) 		ident = ((JFieldAccessExpression)left).getIdent();	    else if (left instanceof JLocalVariableExpression) 		ident = ((JLocalVariableExpression)left).getVariable().getIdent();	    else 		Utils.fail("Assigning an array to an unsupported expression of type " + left.getClass() + ": " + left);	    	    String[] dims = ArrayDim.findDim(tile.getComputeCode(), ident);	    //if we cannot find the dim, just create a pointer copy	    if (dims == null) {		lastLeft=left;		print("(");		left.accept(this);		print(" = ");		right.accept(this);		print(")");		return;	    }	    print("{\n");	    print("int ");	    //print the index var decls	    for (int i = 0; i < dims.length -1; i++)		print(RawExecutionCode.ARRAY_COPY + i + ", ");	    print(RawExecutionCode.ARRAY_COPY + (dims.length - 1));	    print(";\n");	    for (int i = 0; i < dims.length; i++) {		print("for (" + RawExecutionCode.ARRAY_COPY + i + " = 0; " + RawExecutionCode.ARRAY_COPY + i +  		      " < " + dims[i] + "; " + RawExecutionCode.ARRAY_COPY + i + "++)\n");	    }	    left.accept(this);	    for (int i = 0; i < dims.length; i++)		print("[" + RawExecutionCode.ARRAY_COPY + i + "]");	    print(" = ");	    right.accept(this);	    for (int i = 0; i < dims.length; i++)		print("[" + RawExecutionCode.ARRAY_COPY + i + "]");	    print(";\n}\n");	    return;	}	//stack allocate all arrays 	//done at the variable definition	if (right instanceof JNewArrayExpression && 	    (left instanceof JLocalVariableExpression)) {	    //	    (((CArrayType)((JNewArrayExpression)right).getType()).getArrayBound() < 2)) {	    //get the basetype and print it 	    CType baseType = ((CArrayType)((JNewArrayExpression)right).getType()).getBaseType();	    print(baseType + " ");	    //print the identifier	    	    //Before the ISCA hack this was how we printed the var ident	    //	    left.accept(this);	    	    String ident;	    ident = ((JLocalVariableExpression)left).getVariable().getIdent();	    	    if (KjcOptions.ptraccess) {				//HACK FOR THE ICSA PAPER, !!!!!!!!!!!!!!!!!!!!!!!!!!!!!		//turn all array access into access of a pointer pointing to the array		print(ident + "_Alloc");				//print the dims of the array		stackAllocateArray(ident);		//print the pointer def and the assignment to the array		print(";\n");		print(baseType + " *" + ident + " = " + ident + "_Alloc");	    }	    else {		//the way it used to be before the hack		 left.accept(this);		 //print the dims of the array		 stackAllocateArray(ident);	    }	    return;	}           		lastLeft=left;        print("(");        left.accept(this);        print(" = ");        right.accept(this);        print(")");    }