From ad4c44d20ece1fbfb9aced1fbcdab8928d702c73 Mon Sep 17 00:00:00 2001 From: Iain Buclaw Date: Tue, 28 Jun 2022 18:49:27 +0200 Subject: d: Use create_tmp_var_raw and get_callee_fndecl A couple of small patterns that repeat are generating a temporary, and getting a function out of a CALL_EXPR. There are convenience functions for these in the common parts of gcc, use them instead. gcc/d/ChangeLog: * d-codegen.cc: Include gimple-expr.h. (force_target_expr): Use create_tmp_var_raw. * decl.cc: Inlucde gimple-expr.h. (build_local_temp): Use create_tmp_var_raw. * intrinsics.cc (expand_intrinsic_rotate): Use get_callee_fndecl. (maybe_expand_intrinsic): Likewise. --- gcc/d/decl.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'gcc/d/decl.cc') diff --git a/gcc/d/decl.cc b/gcc/d/decl.cc index 5032ae0..3caa465 100644 --- a/gcc/d/decl.cc +++ b/gcc/d/decl.cc @@ -57,6 +57,7 @@ along with GCC; see the file COPYING3. If not see #include "alloc-pool.h" #include "symbol-summary.h" #include "symtab-thunks.h" +#include "gimple-expr.h" #include "d-tree.h" #include "d-target.h" @@ -1465,11 +1466,7 @@ declare_local_var (VarDeclaration *var) tree build_local_temp (tree type) { - tree decl = build_decl (input_location, VAR_DECL, NULL_TREE, type); - - DECL_CONTEXT (decl) = current_function_decl; - DECL_ARTIFICIAL (decl) = 1; - DECL_IGNORED_P (decl) = 1; + tree decl = create_tmp_var_raw (type); d_pushdecl (decl); return decl; -- cgit v1.1