1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00

Use Path::getFileStatus to get status-related info.

llvm-svn: 29444
This commit is contained in:
Chris Lattner 2006-08-01 18:04:01 +00:00
parent 401b6d696e
commit d69d77e5d1

View File

@ -151,12 +151,9 @@ static bool isBytecodeLPath(const std::string &LibPath) {
sys::Path LPath(LibPath); sys::Path LPath(LibPath);
// Make sure it exists and is a directory // Make sure it exists and is a directory
try { sys::FileStatus Status;
if (!LPath.exists() || !LPath.isDirectory()) if (LPath.getFileStatus(Status) || !Status.isDir)
return false;
} catch (std::string& xcptn) {
return false; return false;
}
// Grab the contents of the -L path // Grab the contents of the -L path
std::set<sys::Path> Files; std::set<sys::Path> Files;
@ -169,12 +166,13 @@ static bool isBytecodeLPath(const std::string &LibPath) {
std::string dllsuffix = sys::Path::GetDLLSuffix(); std::string dllsuffix = sys::Path::GetDLLSuffix();
for (; File != Files.end(); ++File) { for (; File != Files.end(); ++File) {
if ( File->isDirectory() ) // Not a file?
if (File->getFileStatus(Status) || Status.isDir)
continue; continue;
std::string path = File->toString(); std::string path = File->toString();
// Check for an ending '.dll,.so' or '.a' suffix as all // Check for an ending '.dll', '.so' or '.a' suffix as all
// other files are not of interest to us here // other files are not of interest to us here
if (path.find(dllsuffix, path.size()-dllsuffix.size()) == std::string::npos if (path.find(dllsuffix, path.size()-dllsuffix.size()) == std::string::npos
&& path.find(".a", path.size()-2) == std::string::npos) && path.find(".a", path.size()-2) == std::string::npos)