summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 963e93e2bf..3766f8c0ca 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;