summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2014-01-10 10:38:34 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2014-01-10 10:38:34 +0000
commit390e0609168113a17d6028dfb7023eebd10aba70 (patch)
tree5b581283d9db43429c0b2974c3b8fe0c9368cfd2 /llvm/tools
parentf462f9c7e04713ce9a4b095e6385c8194a0fda40 (diff)
downloadbcm5719-llvm-390e0609168113a17d6028dfb7023eebd10aba70.tar.gz
bcm5719-llvm-390e0609168113a17d6028dfb7023eebd10aba70.zip
lli: LLIObjectCache: Use llvm::sys::path to get dirname.
llvm-svn: 198928
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/lli/lli.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp
index c90cc87a175..963e93e2bf1 100644
--- a/llvm/tools/lli/lli.cpp
+++ b/llvm/tools/lli/lli.cpp
@@ -268,8 +268,11 @@ public:
if (!getCacheFilename(ModuleID, CacheName))
return;
std::string errStr;
- if (!CacheDir.empty()) // Create user-defined cache dir.
- sys::fs::create_directories(CacheName.substr(0, CacheName.rfind('/')));
+ if (!CacheDir.empty()) { // Create user-defined cache dir.
+ SmallString<128> dir(CacheName);
+ sys::path::remove_filename(dir);
+ sys::fs::create_directories(Twine(dir));
+ }
raw_fd_ostream outfile(CacheName.c_str(), errStr, sys::fs::F_Binary);
outfile.write(Obj->getBufferStart(), Obj->getBufferSize());
outfile.close();
OpenPOWER on IntegriCloud