mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-19 03:24:09 +00:00
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
This commit is contained in:
@ -195,7 +195,7 @@ void SourceFunctionInfo::getSourceLocation(unsigned &RetLineNo,
|
|||||||
ProgramInfo::ProgramInfo(Module *m) : M(m), ProgramTimeStamp(0,0) {
|
ProgramInfo::ProgramInfo(Module *m) : M(m), ProgramTimeStamp(0,0) {
|
||||||
assert(M && "Cannot create program information with a null module!");
|
assert(M && "Cannot create program information with a null module!");
|
||||||
const sys::FileStatus *Stat;
|
const sys::FileStatus *Stat;
|
||||||
Stat = sys::Path(M->getModuleIdentifier()).getFileStatus();
|
Stat = sys::PathWithStatus(M->getModuleIdentifier()).getFileStatus();
|
||||||
if (Stat)
|
if (Stat)
|
||||||
ProgramTimeStamp = Stat->getTimestamp();
|
ProgramTimeStamp = Stat->getTimestamp();
|
||||||
|
|
||||||
|
@ -148,8 +148,8 @@ static void PadFileIfNeeded(char *&FileStart, char *&FileEnd, char *&FP) {
|
|||||||
/// error occurs, allowing the caller to distinguish between a failed diff and a
|
/// error occurs, allowing the caller to distinguish between a failed diff and a
|
||||||
/// file system error.
|
/// file system error.
|
||||||
///
|
///
|
||||||
int llvm::DiffFilesWithTolerance(const sys::Path &FileA,
|
int llvm::DiffFilesWithTolerance(const sys::PathWithStatus &FileA,
|
||||||
const sys::Path &FileB,
|
const sys::PathWithStatus &FileB,
|
||||||
double AbsTol, double RelTol,
|
double AbsTol, double RelTol,
|
||||||
std::string *Error) {
|
std::string *Error) {
|
||||||
const sys::FileStatus *FileAStat = FileA.getFileStatus(false, Error);
|
const sys::FileStatus *FileAStat = FileA.getFileStatus(false, Error);
|
||||||
|
@ -281,7 +281,8 @@ recurseDirectories(const sys::Path& path,
|
|||||||
for (std::set<sys::Path>::iterator I = content.begin(), E = content.end();
|
for (std::set<sys::Path>::iterator I = content.begin(), E = content.end();
|
||||||
I != E; ++I) {
|
I != E; ++I) {
|
||||||
// Make sure it exists and is a directory
|
// 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)
|
if (!Status)
|
||||||
return true;
|
return true;
|
||||||
if (Status->isDir) {
|
if (Status->isDir) {
|
||||||
@ -309,7 +310,8 @@ bool buildPaths(bool checkExistence, std::string* ErrMsg) {
|
|||||||
if (!aPath.exists())
|
if (!aPath.exists())
|
||||||
throw std::string("File does not exist: ") + Members[i];
|
throw std::string("File does not exist: ") + Members[i];
|
||||||
std::string Err;
|
std::string Err;
|
||||||
const sys::FileStatus *si = aPath.getFileStatus(false, &Err);
|
const sys::FileStatus *si =
|
||||||
|
sys::PathWithStatus(aPath).getFileStatus(false, &Err);
|
||||||
if (!si)
|
if (!si)
|
||||||
throw Err;
|
throw Err;
|
||||||
if (si->isDir) {
|
if (si->isDir) {
|
||||||
@ -645,7 +647,8 @@ doReplaceOrInsert(std::string* ErrMsg) {
|
|||||||
|
|
||||||
if (found != remaining.end()) {
|
if (found != remaining.end()) {
|
||||||
std::string Err;
|
std::string Err;
|
||||||
const sys::FileStatus *si = found->getFileStatus(false, &Err);
|
const sys::FileStatus *si =
|
||||||
|
sys::PathWithStatus(*found).getFileStatus(false, &Err);
|
||||||
if (!si)
|
if (!si)
|
||||||
return true;
|
return true;
|
||||||
if (si->isDir) {
|
if (si->isDir) {
|
||||||
|
@ -51,7 +51,8 @@ void CLIDebugger::startProgramRunning() {
|
|||||||
// If the program has been modified, reload it!
|
// If the program has been modified, reload it!
|
||||||
sys::Path Program(Dbg.getProgramPath());
|
sys::Path Program(Dbg.getProgramPath());
|
||||||
std::string Err;
|
std::string Err;
|
||||||
const sys::FileStatus *Status = Program.getFileStatus(false, &Err);
|
const sys::FileStatus *Status =
|
||||||
|
sys::PathWithStatus(Program).getFileStatus(false, &Err);
|
||||||
if (!Status)
|
if (!Status)
|
||||||
throw Err;
|
throw Err;
|
||||||
if (TheProgramInfo->getProgramTimeStamp() != Status->getTimestamp()) {
|
if (TheProgramInfo->getProgramTimeStamp() != Status->getTimestamp()) {
|
||||||
|
@ -195,7 +195,8 @@ private:
|
|||||||
|
|
||||||
void cleanup() {
|
void cleanup() {
|
||||||
if (!isSet(KEEP_TEMPS_FLAG)) {
|
if (!isSet(KEEP_TEMPS_FLAG)) {
|
||||||
const sys::FileStatus *Status = TempDir.getFileStatus();
|
const sys::FileStatus *Status =
|
||||||
|
sys::PathWithStatus(TempDir).getFileStatus();
|
||||||
if (Status && Status->isDir)
|
if (Status && Status->isDir)
|
||||||
TempDir.eraseFromDisk(/*remove_contents=*/true);
|
TempDir.eraseFromDisk(/*remove_contents=*/true);
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user