TRNode* node = getSomeTRNode(); int opcode = node->getOpCode(); // get the opcode of the TR node if(opcode == TR_INC) { // do something if the opcode is TR_INC }
for(auto it = trIterBegin(ast); it != trIterEnd(ast); ++it) { int opcode = it->getOpCode(); // get the opcode of the TR node // do something based on the opcode }In this example, we iterate over all the TR nodes in the AST using the trIterBegin and trIterEnd functions. For each TR node, we obtain its opcode using the getOpCode method and then perform some action based on it. Package library: cx::translator