[Lldb-commits] [PATCH] D47232: Break dependency from Expression -> Commands

Zachary Turner via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue May 22 15:09:34 PDT 2018


zturner created this revision.
zturner added reviewers: labath, davide.

The REPL (which lives in Expression) was making use of the command options for the expression command.  It's arguable whether `REPL` should even live in `Expression` to begin with, but it makes more sense for Command to depend on REPL than the other way around.  The command library should be thought of as a UI library, low level engine stuff shouldn't depend on it, but the other way around makes perfect sense.

Anyway, only about 3-4 of the fields of this structure were even used and the rest were ignored, so we just give `REPL` its own custom structure and have the command object fill this out and pass it in.  This way `REPL` doesn't need to reference one from a higher level library.

This breaks the cycle from Expression -> Commands -> Expression, reducing the distinct cycle count to 36.

Note that no `CMakeLists.txt` file needs to be updated here, because `Expression` was (incorrectly) not including `Commands` in its link list to begin with.


https://reviews.llvm.org/D47232

Files:
  lldb/include/lldb/Expression/REPL.h
  lldb/source/Commands/CommandObjectExpression.cpp
  lldb/source/Expression/REPL.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47232.148112.patch
Type: text/x-patch
Size: 4413 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20180522/ff7afb5f/attachment-0001.bin>


More information about the lldb-commits mailing list