/* Utility function to link a node when returning from a CodeGen function. */
STATIC EFI_STATUS EFIAPI LinkNode(IN AML_OBJECT_NODE *Node, IN AML_NODE_HEADER *ParentNode, OUT AML_OBJECT_NODE **NewObjectNode)
/* Utility function to link a node when returning from a CodeGen function. */
STATIC EFI_STATUS EFIAPI LinkNode(IN AML_OBJECT_NODE *Node, IN AML_NODE_HEADER *ParentNode, OUT AML_OBJECT_NODE **NewObjectNode)
{
  EFI_STATUS  Status;
  if (NewObjectNode != NULL) {
    *NewObjectNode = NULL;
  }
  if (ParentNode != NULL) {
    Status = AmlVarListAddTail (ParentNode, (AML_NODE_HEADER *)Node);
    if (EFI_ERROR (Status)) {
      ASSERT (0);
      return Status;
    }
  }
  if (NewObjectNode != NULL) {
    *NewObjectNode = Node;
  }
  return EFI_SUCCESS;
}