aboutsummaryrefslogtreecommitdiff
path: root/gcc/d/d-codegen.cc
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2022-06-28 18:49:27 +0200
committerIain Buclaw <ibuclaw@gdcproject.org>2022-06-28 19:05:42 +0200
commitad4c44d20ece1fbfb9aced1fbcdab8928d702c73 (patch)
treed2fac615b845ecc11a7901496a66f6d0327fc970 /gcc/d/d-codegen.cc
parent6201277441db4023b833e6d643de8077fe38ed6e (diff)
downloadgcc-ad4c44d20ece1fbfb9aced1fbcdab8928d702c73.zip
gcc-ad4c44d20ece1fbfb9aced1fbcdab8928d702c73.tar.gz
gcc-ad4c44d20ece1fbfb9aced1fbcdab8928d702c73.tar.bz2
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.
Diffstat (limited to 'gcc/d/d-codegen.cc')
-rw-r--r--gcc/d/d-codegen.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/gcc/d/d-codegen.cc b/gcc/d/d-codegen.cc
index 8a8bf12..2d90899 100644
--- a/gcc/d/d-codegen.cc
+++ b/gcc/d/d-codegen.cc
@@ -38,6 +38,7 @@ along with GCC; see the file COPYING3. If not see
#include "stor-layout.h"
#include "attribs.h"
#include "function.h"
+#include "gimple-expr.h"
#include "d-tree.h"
@@ -623,11 +624,8 @@ build_target_expr (tree decl, tree exp)
tree
force_target_expr (tree exp)
{
- tree decl = build_decl (input_location, VAR_DECL, NULL_TREE,
- TREE_TYPE (exp));
+ tree decl = create_tmp_var_raw (TREE_TYPE (exp));
DECL_CONTEXT (decl) = current_function_decl;
- DECL_ARTIFICIAL (decl) = 1;
- DECL_IGNORED_P (decl) = 1;
layout_decl (decl, 0);
return build_target_expr (decl, exp);