llvm.org GIT mirror llvm / c74b461
For PR1291: 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 Reid Spencer 12 years ago
5 changed file(s) with 13 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
194194 ProgramInfo::ProgramInfo(Module *m) : M(m), ProgramTimeStamp(0,0) {
195195 assert(M && "Cannot create program information with a null module!");
196196 const sys::FileStatus *Stat;
197 Stat = sys::Path(M->getModuleIdentifier()).getFileStatus();
197 Stat = sys::PathWithStatus(M->getModuleIdentifier()).getFileStatus();
198198 if (Stat)
199199 ProgramTimeStamp = Stat->getTimestamp();
200200
147147 /// error occurs, allowing the caller to distinguish between a failed diff and a
148148 /// file system error.
149149 ///
150 int llvm::DiffFilesWithTolerance(const sys::Path &FileA,
151 const sys::Path &FileB,
150 int llvm::DiffFilesWithTolerance(const sys::PathWithStatus &FileA,
151 const sys::PathWithStatus &FileB,
152152 double AbsTol, double RelTol,
153153 std::string *Error) {
154154 const sys::FileStatus *FileAStat = FileA.getFileStatus(false, Error);
280280 for (std::set::iterator I = content.begin(), E = content.end();
281281 I != E; ++I) {
282282 // Make sure it exists and is a directory
283 const sys::FileStatus *Status = I->getFileStatus(false, ErrMsg);
283 const sys::FileStatus *Status =
284 sys::PathWithStatus(*I).getFileStatus(false, ErrMsg);
284285 if (!Status)
285286 return true;
286287 if (Status->isDir) {
308309 if (!aPath.exists())
309310 throw std::string("File does not exist: ") + Members[i];
310311 std::string Err;
311 const sys::FileStatus *si = aPath.getFileStatus(false, &Err);
312 const sys::FileStatus *si =
313 sys::PathWithStatus(aPath).getFileStatus(false, &Err);
312314 if (!si)
313315 throw Err;
314316 if (si->isDir) {
644646
645647 if (found != remaining.end()) {
646648 std::string Err;
647 const sys::FileStatus *si = found->getFileStatus(false, &Err);
649 const sys::FileStatus *si =
650 sys::PathWithStatus(*found).getFileStatus(false, &Err);
648651 if (!si)
649652 return true;
650653 if (si->isDir) {
5050 // If the program has been modified, reload it!
5151 sys::Path Program(Dbg.getProgramPath());
5252 std::string Err;
53 const sys::FileStatus *Status = Program.getFileStatus(false, &Err);
53 const sys::FileStatus *Status =
54 sys::PathWithStatus(Program).getFileStatus(false, &Err);
5455 if (!Status)
5556 throw Err;
5657 if (TheProgramInfo->getProgramTimeStamp() != Status->getTimestamp()) {
194194
195195 void cleanup() {
196196 if (!isSet(KEEP_TEMPS_FLAG)) {
197 const sys::FileStatus *Status = TempDir.getFileStatus();
197 const sys::FileStatus *Status =
198 sys::PathWithStatus(TempDir).getFileStatus();
198199 if (Status && Status->isDir)
199200 TempDir.eraseFromDisk(/*remove_contents=*/true);
200201 } else {