Make sure we don't error out if an invalid path is used, just simply

exit from isBytecodeLPath with "false".

llvm-svn: 22360
This commit is contained in:
Reid Spencer 2005-07-08 16:48:52 +00:00
parent d28e432c36
commit 03f6f7a537
1 changed files with 13 additions and 2 deletions

View File

@ -154,10 +154,21 @@ static bool isBytecodeLPath(const std::string &LibPath) {
sys::Path LPath(LibPath);
// Make sure its a directory
if (!LPath.isDirectory())
// Make sure it exists
if (!LPath.exists())
return isBytecodeLPath;
// Make sure its a directory
try
{
if (!LPath.isDirectory())
return isBytecodeLPath;
}
catch (std::string& xcptn)
{
return isBytecodeLPath;
}
// Grab the contents of the -L path
std::set<sys::Path> Files;
LPath.getDirectoryContents(Files);