aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorPer Bothner <per@bothner.com>2004-06-30 11:05:07 -0700
committerPer Bothner <bothner@gcc.gnu.org>2004-06-30 11:05:07 -0700
commit3c20847b8301eb9aa407ee8273b6e738e7067ee0 (patch)
tree3a5eb1a7eff65640bfe8d3933a6c06578d9f38ce /gcc/c-decl.c
parentc166747038bc41ee6702618828e5c915cc4e47ea (diff)
downloadgcc-3c20847b8301eb9aa407ee8273b6e738e7067ee0.zip
gcc-3c20847b8301eb9aa407ee8273b6e738e7067ee0.tar.gz
gcc-3c20847b8301eb9aa407ee8273b6e738e7067ee0.tar.bz2
Conditionally compile support for --enable-mapped_location.
* basic-block.h (struct edge_def): Use new source_locus typedef. * c-common.c (fname_decl): Update save/clear/store of input_location. (c_do_switch_warnings): Update for USE_MAPPED_LOCATION case. * c-decl.c: Likewise. * c-dump.c (dump_stmt): Likewise. * c-gimplify.c (c-gimplify.c): Generalize using SET_EXPR_LOCATION. * c-lex.c (cb_line_change): If USE_MAPPED_LOCATION use token's src_loc to set input_location direction, rather than using linemap_lookup. (fe_file_change, cb_def_pragma): Again use source_location directly. * c-opts.c (saved_lineno): Remove static variable. (c_common_post_options, c_common_init): Don't bothner to save, clear and restore input_Location - now handled by lang_dependent_init. * function.c (init_function_start): Use new DECL_IS_BUILTIN macro. * xcoffout.c (xcoff_assign_fundamental_type_number): Likewise. From-SVN: r83919
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 7a68adb..f5c03f3 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -1114,7 +1114,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
}
}
else if (TREE_CODE (olddecl) == FUNCTION_DECL
- && DECL_SOURCE_LINE (olddecl) == 0)
+ && DECL_IS_BUILTIN (olddecl))
{
/* A conflicting function declaration for a predeclared
function that isn't actually built in. Objective C uses
@@ -1223,7 +1223,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
default. Objective C uses these. See also above.
FIXME: Make Objective C use normal builtins. */
if (TREE_CODE (olddecl) == FUNCTION_DECL
- && DECL_SOURCE_LINE (olddecl) == 0)
+ && DECL_IS_BUILTIN (olddecl))
return false;
else
{
@@ -1671,7 +1671,7 @@ warn_if_shadowing (tree new)
/* Shadow warnings wanted? */
if (!warn_shadow
/* No shadow warnings for internally generated vars. */
- || DECL_SOURCE_LINE (new) == 0
+ || DECL_IS_BUILTIN (new)
/* No shadow warnings for vars made for inlining. */
|| DECL_FROM_INLINE (new)
/* Don't warn about the parm names in function declarator
@@ -1755,7 +1755,7 @@ warn_if_shadowing (tree new)
static void
clone_underlying_type (tree x)
{
- if (DECL_SOURCE_LINE (x) == 0)
+ if (DECL_IS_BUILTIN (x))
{
if (TYPE_NAME (TREE_TYPE (x)) == 0)
TYPE_NAME (TREE_TYPE (x)) = x;
@@ -1963,7 +1963,7 @@ implicitly_declare (tree functionid)
in the external scope because they're pushed before the file
scope gets created. Catch this here and rebind them into the
file scope. */
- if (!DECL_BUILT_IN (decl) && DECL_SOURCE_LINE (decl) == 0)
+ if (!DECL_BUILT_IN (decl) && DECL_IS_BUILTIN (decl))
{
bind (functionid, decl, file_scope);
return decl;
@@ -2290,8 +2290,12 @@ c_init_decl_processing (void)
/* Declarations from c_common_nodes_and_builtins must not be associated
with this input file, lest we get differences between using and not
using preprocessed headers. */
- input_location.file = "<internal>";
+#ifdef USE_MAPPED_LOCATION
+ input_location = BUILTINS_LOCATION;
+#else
+ input_location.file = "<built-in>";
input_location.line = 0;
+#endif
build_common_tree_nodes (flag_signed_char);