diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2014-01-10 10:38:40 +0000 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2014-01-10 10:38:40 +0000 |
commit | d7fd6d99ec6886c7b7d1e2780eb6e9cf39f5719f (patch) | |
tree | 474f581172594ca15f98c8250e8c1e9bf0ac0b59 | |
parent | 390e0609168113a17d6028dfb7023eebd10aba70 (diff) | |
download | bcm5719-llvm-d7fd6d99ec6886c7b7d1e2780eb6e9cf39f5719f.tar.gz bcm5719-llvm-d7fd6d99ec6886c7b7d1e2780eb6e9cf39f5719f.zip |
lli: Tweak CacheName not to contain DOS driveletter.
llvm-svn: 198929
-rw-r--r-- | llvm/tools/lli/lli.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp index 963e93e2bf1..3766f8c0caa 100644 --- a/llvm/tools/lli/lli.cpp +++ b/llvm/tools/lli/lli.cpp @@ -304,7 +304,15 @@ private: size_t PrefixLength = Prefix.length(); if (ModID.substr(0, PrefixLength) != Prefix) return false; - CacheName = CacheDir + ModID.substr(PrefixLength); + std::string CacheSubdir = ModID.substr(PrefixLength); +#if defined(_WIN32) + // Transform "X:\foo" => "/X\foo" for convenience. + if (isalpha(CacheSubdir[0]) && CacheSubdir[1] == ':') { + CacheSubdir[1] = CacheSubdir[0]; + CacheSubdir[0] = '/'; + } +#endif + CacheName = CacheDir + CacheSubdir; size_t pos = CacheName.rfind('.'); CacheName.replace(pos, CacheName.length() - pos, ".o"); return true; |