diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2004-09-16 16:36:10 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2004-09-16 16:36:10 +0000 |
commit | 0cc2d0a1b88f89c70a0310bd7c212f867c82ed64 (patch) | |
tree | ef86596d1ab26d9d468acc41f91af46e984a34ac /lib/System | |
parent | 90b54138834a057179c7a02931217ab5a82ed389 (diff) | |
download | external_llvm-0cc2d0a1b88f89c70a0310bd7c212f867c82ed64.zip external_llvm-0cc2d0a1b88f89c70a0310bd7c212f867c82ed64.tar.gz external_llvm-0cc2d0a1b88f89c70a0310bd7c212f867c82ed64.tar.bz2 |
Allow "bc" as suffix for bytecode files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16381 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/System')
-rw-r--r-- | lib/System/Unix/Path.cpp | 8 | ||||
-rw-r--r-- | lib/System/Unix/Path.inc | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/lib/System/Unix/Path.cpp b/lib/System/Unix/Path.cpp index 329bf37..182a0bbd 100644 --- a/lib/System/Unix/Path.cpp +++ b/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; diff --git a/lib/System/Unix/Path.inc b/lib/System/Unix/Path.inc index 329bf37..182a0bbd 100644 --- a/lib/System/Unix/Path.inc +++ b/lib/System/Unix/Path.inc @@ -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; |