[llvm] r198929 - lli: Tweak CacheName not to contain DOS driveletter.
NAKAMURA Takumi
geek4civic at gmail.com
Fri Jan 10 02:38:40 PST 2014
Author: chapuni
Date: Fri Jan 10 04:38:40 2014
New Revision: 198929
URL: http://llvm.org/viewvc/llvm-project?rev=198929&view=rev
Log:
lli: Tweak CacheName not to contain DOS driveletter.
Modified:
llvm/trunk/tools/lli/lli.cpp
Modified: llvm/trunk/tools/lli/lli.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lli/lli.cpp?rev=198929&r1=198928&r2=198929&view=diff
==============================================================================
--- llvm/trunk/tools/lli/lli.cpp (original)
+++ llvm/trunk/tools/lli/lli.cpp Fri Jan 10 04:38:40 2014
@@ -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;
More information about the llvm-commits
mailing list