summaryrefslogtreecommitdiffstats
path: root/llvm/tools/gccld/GenerateCode.cpp
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
commit32ffbc316a214be2ed04e2bf276f3982b4d452bf (patch)
tree8d5a6ae5374e0d12ea0754051778786ebddd057e /llvm/tools/gccld/GenerateCode.cpp
parent80df7c4651fdb4d25d0895ff4a53f0e3d93df912 (diff)
downloadbcm5719-llvm-32ffbc316a214be2ed04e2bf276f3982b4d452bf.tar.gz
bcm5719-llvm-32ffbc316a214be2ed04e2bf276f3982b4d452bf.zip
Use Path::getFileStatus to get status-related info.
llvm-svn: 29444
Diffstat (limited to 'llvm/tools/gccld/GenerateCode.cpp')
-rw-r--r--llvm/tools/gccld/GenerateCode.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/llvm/tools/gccld/GenerateCode.cpp b/llvm/tools/gccld/GenerateCode.cpp
index fc674f7088d..63dda12aa07 100644
--- a/llvm/tools/gccld/GenerateCode.cpp
+++ b/llvm/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)
OpenPOWER on IntegriCloud