summaryrefslogtreecommitdiffstats
path: root/llvm/lib/System/Unix/Path.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-09-16 16:36:10 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-09-16 16:36:10 +0000
commit16b7bad55e1bd48741be7d14d4d4b25d1ccf1704 (patch)
treeb6e662919ab21a5be5fa767068ea9b005139ecf5 /llvm/lib/System/Unix/Path.cpp
parent4aff78acbb1873b1c9b38547c61b4fd34e80ea14 (diff)
downloadbcm5719-llvm-16b7bad55e1bd48741be7d14d4d4b25d1ccf1704.tar.gz
bcm5719-llvm-16b7bad55e1bd48741be7d14d4d4b25d1ccf1704.zip
Allow "bc" as suffix for bytecode files.
llvm-svn: 16381
Diffstat (limited to 'llvm/lib/System/Unix/Path.cpp')
-rw-r--r--llvm/lib/System/Unix/Path.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/System/Unix/Path.cpp b/llvm/lib/System/Unix/Path.cpp
index 329bf37e387..182a0bbd8ca 100644
--- a/llvm/lib/System/Unix/Path.cpp
+++ b/llvm/lib/System/Unix/Path.cpp
@@ -52,6 +52,8 @@ static inline bool IsLibrary(Path& path, const std::string& basename) {
return true;
else if (path.elide_suffix() && path.append_suffix("o") && path.readable())
return true;
+ else if (path.elide_suffix() && path.append_suffix("bc") && path.readable())
+ return true;
} else if (path.elide_file() && path.append_file(basename)) {
if (path.append_suffix(Path::GetDLLSuffix()) && path.readable())
return true;
@@ -59,6 +61,8 @@ static inline bool IsLibrary(Path& path, const std::string& basename) {
return true;
else if (path.elide_suffix() && path.append_suffix("o") && path.readable())
return true;
+ else if (path.elide_suffix() && path.append_suffix("bc") && path.readable())
+ return true;
}
path.clear();
return false;
@@ -76,6 +80,10 @@ Path::GetLibraryPath(const std::string& basename,
return result;
}
+ // Try the LLVM lib directory in the LLVM install area
+ if (result.set_directory(LLVM_LIBDIR) && IsLibrary(result,basename))
+ return result;
+
// Try /usr/lib
if (result.set_directory("/usr/lib/") && IsLibrary(result,basename))
return result;
OpenPOWER on IntegriCloud