+/*-----------------------------------------------------------------*/
+/* copyiCode - make a copy of the iCode given */
+/*-----------------------------------------------------------------*/
+iCode *copyiCode (iCode *ic)
+{
+ iCode *nic = newiCode(ic->op,NULL,NULL);
+
+ nic->lineno = ic->lineno ;
+ nic->filename= ic->filename ;
+ nic->block = ic->block;
+ nic->level = ic->level;
+
+ /* deal with the special cases first */
+ switch (ic->op) {
+ case IFX:
+ IC_COND(nic) = operandFromOperand(IC_COND(ic));
+ IC_TRUE(nic) = operandFromOperand(IC_TRUE(ic));
+ IC_FALSE(nic)= operandFromOperand(IC_FALSE(ic));
+ break;
+
+ case JUMPTABLE:
+ IC_JTCOND(nic) = operandFromOperand(IC_JTCOND(ic));
+ IC_JTLABELS(nic) = IC_JTLABLES(ic);
+ break;
+
+ case CALL:
+ case PCALL:
+ IC_RESULT(nic) = operandFromOperand(IC_RESULT(ic));
+ IC_LEFT(nic) = operandFromOperand(IC_LEFT(ic));
+ IC_ARGS(nic) = IC_ARGS(ic);
+ break;
+
+ case INLINEASM:
+ IC_INLINE(nic) = IC_ININE(ic);
+ break;
+
+ default:
+ IC_RESULT(nic) = operandFromOperand(IC_RESULT(ic));
+ IC_LEFT(nic) = operandFromOperand(IC_LEFT(ic));
+ IC_RIGHT(nic)= operandFromOperand(IC_RIGHT(ic));
+ }
+
+ return nic;
+}
+