diff options
author | Iain Buclaw <ibuclaw@gdcproject.org> | 2020-06-16 10:11:07 +0200 |
---|---|---|
committer | Iain Buclaw <ibuclaw@gdcproject.org> | 2020-06-16 23:35:34 +0200 |
commit | f267a3109884c6b623b72f20cbc208561efaf5ff (patch) | |
tree | 855ddae45ab983915bafb49f5d4a5183a2f7c1c0 /gcc/d/d-lang.cc | |
parent | e40b11a91cb345db1324c3cb8f75b01e28056693 (diff) | |
download | gcc-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/d-lang.cc')
-rw-r--r-- | gcc/d/d-lang.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/d/d-lang.cc b/gcc/d/d-lang.cc index 5266a65..085d839 100644 --- a/gcc/d/d-lang.cc +++ b/gcc/d/d-lang.cc @@ -285,6 +285,7 @@ d_init_options (unsigned int, cl_decoded_option *decoded_options) global.params.useOut = CHECKENABLEdefault; global.params.useArrayBounds = CHECKENABLEdefault; global.params.useSwitchError = CHECKENABLEdefault; + global.params.checkAction = CHECKACTION_D; global.params.useModuleInfo = true; global.params.useTypeInfo = true; global.params.useExceptions = true; @@ -775,7 +776,7 @@ d_post_options (const char ** fn) if (!global_options_set.x_flag_exceptions) global.params.useExceptions = false; - global.params.checkAction = CHECKACTION_halt; + global.params.checkAction = CHECKACTION_C; } /* Keep in sync with existing -fbounds-check flag. */ |