// Maps the `-fprofile-use` argument to the actual path of the
// .profdata file Clang will try to use.
Maps the `-fprofile-use` argument to the actual path of the
.profdata file Clang will try to use.
Maps the ` - fprofile - use ` argument to the actual path of the . profdata file Clang will try to use .
pub(crate) fn resolve_profile_use_path(arg: &Path, cwd: &Path) -> PathBuf {
    // Note that `arg` might be empty (if no argument was given to
    // -fprofile-use), in which case `path` will be `cwd` after
    // the next statement and "./default.profdata" at the end of the
    // block. This matches Clang's behavior for when no argument is
    // given.
    let mut path = cwd.join(arg);
    assert!(!arg.as_os_str().is_empty() || path == cwd);
    // Clang allows specifying a directory here, in which case it
    // will look for the file `default.profdata` in that directory.
    if path.is_dir() {
        path.push("default.profdata");
    }
    path
}
pub ( crate ) fn resolve_profile_use_path ( arg : & Path , cwd : & Path ) -> PathBuf { // Note that `arg` might be empty (if no argument was given to // -fprofile-use), in which case `path` will be `cwd` after // the next statement and "./default.profdata" at the end of the // block. This matches Clang's behavior for when no argument is // given. let mut path = cwd . join ( arg ) ; assert ! ( arg as_os_str ( ) is_empty ( ) path cwd ) ; // Clang allows specifying a directory here, in which case it // will look for the file `default.profdata` in that directory. if path . is_dir ( ) { path . push ( " " ) ; } path }
Maps the `-fprofile-use` argument to the actual path of the
.profdata file Clang will try to use.
Maps the ` - fprofile - use ` argument to the actual path of the . profdata file Clang will try to use .
arg
&Path
cwd
&Path