aboutsummaryrefslogtreecommitdiff
path: root/gcc/d/expr.cc
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2020-06-16 10:11:07 +0200
committerIain Buclaw <ibuclaw@gdcproject.org>2020-06-16 23:35:34 +0200
commitf267a3109884c6b623b72f20cbc208561efaf5ff (patch)
tree855ddae45ab983915bafb49f5d4a5183a2f7c1c0 /gcc/d/expr.cc
parente40b11a91cb345db1324c3cb8f75b01e28056693 (diff)
downloadgcc-f267a3109884c6b623b72f20cbc208561efaf5ff.zip
gcc-f267a3109884c6b623b72f20cbc208561efaf5ff.tar.gz
gcc-f267a3109884c6b623b72f20cbc208561efaf5ff.tar.bz2
d: Move generation of array bounds error to own function.
gcc/d/ChangeLog: * d-codegen.cc (build_array_bounds_call): New function. (build_bounds_condition): Use build_array_bounds_call. * d-lang.cc (d_init_options): Explicitly set default check action to CHECKACTION_D. (d_post_options): Set check action to CHECKACTION_C if the flag -fno-druntime was seen. * d-tree.h (build_array_bounds_call): Declare. * expr.cc (ExprVisitor::visit (AssertExp *)): Use build_array_bounds_call.
Diffstat (limited to 'gcc/d/expr.cc')
-rw-r--r--gcc/d/expr.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/gcc/d/expr.cc b/gcc/d/expr.cc
index 06cd83a..bf9bb45 100644
--- a/gcc/d/expr.cc
+++ b/gcc/d/expr.cc
@@ -1218,9 +1218,7 @@ public:
if (!e->indexIsInBounds && array_bounds_check ())
{
- tree tassert = (global.params.checkAction == CHECKACTION_D)
- ? d_assert_call (e->loc, LIBCALL_ARRAY_BOUNDS)
- : build_call_expr (builtin_decl_explicit (BUILT_IN_TRAP), 0);
+ tree tassert = build_array_bounds_call (e->loc);
result = d_save_expr (result);
result = build_condition (TREE_TYPE (result),