lib_LTLIBRARIES = libinteraspect.la
-libinteraspect_la_SOURCES = aop-pc-assign.c aop-main.c aop-type.c aop-weave.c aop-pc-entry.c aop-pc-exit.c aop-pc-fun-call.c
+libinteraspect_la_SOURCES = aop-pc-assign.c aop-main.c aop-type.c aop-weave.c aop-pc-entry.c aop-pc-exit.c aop-pc-fun-call.c aop-pointcut.c
libinteraspect_la_CFLAGS = -Wall -Werror -fvisibility=hidden -prefer-pic
libinteraspect_la_LDFLAGS = -static -prefer-pic -version-info 1:0:0
libinteraspect_la_CPPFLAGS = -DHAVE_CONFIG_H -DIN_GCC -I$(gcc_includes)
{
struct aop_pointcut *pc;
- pc = ggc_alloc (sizeof (struct aop_pointcut));
- pc->kind = ATP_ASSIGN;
+ pc = create_pointcut (ATP_ASSIGN);
+
pc->join_on = op_join_on_assign;
- pc->insert_before = op_default_insert_before;
- pc->insert_after = op_default_insert_after;
pc->prepare_for_weave = op_prepare_assign;
pc->pc_assign.type = type;
pc->pc_assign.include_temp_vars = false;
- pc->need_regimplification = false;
return pc;
}
aop_match_function_entry ()
{
struct aop_pointcut *pc;
- pc = ggc_alloc (sizeof (struct aop_pointcut));
- pc->kind = ATP_ENTRY;
- pc->need_regimplification = false;
+ pc = create_pointcut (ATP_ENTRY);
pc->join_on = op_join_on_function_entry;
- pc->insert_before = op_default_insert_before;
- pc->insert_after = op_default_insert_after;
pc->prepare_for_weave = op_prepare_entry;
pc->pc_entry.function_name = NULL;
aop_match_function_exit ()
{
struct aop_pointcut *pc;
- pc = ggc_alloc (sizeof (struct aop_pointcut));
- pc->kind = ATP_EXIT;
- pc->need_regimplification = false;
+ pc = create_pointcut (ATP_EXIT);
pc->join_on = op_join_on_function_exit;
- pc->insert_before = op_default_insert_before;
- pc->insert_after = op_default_insert_after;
pc->prepare_for_weave = op_prepare_exit;
return pc;
{
struct aop_pointcut *pc;
- pc = ggc_alloc (sizeof (struct aop_pointcut));
- pc->kind = ATP_CALL;
- pc->need_regimplification = false;
+ pc = create_pointcut (ATP_CALL);
pc->join_on = op_join_on_function_call;
- pc->insert_after = op_default_insert_after;
- pc->insert_before = op_default_insert_before;
- pc->prepare_for_weave = op_default_prepare_for_weave;
pc->pc_call.function_name = NULL;
pc->pc_call.return_type = NULL;
--- /dev/null
+/* This program is free software: you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+/* Whether we want them or not (we don't), Autoconf _insists_ on
+ defining these. Since GCC's config.h (which we must include) also
+ defines them, we have to undef them here. */
+#undef PACKAGE_BUGREPORT
+#undef PACKAGE_NAME
+#undef PACKAGE_STRING
+#undef PACKAGE_TARNAME
+#undef PACKAGE_VERSION
+
+#include <locale.h>
+
+#include <config.h>
+#include <system.h>
+#include <coretypes.h>
+#include <tm.h>
+#include <ggc.h>
+#include <gimple.h>
+
+#include "aop.h"
+#include "aop-pointcut.h"
+
+/*
+ * Creates a generic pointcut
+ * \return The default pointcut.
+ */
+struct aop_pointcut *
+create_pointcut (enum aop_pckind kind)
+{
+ struct aop_pointcut *pc;
+
+ pc = ggc_alloc (sizeof (struct aop_pointcut));
+
+ pc->need_regimplification = false;
+ pc->kind = kind;
+
+ pc->insert_before = op_default_insert_before;
+ pc->insert_after = op_default_insert_after;
+ pc->prepare_for_weave = op_default_prepare_for_weave;
+
+ return pc;
+}
bool is_prepared;
};
+struct aop_pointcut *create_pointcut (enum aop_pckind kind);
+
void op_default_prepare_for_weave (struct aop_joinpoint *jp);
void op_default_insert_before (struct aop_joinpoint *jp, gimple stmt);
void op_default_insert_after (struct aop_joinpoint *jp, gimple stmt);