diff options
| author | Adrian Prantl <aprantl@apple.com> | 2018-03-02 22:42:44 +0000 |
|---|---|---|
| committer | Adrian Prantl <aprantl@apple.com> | 2018-03-02 22:42:44 +0000 |
| commit | 235354be57e3b9933f9454e964b8fbe12663dfbb (patch) | |
| tree | cc6b9c32f36ea15fa225d080b3a79e25b5509c20 /lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp | |
| parent | e3e963236a3461c977f3968326aff1ee6bb36287 (diff) | |
| download | bcm5719-llvm-235354be57e3b9933f9454e964b8fbe12663dfbb.tar.gz bcm5719-llvm-235354be57e3b9933f9454e964b8fbe12663dfbb.zip | |
Make the clang module cache setting available without a target
It turns out that setting the clang module cache after LLDB has a
Target can be too late. In particular, the Swift language plugin needs
to know the setting without having access to a Target. This patch
moves the setting into the *LLDB* module cache, where it is a global
setting that is available before any Target is created and more
importantly, is shared between all Targets.
rdar://problem/37944432
Differential Revision: https://reviews.llvm.org/D43984
llvm-svn: 326628
Diffstat (limited to 'lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp')
| -rw-r--r-- | lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp index 3729910c8a1..76f6b751afe 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp @@ -13,7 +13,6 @@ // 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" @@ -28,6 +27,7 @@ // Project includes #include "ClangModulesDeclVendor.h" +#include "lldb/Core/ModuleList.h" #include "lldb/Host/Host.h" #include "lldb/Host/HostInfo.h" #include "lldb/Symbol/CompileUnit.h" @@ -591,12 +591,11 @@ ClangModulesDeclVendor::Create(Target &target) { // Add additional search paths with { "-I", path } or { "-F", path } here. { - llvm::SmallString<128> Path; - target.GetClangModulesCachePath().GetPath(Path); - if (Path.empty()) - clang::driver::Driver::getDefaultModuleCachePath(Path); + llvm::SmallString<128> path; + auto props = ModuleList::GetGlobalModuleListProperties(); + props.GetClangModulesCachePath().GetPath(path); std::string module_cache_argument("-fmodules-cache-path="); - module_cache_argument.append(Path.str()); + module_cache_argument.append(path.str()); compiler_invocation_arguments.push_back(module_cache_argument); } |

