summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-08-01 18:04:01 +0000
committerChris Lattner <sabre@nondot.org>2006-08-01 18:04:01 +0000
commit0b32d8b764000198f0eeeec24de35249f7401f1e (patch)
tree52f1c0120380a9cae48533791ed48ac985cca6d2 /tools
parent8961501c9b340cdd97261696bb4e20622ec47595 (diff)
downloadllvm-0b32d8b764000198f0eeeec24de35249f7401f1e.tar.gz
llvm-0b32d8b764000198f0eeeec24de35249f7401f1e.tar.bz2
llvm-0b32d8b764000198f0eeeec24de35249f7401f1e.tar.xz
Use Path::getFileStatus to get status-related info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29444 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/gccld/GenerateCode.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/tools/gccld/GenerateCode.cpp b/tools/gccld/GenerateCode.cpp
index fc674f7088..63dda12aa0 100644
--- a/tools/gccld/GenerateCode.cpp
+++ b/tools/gccld/GenerateCode.cpp
@@ -151,12 +151,9 @@ static bool isBytecodeLPath(const std::string &LibPath) {
sys::Path LPath(LibPath);
// Make sure it exists and is a directory
- try {
- if (!LPath.exists() || !LPath.isDirectory())
- return false;
- } catch (std::string& xcptn) {
+ sys::FileStatus Status;
+ if (LPath.getFileStatus(Status) || !Status.isDir)
return false;
- }
// Grab the contents of the -L path
std::set<sys::Path> Files;
@@ -169,12 +166,13 @@ static bool isBytecodeLPath(const std::string &LibPath) {
std::string dllsuffix = sys::Path::GetDLLSuffix();
for (; File != Files.end(); ++File) {
- if ( File->isDirectory() )
+ // Not a file?
+ if (File->getFileStatus(Status) || Status.isDir)
continue;
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
if (path.find(dllsuffix, path.size()-dllsuffix.size()) == std::string::npos
&& path.find(".a", path.size()-2) == std::string::npos)