<div dir="ltr">We've been going to a lot of effort recently to separate out dependencies and properly layer libraries.  Even if we deemed this to be an acceptable location to #include something from clang/Driver, the CMake does not actually reference clangDriver in its link list.  So the only reason this is working, AFAICT, is because most of the final executables ultimately link in all of clang.  But that in and of itself is something we are trying to move away from.  For theoretical reasons (i.e. it doesn't make sense from a layering standpoint) as well as more practical reasons  -- we should be able to use LLDB as a library, and we should be able to link against pieces of it without requiring all of clang (or without requiring all of X where X is anything unrelated to the logical component we want to use).<div><br></div><div>An LLDB module is, conceptually, an abstract concept that is independent of clang.</div><div><br></div><div>One way to resolve it, perhaps, would be to add a function </div><div><br></div><div>static void setDefaultModuleCachePath(const Twine &Path);</div><div><br></div><div>Then, during startup where we are in the LLDB driver and have linked against everything including clang, call setDefaultModuleCachePath(clang::driver::Driver::getDefaultModuleCachePath());</div><div><br></div><div>If the ModuleListProperties class were somewhere else, perhaps this would be less of a problem.  But we can't have a dependency from Core to clang (and especially not a newly introduced one.  There is already one there to clang/AST that we are trying to remove).</div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, May 22, 2018 at 11:32 AM Adrian Prantl <<a href="mailto:aprantl@apple.com">aprantl@apple.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space">Can you help me understand why this dependency poses a problem? It's not clear to me how to resolve this otherwise. The point of the patch is to ask the clang driver for the clang module cache path. If the problem is that we otherwise don't use the driver and now pull it in, would moving the Clang API into a different clang library work? Which one?</div><div style="word-wrap:break-word;line-break:after-white-space"><div><br></div><div>-- adrian<br><div><br><blockquote type="cite"><div>On May 22, 2018, at 11:28 AM, Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>> wrote:</div><br class="m_-5072384309826791203Apple-interchange-newline"><div><div dir="ltr">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?<br><br><div class="gmail_quote"><div dir="ltr">On Fri, Mar 2, 2018 at 2:45 PM Phabricator via Phabricator via lldb-commits <<a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This revision was not accepted when it landed; it landed in state "Needs Review".<br>
This revision was automatically updated to reflect the committed changes.<br>
Closed by commit rL326628: Make the clang module cache setting available without a target (authored by adrian, committed by ).<br>
Herald added a subscriber: llvm-commits.<br>
<br>
Changed prior to commit:<br>
  <a href="https://reviews.llvm.org/D43984?vs=136803&id=136858#toc" rel="noreferrer" target="_blank">https://reviews.llvm.org/D43984?vs=136803&id=136858#toc</a><br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D43984" rel="noreferrer" target="_blank">https://reviews.llvm.org/D43984</a><br>
<br>
Files:<br>
  lldb/trunk/include/lldb/Core/ModuleList.h<br>
  lldb/trunk/include/lldb/Target/Target.h<br>
  lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-cache/Makefile<br>
  lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-cache/TestClangModulesCache.py<br>
  lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-cache/f.h<br>
  lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-cache/main.m<br>
  lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-cache/module.modulemap<br>
  lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py<br>
  lldb/trunk/source/Core/Debugger.cpp<br>
  lldb/trunk/source/Core/ModuleList.cpp<br>
  lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp<br>
  lldb/trunk/source/Target/Target.cpp<br>
<br>
_______________________________________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits</a><br>
</blockquote></div></div>
</div></blockquote></div><br></div></div></blockquote></div>