Beispiel #1
0
/** <!--******************************************************************-->
 *
 * @fn CHKMfundef
 *
 * @brief Touched the node and its sons/attributes
 *
 * @param arg_node FunDef node to process
 * @param arg_info pointer to info structure
 *
 * @return processed node
 *
 ***************************************************************************/
node *
CHKMfundef (node * arg_node, info * arg_info)
{
  DBUG_ENTER ("CHKMfundef");
  NODE_ERROR (arg_node) = CHKMTRAV (NODE_ERROR (arg_node), arg_info);
  FUNDEF_EXPORT (arg_node) = CHKMTRAV (FUNDEF_EXPORT (arg_node), arg_info);
  FUNDEF_FUNHEADER (arg_node) =
    CHKMTRAV (FUNDEF_FUNHEADER (arg_node), arg_info);
  FUNDEF_FUNBODY (arg_node) = CHKMTRAV (FUNDEF_FUNBODY (arg_node), arg_info);
  DBUG_RETURN (arg_node);
}
Beispiel #2
0
/** <!--******************************************************************-->
 *
 * @fn COPYfundef
 *
 * @brief Copies the node and its sons/attributes
 *
 * @param arg_node FunDef node to process
 * @param arg_info pointer to info structure
 *
 * @return processed node
 *
 ***************************************************************************/
node *
COPYfundef (node * arg_node, info * arg_info)
{
  node *result = TBmakeFundef (NULL, NULL, NULL);
  DBUG_ENTER ("COPYfundef");
  LUTinsertIntoLutP (INFO_LUT (arg_info), arg_node, result);
  /* Copy sons */
  FUNDEF_EXPORT (result) = COPYTRAV (FUNDEF_EXPORT (arg_node), arg_info);
  FUNDEF_FUNHEADER (result) =
    COPYTRAV (FUNDEF_FUNHEADER (arg_node), arg_info);
  FUNDEF_FUNBODY (result) = COPYTRAV (FUNDEF_FUNBODY (arg_node), arg_info);
  /* Return value */
  DBUG_RETURN (result);
}
Beispiel #3
0
	//check type of return of function against function type
	node *CTfundef(node *arg_node, info *arg_info){
		DBUG_ENTER("CTfundef");
		INFO_HASRETURN(arg_info) = 0;
		INFO_FUNTYPE(arg_info) = 999;

		FUNDEF_FUNBODY(arg_node) = TRAVopt(FUNDEF_FUNBODY(arg_node), arg_info);

		if(INFO_HASRETURN(arg_info) == 0){
			INFO_FUNTYPE(arg_info) = T_unknown;
		}
		if(FUNDEF_TYPE(arg_node) != INFO_FUNTYPE(arg_info) && FUNDEF_EXTERN(arg_node) == FALSE){
			CTIerrorLine(NODE_LINE(arg_node), "Return type does not match function type fun: %d ret:  %d", FUNDEF_TYPE(arg_node), INFO_TYPE(arg_info));
		}
		DBUG_RETURN(arg_node);
	}