Accumulate all values of -C remark
option
When `-C remark=...` option is specified multiple times, accumulate all values instead of using only the last one.
This commit is contained in:
parent
9981e56d3b
commit
e74e39a699
@ -833,6 +833,13 @@ impl Passes {
|
|||||||
Passes::All => false,
|
Passes::All => false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn extend(&mut self, passes: impl IntoIterator<Item = String>) {
|
||||||
|
match *self {
|
||||||
|
Passes::Some(ref mut v) => v.extend(passes),
|
||||||
|
Passes::All => {}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const fn default_lib_output() -> CrateType {
|
pub const fn default_lib_output() -> CrateType {
|
||||||
|
@ -567,7 +567,7 @@ mod parse {
|
|||||||
v => {
|
v => {
|
||||||
let mut passes = vec![];
|
let mut passes = vec![];
|
||||||
if parse_list(&mut passes, v) {
|
if parse_list(&mut passes, v) {
|
||||||
*slot = Passes::Some(passes);
|
slot.extend(passes);
|
||||||
true
|
true
|
||||||
} else {
|
} else {
|
||||||
false
|
false
|
||||||
|
@ -1,10 +1,19 @@
|
|||||||
// build-pass
|
// build-pass
|
||||||
// ignore-pass
|
// ignore-pass
|
||||||
// no-system-llvm
|
// no-system-llvm
|
||||||
// revisions: all inline
|
// revisions: all inline merge1 merge2
|
||||||
// compile-flags: --crate-type=lib -Cdebuginfo=1 -Copt-level=2
|
// compile-flags: --crate-type=lib -Cdebuginfo=1 -Copt-level=2
|
||||||
|
//
|
||||||
|
// Check that remarks can be enabled individually or with "all":
|
||||||
|
//
|
||||||
// [all] compile-flags: -Cremark=all
|
// [all] compile-flags: -Cremark=all
|
||||||
// [inline] compile-flags: -Cremark=inline
|
// [inline] compile-flags: -Cremark=inline
|
||||||
|
//
|
||||||
|
// Check that values of -Cremark flag are accumulated:
|
||||||
|
//
|
||||||
|
// [merge1] compile-flags: -Cremark=all -Cremark=giraffe
|
||||||
|
// [merge2] compile-flags: -Cremark=inline -Cremark=giraffe
|
||||||
|
//
|
||||||
// error-pattern: inline: f not inlined into g
|
// error-pattern: inline: f not inlined into g
|
||||||
// dont-check-compiler-stderr
|
// dont-check-compiler-stderr
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user