Change uses of sys::Path class to sys::PathWithStatus in those places where
the file status information is needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35743
91177308-0d34-0410-b5e6-
96231b3b80d8
ProgramInfo::ProgramInfo(Module *m) : M(m), ProgramTimeStamp(0,0) {
assert(M && "Cannot create program information with a null module!");
const sys::FileStatus *Stat;
- Stat = sys::Path(M->getModuleIdentifier()).getFileStatus();
+ Stat = sys::PathWithStatus(M->getModuleIdentifier()).getFileStatus();
if (Stat)
ProgramTimeStamp = Stat->getTimestamp();
/// error occurs, allowing the caller to distinguish between a failed diff and a
/// file system error.
///
-int llvm::DiffFilesWithTolerance(const sys::Path &FileA,
- const sys::Path &FileB,
+int llvm::DiffFilesWithTolerance(const sys::PathWithStatus &FileA,
+ const sys::PathWithStatus &FileB,
double AbsTol, double RelTol,
std::string *Error) {
const sys::FileStatus *FileAStat = FileA.getFileStatus(false, Error);
for (std::set<sys::Path>::iterator I = content.begin(), E = content.end();
I != E; ++I) {
// Make sure it exists and is a directory
- const sys::FileStatus *Status = I->getFileStatus(false, ErrMsg);
+ const sys::FileStatus *Status =
+ sys::PathWithStatus(*I).getFileStatus(false, ErrMsg);
if (!Status)
return true;
if (Status->isDir) {
if (!aPath.exists())
throw std::string("File does not exist: ") + Members[i];
std::string Err;
- const sys::FileStatus *si = aPath.getFileStatus(false, &Err);
+ const sys::FileStatus *si =
+ sys::PathWithStatus(aPath).getFileStatus(false, &Err);
if (!si)
throw Err;
if (si->isDir) {
if (found != remaining.end()) {
std::string Err;
- const sys::FileStatus *si = found->getFileStatus(false, &Err);
+ const sys::FileStatus *si =
+ sys::PathWithStatus(*found).getFileStatus(false, &Err);
if (!si)
return true;
if (si->isDir) {
// If the program has been modified, reload it!
sys::Path Program(Dbg.getProgramPath());
std::string Err;
- const sys::FileStatus *Status = Program.getFileStatus(false, &Err);
+ const sys::FileStatus *Status =
+ sys::PathWithStatus(Program).getFileStatus(false, &Err);
if (!Status)
throw Err;
if (TheProgramInfo->getProgramTimeStamp() != Status->getTimestamp()) {
void cleanup() {
if (!isSet(KEEP_TEMPS_FLAG)) {
- const sys::FileStatus *Status = TempDir.getFileStatus();
+ const sys::FileStatus *Status =
+ sys::PathWithStatus(TempDir).getFileStatus();
if (Status && Status->isDir)
TempDir.eraseFromDisk(/*remove_contents=*/true);
} else {