Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 27 additions & 3 deletions src/compiler/clang.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ counted_array!(pub static ARGS: [ArgInfo<gcc::ArgData>; _] = [
take_arg!("-fsanitize-system-ignorelist", PathBuf, Concatenated(b'='), ExtraHashFile),
take_arg!("-fsave-optimization-record", OsString, Concatenated(b'='), TooHard),
take_arg!("-fthin-link-bitcode", OsString, Concatenated(b'='), TooHard),
take_arg!("-ftime-trace", OsString, Concatenated(b'='), TooHard),
// The trace is a side file that doesn't affect the object; a cache hit just produces no trace.
take_arg!("-ftime-trace", OsString, Concatenated(b'='), PassThrough),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nvcc's -fdevice-time-trace is still TooHard, same reasoning applies, no?
could be done in a follow-up

flag!("-fuse-ctor-homing", PassThroughFlag),
take_arg!("-fxray-always-instrument", PathBuf, Concatenated(b'='), ExtraHashFile),
take_arg!("-fxray-attr-list", PathBuf, Concatenated(b'='), ExtraHashFile),
Expand Down Expand Up @@ -790,6 +791,31 @@ mod test {
}
}

#[test]
fn test_parse_arguments_time_trace() {
for flag in [
"-ftime-trace",
"-ftime-trace=trace.json",
"-ftime-trace-granularity=50",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these two weren't impacted by #2834, were they? fine to keep them, just checking

"-ftime-trace-verbose",
] {
let a = parses!("-c", "foo.c", "-o", "foo.o", flag);
assert_eq!(ovec![flag], a.common_args, "{flag}");
assert!(a.preprocessor_args.is_empty(), "{flag}");
assert_eq!(1, a.outputs.len(), "{flag}");
assert_map_contains!(
a.outputs,
(
"obj",
ArtifactDescriptor {
path: PathBuf::from("foo.o"),
optional: false
}
)
);
}
}

#[test]
fn test_parse_arguments_integrated_as() {
assert!(!parses!("-c", "foo.c", "-o", "foo.o").uses_external_assembler);
Expand Down Expand Up @@ -1316,8 +1342,6 @@ mod test {
),
(&["-fthin-link-bitcode"], "-fthin-link-bitcode"),
(&["-fthin-link-bitcode=foo.bc"], "-fthin-link-bitcode"),
(&["-ftime-trace"], "-ftime-trace"),
(&["-ftime-trace=trace.json"], "-ftime-trace"),
(
&["-module-dependency-dir", "/tmp/moddeps"],
"-module-dependency-dir",
Expand Down
Loading