gtGetOp1 is a function that belongs to the GenTree class which is a part of the Microsoft Visual C++ compiler. This function is used to retrieve the first operand of a given GenTree node.
Here are some code examples:
Example 1:
GenTree* node = new GenTreeOpAdd(); GenTree* op1 = gtGetOp1(node);
In this example, we create a new GenTree node that represents an addition operation. We then use gtGetOp1 to retrieve the first operand of the node, which should be null because we haven't set any operands yet.
Example 2:
GenTree* node = new GenTreeOpAdd(); GenTree* op = new GenTreeIntCon(10); node->gtOp.gtOp1 = op; GenTree* op1 = gtGetOp1(node);
In this example, we create a new GenTree node that represents an addition operation. We then create a new GenTree node that represents an integer constant with a value of 10. We set this node as the first operand of the addition node using gtGetOp1. We then use gtGetOp1 to retrieve the first operand of the node, which should be the node we just created.
Package library: Microsoft Visual C++ compiler.
C++ (Cpp) GenTree::gtGetOp1 - 2 examples found. These are the top rated real world C++ (Cpp) examples of GenTree::gtGetOp1 extracted from open source projects. You can rate examples to help us improve the quality of examples.