#include "aop-pointcut.h"
#include "aop-type.h"
-/**
- * \defgroup all_pc Functions for All Pointcuts
- * \{
- */
-
/* Allocates a pointcut and initializes it with default values. */
struct aop_pointcut *
create_pointcut (enum aop_pckind kind)
return param;
}
+bool
+check_in_param (struct aop_param_desc *param_desc)
+{
+ tree param_type;
+ tree param_decl;
+ int index = 0;
+ bool index_found = false;
+ for (param_decl = DECL_ARGUMENTS (current_function_decl);
+ param_decl; param_decl = TREE_CHAIN (param_decl))
+ {
+ if (index == param_desc->param_index)
+ {
+ /* Index found check the type */
+ if ((param_type = TREE_TYPE (param_decl)) == NULL
+ || !does_type_match (param_type, param_desc->type))
+ index_found = false;
+ else
+ index_found = true;
+
+ break;
+ }
+ index++;
+ }
+ return index_found;
+}
+
+bool
+check_in_params (struct aop_pointcut *pc)
+{
+ struct aop_param_desc *param_desc;
+
+ /* Check parameter types. */
+ for (param_desc = pc->in_param_list_head ; param_desc != NULL ;
+ param_desc = param_desc->next)
+ {
+ if(!check_in_param (param_desc))
+ return false;
+ }
+
+ return true;
+}
+
+/**
+ * \defgroup all_pc Functions for All Pointcuts
+ * \{
+ */
+
/**
* Get a dynval representing the nth parameter passed to the current
* fuction. Be careful not to capture the <code>in_param</code> of
return dv;
}
-bool
-check_in_param (struct aop_param_desc *param_desc)
-{
- tree param_type;
- tree param_decl;
- int index = 0;
- bool index_found = false;
- for (param_decl = DECL_ARGUMENTS (current_function_decl);
- param_decl; param_decl = TREE_CHAIN (param_decl))
- {
- if (index == param_desc->param_index)
- {
- /* Index found check the type */
- if ((param_type = TREE_TYPE (param_decl)) == NULL
- || !does_type_match (param_type, param_desc->type))
- index_found = false;
- else
- index_found = true;
-
- break;
- }
- index++;
- }
- return index_found;
-}
-
-bool
-check_in_params (struct aop_pointcut *pc)
-{
- struct aop_param_desc *param_desc;
-
- /* Check parameter types. */
- for (param_desc = pc->in_param_list_head ; param_desc != NULL ;
- param_desc = param_desc->next)
- {
- if(!check_in_param (param_desc))
- return false;
- }
-
- return true;
-}
-
/**
* Filter a pointcut (of any type) to only include join points within
* functions that take an nth parameter matching the specified type.