diff options
author | Iain Buclaw <ibuclaw@gdcproject.org> | 2020-06-05 23:09:23 +0200 |
---|---|---|
committer | Iain Buclaw <ibuclaw@gdcproject.org> | 2020-06-05 23:14:21 +0200 |
commit | 5bc13e5217f687f5d08a7022b4c6081befc54402 (patch) | |
tree | 52fa54f86591105fac8fef597ae9fcf0de626cf3 /gcc/d/d-lang.cc | |
parent | 3a73a6adb605df1462be176442851b5a37839fc0 (diff) | |
download | gcc-5bc13e5217f687f5d08a7022b4c6081befc54402.zip gcc-5bc13e5217f687f5d08a7022b4c6081befc54402.tar.gz gcc-5bc13e5217f687f5d08a7022b4c6081befc54402.tar.bz2 |
d: Merge upstream dmd 740f3d1ea.
Backports the conversion of the parameter fields debugids and versionids
to Identifiers. The idea is that Identifiers should be used instead of
C strings where ever possible.
gcc/d/ChangeLog:
* dmd/MERGE: Merge upstream dmd 740f3d1ea.
* d-lang.cc (d_handle_option): Use new fields to save debug and
version levels passed over command-line.
(d_post_options): Add them to front-end here.
Diffstat (limited to 'gcc/d/d-lang.cc')
-rw-r--r-- | gcc/d/d-lang.cc | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/gcc/d/d-lang.cc b/gcc/d/d-lang.cc index 203039e..54d5799 100644 --- a/gcc/d/d-lang.cc +++ b/gcc/d/d-lang.cc @@ -443,14 +443,16 @@ d_handle_option (size_t scode, const char *arg, HOST_WIDE_INT value, int level = integral_argument (arg); if (level != -1) { - DebugCondition::setGlobalLevel (level); + global.params.debuglevel = level; break; } } if (Identifier::isValidIdentifier (CONST_CAST (char *, arg))) { - DebugCondition::addGlobalIdent (arg); + if (!global.params.debugids) + global.params.debugids = new Strings (); + global.params.debugids->push (arg); break; } @@ -582,14 +584,16 @@ d_handle_option (size_t scode, const char *arg, HOST_WIDE_INT value, int level = integral_argument (arg); if (level != -1) { - VersionCondition::setGlobalLevel (level); + global.params.versionlevel = level; break; } } if (Identifier::isValidIdentifier (CONST_CAST (char *, arg))) { - VersionCondition::addGlobalIdent (arg); + if (!global.params.versionids) + global.params.versionids = new Strings (); + global.params.versionids->push (arg); break; } @@ -812,6 +816,25 @@ d_post_options (const char ** fn) /* Has no effect yet. */ global.params.pic = flag_pic != 0; + /* Add in versions given on the command line. */ + if (global.params.versionids) + { + for (size_t i = 0; i < global.params.versionids->length; i++) + { + const char *s = (*global.params.versionids)[i]; + VersionCondition::addGlobalIdent (s); + } + } + + if (global.params.debugids) + { + for (size_t i = 0; i < global.params.debugids->length; i++) + { + const char *s = (*global.params.debugids)[i]; + DebugCondition::addGlobalIdent (s); + } + } + if (warn_return_type == -1) warn_return_type = 0; |