[lldb-dev] Config.h

Chandler Carruth chandlerc at google.com
Thu Jul 3 13:21:18 PDT 2014


On Thu, Jul 3, 2014 at 1:12 PM, Zachary Turner <zturner at google.com> wrote:

> Even simple typedefs already imply a host dependency.  Currently platform
> specific typedefs are not brought in through Host/Config.h, but they could
> be for example.  But I guess the point is that if you're compiling for a
> particular host, you're already married to it.
>
> I guess I only find this an issue because the codebase or style guide
> doesn't seem to discourage using #ifdefs for platform-specific logic.  So
> say I'm editing some file, and I see the use of LLDB_DISABLE_POSIX.  I then
> go use that same define in another file because I need it, and it's not
> defined because Config.h isn't included.  Including it is obviously an easy
> fix, but it just strikes me as inconsistent that it would be defined in
> some places and not others.  What if someone uses it in a header file?
>  (Note that it's already used in a header file, btw.  ProcessLaunchInfo.h).
>

FWIW, I would encourage LLDB to look at how LLVM does platform-specific
stuff... It might need some tweaking (I generally expect there to be more
platform specific code in LLDB than LLVM proper) but the patterns should be
pretty reasonable to follow IMO. (And we don't have a must-include-first
config header, which is I think a design mistake. Consider what happens if
we switch to a modules-based LLVM and LLDB build...)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20140703/5ad399bd/attachment.html>


More information about the lldb-dev mailing list