New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add post-switches
to config file sections
#2281
Conversation
7d039e2
to
984bb93
Compare
For switches to be appended after the user switches (or right before the first `-run` switch). The sections inherit it (as well as `switches`) from the `default` section if it isn't overridden explicitly. Fixes issue ldc-developers#2186.
It'd be very nice to get this into 1.4. Without it, it is a lot more work to use LTO/sanitizer builds of the standard library. |
Sure thing, but as there was no feedback, I didn't want to postpone beta1 further. |
Oh and wrt. the tests - as all config files use it, it's tested everywhere, at least that both sets of switches are used (and that the |
I'm working on the tests. |
(pfiew, ok, the git pushing worked) |
// CHECK-SAME: -post-two-switch | ||
|
||
|
||
// RUN: not %ldc -I=%runtimedir/src -conf=%S/inputs/post_switches.conf -v -L-user-passed-switch -run %s -L-after-run | FileCheck %s --check-prefix=WITHrUN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the WITHrUN
is not a typo btw. Lit confuses WITHRUN:
lines for RUN:
lines.
Is this good to merge? |
// append 'post-switches', but before a first potential '-run' | ||
size_t runIndex = 0; | ||
for (size_t i = 1; i < args.size(); ++i) { | ||
if (strcmp(args[i], "-run") == 0 || strcmp(args[i], "--run") == 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In an ideal world, this would be args[i] == "-runs"s || args[i] == "--run"s
. (Only made it into C++14, though, I think.)
For switches to be appended after the user switches (or right before the first
-run
switch).The sections inherit it (as well as
switches
) from thedefault
section if it isn't overridden explicitly.Fixes issue #2186.