summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2018-02-09 22:08:26 +0000
committerAdrian Prantl <aprantl@apple.com>2018-02-09 22:08:26 +0000
commit95a0f39e35040e7385cfde680721c1ea578a1d0f (patch)
tree581af353d0c38dc938dd087d71c0ab18caa51d9f /lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp
parenta60f4621ae3ac1ce7aa7f9f6877597e37d0d9014 (diff)
downloadbcm5719-llvm-95a0f39e35040e7385cfde680721c1ea578a1d0f.tar.gz
bcm5719-llvm-95a0f39e35040e7385cfde680721c1ea578a1d0f.zip
Make LLDB's clang module cache path customizable
This patch makes LLDB's clang module cache path customizable via settings set target.clang-modules-cache-path <path> and uses it in the LLDB testsuite to reuse the same location inside the build directory for LLDB and clang. Differential Revision: https://reviews.llvm.org/D43099 llvm-svn: 324775
Diffstat (limited to 'lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp')
-rw-r--r--lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp
index b42ceb9afee..3729910c8a1 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp
@@ -13,6 +13,7 @@
// Other libraries and framework includes
#include "clang/Basic/TargetInfo.h"
+#include "clang/Driver/Driver.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/FrontendActions.h"
#include "clang/Lex/Preprocessor.h"
@@ -590,14 +591,12 @@ ClangModulesDeclVendor::Create(Target &target) {
// Add additional search paths with { "-I", path } or { "-F", path } here.
{
- llvm::SmallString<128> DefaultModuleCache;
- const bool erased_on_reboot = false;
- llvm::sys::path::system_temp_directory(erased_on_reboot,
- DefaultModuleCache);
- llvm::sys::path::append(DefaultModuleCache, "org.llvm.clang");
- llvm::sys::path::append(DefaultModuleCache, "ModuleCache");
+ llvm::SmallString<128> Path;
+ target.GetClangModulesCachePath().GetPath(Path);
+ if (Path.empty())
+ clang::driver::Driver::getDefaultModuleCachePath(Path);
std::string module_cache_argument("-fmodules-cache-path=");
- module_cache_argument.append(DefaultModuleCache.str().str());
+ module_cache_argument.append(Path.str());
compiler_invocation_arguments.push_back(module_cache_argument);
}
OpenPOWER on IntegriCloud