This is an archive of the discontinued LLVM Phabricator instance.

Make the clang module cache setting available without a target
ClosedPublic

Authored by aprantl on Mar 1 2018, 4:33 PM.

Details

Summary

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

Diff Detail

Repository
rL LLVM

Event Timeline

aprantl created this revision.Mar 1 2018, 4:33 PM

This looks fine. Did you have a way to test it?

The entire testsuite depends on being able to set this option (see the change in packages/Python/lldbsuite/test/lldbtest.py), but we don't verify that the directory is being used. I'll see if I can come up with a dedicated test.

aprantl updated this revision to Diff 136803.Mar 2 2018, 10:57 AM

Added a testcase.

This revision was not accepted when it landed; it landed in state Needs Review.Mar 2 2018, 2:45 PM
This revision was automatically updated to reflect the committed changes.

This change has introduced a dependency from Core -> clang Driver (due to
#include "clang/Driver/Driver.h" in ModuleList.cpp). Can you please try to
find a way to remove this dependency?