]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/cp/cp-gimplify.c
Come up with fndecl_built_in_p.
[thirdparty/gcc.git] / gcc / cp / cp-gimplify.c
index f61099141026b793daab149f989ca2b14d265d48..90a8f9fef8f2398af46e7572c93480a97515e819 100644 (file)
@@ -797,9 +797,8 @@ cp_gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
        {
          tree decl = cp_get_callee_fndecl_nofold (*expr_p);
          if (decl
-             && DECL_BUILT_IN_CLASS (decl) == BUILT_IN_FRONTEND
-             && ((int) DECL_FUNCTION_CODE (decl)
-                 == CP_BUILT_IN_IS_CONSTANT_EVALUATED))
+             && fndecl_built_in_p (decl, CP_BUILT_IN_IS_CONSTANT_EVALUATED,
+                                 BUILT_IN_FRONTEND))
            *expr_p = boolean_false_node;
        }
       break;
@@ -2489,7 +2488,7 @@ cp_fold (tree x)
        /* Some built-in function calls will be evaluated at compile-time in
           fold ().  Set optimize to 1 when folding __builtin_constant_p inside
           a constexpr function so that fold_builtin_1 doesn't fold it to 0.  */
-       if (callee && DECL_BUILT_IN (callee) && !optimize
+       if (callee && fndecl_built_in_p (callee) && !optimize
            && DECL_IS_BUILTIN_CONSTANT_P (callee)
            && current_function_decl
            && DECL_DECLARED_CONSTEXPR_P (current_function_decl))
@@ -2497,9 +2496,8 @@ cp_fold (tree x)
 
        /* Defer folding __builtin_is_constant_evaluated.  */
        if (callee
-           && DECL_BUILT_IN_CLASS (callee) == BUILT_IN_FRONTEND
-           && ((int) DECL_FUNCTION_CODE (callee)
-               == CP_BUILT_IN_IS_CONSTANT_EVALUATED))
+           && fndecl_built_in_p (callee, CP_BUILT_IN_IS_CONSTANT_EVALUATED,
+                               BUILT_IN_FRONTEND))
          break;
 
        x = copy_node (x);