diff options
Diffstat (limited to 'gcc/c')
-rw-r--r-- | gcc/c/c-decl.c | 14 | ||||
-rw-r--r-- | gcc/c/c-typeck.c | 10 |
2 files changed, 13 insertions, 11 deletions
diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c index d4179aa..f19c82c 100644 --- a/gcc/c/c-decl.c +++ b/gcc/c/c-decl.c @@ -2051,7 +2051,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl, } } else if (TREE_CODE (olddecl) == FUNCTION_DECL - && DECL_IS_BUILTIN (olddecl)) + && DECL_IS_UNDECLARED_BUILTIN (olddecl)) { /* A conflicting function declaration for a predeclared function that isn't actually built in. Objective C uses @@ -2265,7 +2265,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl, built in, newdecl silently overrides olddecl. The latter occur only in Objective C; see also above. (FIXME: Make Objective C use normal builtins.) */ - if (!DECL_IS_BUILTIN (olddecl) + if (!DECL_IS_UNDECLARED_BUILTIN (olddecl) && !DECL_EXTERN_INLINE (olddecl)) { auto_diagnostic_group d; @@ -2978,7 +2978,7 @@ warn_if_shadowing (tree new_decl) || warn_shadow_local || warn_shadow_compatible_local) /* No shadow warnings for internally generated vars. */ - || DECL_IS_BUILTIN (new_decl)) + || DECL_IS_UNDECLARED_BUILTIN (new_decl)) return; /* Is anything being shadowed? Invisible decls do not count. */ @@ -3631,7 +3631,7 @@ implicitly_declare (location_t loc, 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 (!fndecl_built_in_p (decl) && DECL_IS_BUILTIN (decl)) + if (!fndecl_built_in_p (decl) && DECL_IS_UNDECLARED_BUILTIN (decl)) { bind (functionid, decl, file_scope, /*invisible=*/false, /*nested=*/true, @@ -10500,7 +10500,7 @@ names_builtin_p (const char *name) { tree id = get_identifier (name); if (tree decl = identifier_global_value (id)) - return TREE_CODE (decl) == FUNCTION_DECL && DECL_IS_BUILTIN (decl); + return TREE_CODE (decl) == FUNCTION_DECL && DECL_IS_UNDECLARED_BUILTIN (decl); /* Also detect common reserved C words that aren't strictly built-in functions. */ @@ -12134,12 +12134,12 @@ collect_source_refs (void) { decls = DECL_INITIAL (t); for (decl = BLOCK_VARS (decls); decl; decl = TREE_CHAIN (decl)) - if (!DECL_IS_BUILTIN (decl)) + if (!DECL_IS_UNDECLARED_BUILTIN (decl)) collect_source_ref (DECL_SOURCE_FILE (decl)); } for (decl = BLOCK_VARS (ext_block); decl; decl = TREE_CHAIN (decl)) - if (!DECL_IS_BUILTIN (decl)) + if (!DECL_IS_UNDECLARED_BUILTIN (decl)) collect_source_ref (DECL_SOURCE_FILE (decl)); } diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c index 2bf46f4..9684037 100644 --- a/gcc/c/c-typeck.c +++ b/gcc/c/c-typeck.c @@ -3014,7 +3014,8 @@ build_function_call (location_t loc, tree function, tree params) static void inform_declaration (tree decl) { - if (decl && (TREE_CODE (decl) != FUNCTION_DECL || !DECL_IS_BUILTIN (decl))) + if (decl && (TREE_CODE (decl) != FUNCTION_DECL + || !DECL_IS_UNDECLARED_BUILTIN (decl))) inform (DECL_SOURCE_LOCATION (decl), "declared here"); } @@ -6578,7 +6579,7 @@ inform_for_arg (tree fundecl, location_t ploc, int parmnum, tree expected_type, tree actual_type) { location_t loc; - if (fundecl && !DECL_IS_BUILTIN (fundecl)) + if (fundecl && !DECL_IS_UNDECLARED_BUILTIN (fundecl)) loc = get_fndecl_argument_location (fundecl, parmnum - 1); else loc = ploc; @@ -6828,7 +6829,7 @@ convert_for_assignment (location_t location, location_t expr_loc, tree type, if (pedwarn (expr_loc, OPT_Wc___compat, "enum conversion when " "passing argument %d of %qE is invalid in C++", parmnum, rname)) - inform ((fundecl && !DECL_IS_BUILTIN (fundecl)) + inform ((fundecl && !DECL_IS_UNDECLARED_BUILTIN (fundecl)) ? DECL_SOURCE_LOCATION (fundecl) : expr_loc, "expected %qT but argument is of type %qT", type, rhstype); @@ -7239,7 +7240,8 @@ convert_for_assignment (location_t location, location_t expr_loc, tree type, case ic_argpass: /* Do not warn for built-in functions, for example memcpy, since we control how they behave and they can be useful in this area. */ - if (TREE_CODE (rname) != FUNCTION_DECL || !DECL_IS_BUILTIN (rname)) + if (TREE_CODE (rname) != FUNCTION_DECL + || !DECL_IS_UNDECLARED_BUILTIN (rname)) warning_at (location, OPT_Wscalar_storage_order, "passing argument %d of %qE from incompatible " "scalar storage order", parmnum, rname); |