summaryrefslogtreecommitdiff
path: root/tools/lli
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2014-01-10 10:38:40 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2014-01-10 10:38:40 +0000
commit744f816bc1a36ba04af28992208f8bc78a25ae9e (patch)
tree3e3cb529dc6e7e2d84b1a0883d957b655d611a0b /tools/lli
parent32712c76144a84e507d0b8484f3127323786ceef (diff)
lli: Tweak CacheName not to contain DOS driveletter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198929 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/lli')
-rw-r--r--tools/lli/lli.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/lli/lli.cpp b/tools/lli/lli.cpp
index 963e93e2bf1..3766f8c0caa 100644
--- a/tools/lli/lli.cpp
+++ b/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;