diff options
author | Iain Buclaw <ibuclaw@gdcproject.org> | 2020-06-05 19:27:29 +0200 |
---|---|---|
committer | Iain Buclaw <ibuclaw@gdcproject.org> | 2020-06-05 20:13:50 +0200 |
commit | 0cdc55f5ed881436c49d313b6cead244bdcf0654 (patch) | |
tree | f3ac3c20cabb0912a167dd0aecc8c034b2194fea /gcc/d/expr.cc | |
parent | 5094c4400a8687dcf44f5993aee3a88e98519f3b (diff) | |
download | gcc-0cdc55f5ed881436c49d313b6cead244bdcf0654.zip gcc-0cdc55f5ed881436c49d313b6cead244bdcf0654.tar.gz gcc-0cdc55f5ed881436c49d313b6cead244bdcf0654.tar.bz2 |
d: Merge upstream dmd f5638c7b8.
Adds a CHECKENABLE enum, uses it for all contract parameters for
consistency in state checking.
gcc/d/ChangeLog:
* dmd/MERGE: Merge upstream dmd f5638c7b8.
* d-builtins.cc (d_init_versions): Use new CHECKENABLE enum.
* d-codegen.cc (array_bounds_check): Likewise.
(build_frame_type): Likewise.
(get_frameinfo): Likewise.
* d-lang.cc (d_init_options): Likewise.
(d_init_options_struct): Don't initialize x_flag_bounds_check.
(d_handle_option): Use new CHECKENABLE enum.
(d_post_options): Likewise. Set flag_bounds_check here.
* expr.cc (ExprVisitor::visit(AssertExp *)): Use new CHECKENABLE enum.
Diffstat (limited to 'gcc/d/expr.cc')
-rw-r--r-- | gcc/d/expr.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/d/expr.cc b/gcc/d/expr.cc index 461124f..562e35a 100644 --- a/gcc/d/expr.cc +++ b/gcc/d/expr.cc @@ -1980,7 +1980,7 @@ public: tree assert_pass = void_node; tree assert_fail; - if (global.params.useAssert + if (global.params.useAssert == CHECKENABLEon && global.params.checkAction == CHECKACTION_D) { /* Generate: ((bool) e1 ? (void)0 : _d_assert (...)) @@ -1999,7 +1999,7 @@ public: /* Build a call to _d_assert(). */ assert_fail = d_assert_call (e->loc, libcall, tmsg); - if (global.params.useInvariants) + if (global.params.useInvariants == CHECKENABLEon) { /* If the condition is a D class or struct object with an invariant, call it if the condition result is true. */ @@ -2025,7 +2025,7 @@ public: } } } - else if (global.params.useAssert + else if (global.params.useAssert == CHECKENABLEon && global.params.checkAction == CHECKACTION_C) { /* Generate: __builtin_trap() */ |