Skip to content

Commit e7051d7

Browse files
glandiumsylvestre
authored andcommitted
treat -ivfsoverlay as a preprocessor-only argument
-ivfsoverlay provides a setup file for a virtual filesystem used by the preprocessor/frontend when resolving include paths; it belongs in the same PreprocessorArgumentPath bucket as -isysroot/-include rather than in common_args.
1 parent c47a972 commit e7051d7

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

src/compiler/clang.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ counted_array!(pub static ARGS: [ArgInfo<gcc::ArgData>; _] = [
229229
take_arg!("-gcc-toolchain", OsString, Separated, PassThrough),
230230
flag!("-gcodeview", PassThroughFlag),
231231
take_arg!("-include-pch", PathBuf, CanBeSeparated, PreprocessorArgumentPath),
232+
take_arg!("-ivfsoverlay", PathBuf, CanBeSeparated, PreprocessorArgumentPath),
232233
take_arg!("-load", PathBuf, Separated, ExtraHashFile),
233234
flag!("-mconstructor-aliases", PassThroughFlag),
234235
take_arg!("-mllvm", OsString, Separated, PassThrough),
@@ -655,6 +656,25 @@ mod test {
655656
parses!("-c", "foo.c", "-o", "foo.o", "-Xclang", "-gcodeview");
656657
}
657658

659+
#[test]
660+
fn test_ivfsoverlay() {
661+
let a = parses!(
662+
"-c",
663+
"foo.c",
664+
"-o",
665+
"foo.o",
666+
"-Xclang",
667+
"-ivfsoverlay",
668+
"-Xclang",
669+
"/some/overlay.yaml"
670+
);
671+
assert!(a.common_args.is_empty());
672+
assert_eq!(
673+
ovec!["-Xclang", "-ivfsoverlay", "-Xclang", "/some/overlay.yaml"],
674+
a.preprocessor_args
675+
);
676+
}
677+
658678
#[test]
659679
fn test_emit_pch() {
660680
let a = parses!(

0 commit comments

Comments
 (0)