aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorZack Weinberg <zack@gcc.gnu.org>2004-07-05 18:12:47 +0000
committerZack Weinberg <zack@gcc.gnu.org>2004-07-05 18:12:47 +0000
commitc31b8e1b17c56b489399c674ed242c657dd8bf62 (patch)
tree8cc207ca91278cefb1806c30086cba43c421cadc /gcc/cp
parent5dbf8812f12761e10ca9b81be80f27c3ec256873 (diff)
downloadgcc-c31b8e1b17c56b489399c674ed242c657dd8bf62.zip
gcc-c31b8e1b17c56b489399c674ed242c657dd8bf62.tar.gz
gcc-c31b8e1b17c56b489399c674ed242c657dd8bf62.tar.bz2
tree-mudflap.c: Include cgraph.h.
gcc: * tree-mudflap.c: Include cgraph.h. (mf_init_extern_trees): Rename to mudflap_init. Export. Rewrite to create synthetic declarations instead of looking up declarations from mf-runtime.h. (mf_make_builtin, mf_make_cache_struct_type): New functions. (mf_cache_shift_decl, mf_cache_mask_decl, mf_unregister_fndecl): Correct commentary. (execute_mudflap_function_decls, mudflap_register_call): Don't call mf_init_extern_trees. (mudflap_finish_file): Use cgraph_build_static_cdtor. * tree-mudflap.h: Update prototypes. * c-mudflap.c: Delete file. * c-common.c: Include tree-mudflap.h. (c_common_nodes_and_builtins): Call mudflap_init if appropriate. * Makefile.in: Remove all references to c-mudflap.o. Update dependencies. gcc/cp: * cp-mudflap.c: Delete file. * Makefile.in: Remove all references to cp-mudflap.o. libmudflap: * mf-runtime.h.in: Wrap declarations of struct __mf_cache, __mf_lookup_cache, __mf_lc_mask, or __mf_lc_shift in #ifndef _MUDFLAP. From-SVN: r84126
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/Make-lang.in4
-rw-r--r--gcc/cp/cp-mudflap.c107
3 files changed, 6 insertions, 110 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 77aaf45..7a8aebb 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,10 @@
2004-07-05 Zack Weinberg <zack@codesourcery.com>
+ * cp-mudflap.c: Delete file.
+ * Makefile.in: Remove all references to cp-mudflap.o.
+
+2004-07-05 Zack Weinberg <zack@codesourcery.com>
+
* decl.c (cxx_init_decl_processing): Call
build_common_tree_nodes before creating the global NAMESPACE_DECL.
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index 34fb529..f860987 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -82,7 +82,7 @@ CXX_OBJS = cp/call.o cp/decl.o cp/expr.o cp/pt.o cp/typeck2.o \
cp/typeck.o cp/cvt.o cp/except.o cp/friend.o cp/init.o cp/method.o \
cp/search.o cp/semantics.o cp/tree.o cp/repo.o cp/dump.o cp/optimize.o \
cp/mangle.o cp/cp-lang.o cp/name-lookup.o cp/cxx-pretty-print.o \
- cp/cp-gimplify.o tree-mudflap.o cp/cp-mudflap.o
+ cp/cp-gimplify.o tree-mudflap.o
# Use strict warnings for this front end.
cp-warn = $(STRICT_WARN) $(WERROR)
@@ -267,8 +267,6 @@ cp/parser.o: cp/parser.c $(CXX_TREE_H) $(TM_H) diagnostic.h gt-cp-parser.h \
output.h
cp/cp-gimplify.o: cp/cp-gimplify.c $(CXX_TREE_H) toplev.h c-common.h \
$(TM_H) coretypes.h
-cp/cp-mudflap.o: cp/cp-mudflap.c $(CXX_TREE_H) toplev.h c-common.h \
- $(TM_H) coretypes.h
cp/name-lookup.o: cp/name-lookup.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(CXX_TREE_H) timevar.h gt-cp-name-lookup.h toplev.h \
diff --git a/gcc/cp/cp-mudflap.c b/gcc/cp/cp-mudflap.c
deleted file mode 100644
index a9703a7..0000000
--- a/gcc/cp/cp-mudflap.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/* Mudflap: narrow-pointer bounds-checking by tree rewriting:
- C++ front-end interface.
-
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
- Contributed by Frank Ch. Eigler <fche@redhat.com>
- and Graydon Hoare <graydon@redhat.com>
-
-This file is part of GCC.
-
-GCC 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 2, or (at your option) any later
-version.
-
-GCC 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 GCC; see the file COPYING. If not, write to the Free
-Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
-
-
-#include "config.h"
-#include "errors.h"
-#include "system.h"
-#include "coretypes.h"
-#include "tm.h"
-#include "tree.h"
-#include "tree-inline.h"
-#include "cp-tree.h"
-#include "c-common.h"
-#include "diagnostic.h"
-#include "output.h"
-#include "varray.h"
-#include "tree-mudflap.h"
-#include "target.h"
-#include "flags.h"
-#include "rtl.h"
-#include "toplev.h"
-
-
-/* Initialize the global tree nodes that correspond to mf-runtime.h
- declarations. */
-tree
-mflang_lookup_decl (const char* name)
-{
- tree decl = lookup_name (get_identifier (name), 1);
- if (decl == NULL_TREE)
- internal_error ("mudflap: cannot find declaration of `%s' from mf-runtime.h",
- name);
-
- return decl;
-}
-
-
-/* Emit a synthetic CTOR function for the current file. Populate it from
- the enqueued __mf_register calls. Register it with the constructors. */
-
-void
-mflang_flush_calls (tree enqueued_call_stmt_chain)
-{
- tree fnname, fndecl, body;
- tree type;
-
- /* Short-circuit! */
- if (enqueued_call_stmt_chain == NULL_TREE)
- return;
-
- /* Create a ctor function declaration. */
- fnname = get_identifier ("__static_initialization_and_destruction_mudflap");
- type = build_function_type (void_type_node, void_list_node);
- fndecl = build_lang_decl (FUNCTION_DECL, fnname, type);
-
- TREE_PUBLIC (fndecl) = 0;
- TREE_USED (fndecl) = 1;
- DECL_ARTIFICIAL (fndecl) = 1;
- mf_mark (fndecl);
-
- /* Generate the body, one statement at a time. */
- start_preparsed_function (fndecl, /*attrs=*/NULL_TREE, SF_PRE_PARSED);
- body = begin_compound_stmt (BCS_FN_BODY);
-
- while (enqueued_call_stmt_chain)
- {
- tree next = TREE_CHAIN (enqueued_call_stmt_chain);
- finish_expr_stmt (enqueued_call_stmt_chain);
- enqueued_call_stmt_chain = next;
- }
-
- finish_compound_stmt (body);
- fndecl = finish_function (0);
-
- /* NB: We cannot call expand_or_defer_fn here, since that goes through
- the callgraph queue. This queue will have already been processed by the
- time this function is running. */
- expand_body (fndecl);
- if (targetm.have_ctors_dtors)
- (* targetm.asm_out.constructor) (XEXP (DECL_RTL (fndecl), 0),
- DEFAULT_INIT_PRIORITY);
- else
- /* By this time, it's too late to do this:
- static_ctors = tree_cons (NULL_TREE, fndecl, static_ctors); */
- abort ();
-}