diff options
author | Owen Avery <powerboat9.gamer@gmail.com> | 2023-05-19 00:05:19 -0400 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2024-01-16 18:37:22 +0100 |
commit | fc281773251e2c565c0fbf3872d240615cae021a (patch) | |
tree | 63be26dc608ba172eabdeff96b9dd823b1b10a9f /gcc/rust/rust-session-manager.cc | |
parent | 1b34e40e5e41bdcb227b40523cd3a64c6f2fde00 (diff) | |
download | gcc-fc281773251e2c565c0fbf3872d240615cae021a.zip gcc-fc281773251e2c565c0fbf3872d240615cae021a.tar.gz gcc-fc281773251e2c565c0fbf3872d240615cae021a.tar.bz2 |
gccrs: Make key and key/value config options seperate
gcc/rust/ChangeLog:
* rust-session-manager.h:
Include "rust-optional.h".
(struct TargetOptions):
Store values in config key/value pairs as Optional<std::string> rather than std::string.
* rust-session-manager.cc
(TargetOptions::dump_target_options):
Handle Optional<std::string> values.
gcc/testsuite/ChangeLog:
* rust/compile/cfg6.rs: New test.
Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
Diffstat (limited to 'gcc/rust/rust-session-manager.cc')
-rw-r--r-- | gcc/rust/rust-session-manager.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/rust/rust-session-manager.cc b/gcc/rust/rust-session-manager.cc index 860abab..c7bbe89 100644 --- a/gcc/rust/rust-session-manager.cc +++ b/gcc/rust/rust-session-manager.cc @@ -1090,10 +1090,12 @@ TargetOptions::dump_target_options () const for (const auto &pairs : features) { for (const auto &value : pairs.second) - out << pairs.first + ": \"" + value + "\"\n"; - - if (pairs.second.empty ()) - out << pairs.first + "\n"; + { + if (value.is_some ()) + out << pairs.first + ": \"" + value.get () + "\"\n"; + else + out << pairs.first + "\n"; + } } out.close (); |