<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Yes, that proposal makes sense to me: the split would be between things that *are* known to be subsumed into later versions of C++, and therefore are a compatibility library.</div><div class=""><br class=""></div><div class="">What do you think about this as an implementation approach:</div><div class=""><br class=""></div><div class=""> - Rewrite StringRef (et al) to use the exact same APIs as std::string_view. Keep the StringRef name for now.</div><div class=""> - When cmake detects that C++’17 mode is supported, the build would set a -D flag.</div><div class=""> - StringRef.h would just include the C++’17 header and typedef StringRef to that type.</div><div class=""> - When we start requiring C++’17, someone can “StringRef”->RAUW(“std::string_view”) and nuke the header.</div><div class=""><br class=""></div><div class="">This allows us to have a clean path out of these custom types, and makes it very clear that these headers are compatibility shims that go away in the future. It also makes it clear what the division is.</div><div class=""><br class=""></div><div class="">-Chris</div><div class=""><br class=""></div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On Jul 5, 2017, at 10:38 AM, Zachary Turner <<a href="mailto:zturner@google.com" class="">zturner@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">So, here is an example of where I think a split would be really helpful.<div class=""><br class=""></div><div class=""><a href="https://reviews.llvm.org/D34667" class="">https://reviews.llvm.org/D34667</a><br class=""></div><div class=""><br class=""></div><div class="">This code would benefit vastly even from just being able to use StringRef and ArrayRef. We have other cases as well where we export some code that cannot depend on the rest of LLVM.</div><div class=""><br class=""></div><div class="">Thinking about it some, StringRef, ArrayRef, and various other things like STLExtras and iterator.h basically can be summarized as "things that are either already already planned for, or wouldn't be entirely out of place in the STL itself". For example, StringRef is std::string_view. ArrayRef is std::array_view. iterator_facade_base is a better version of std::iterator. </div><div class=""><br class=""></div><div class="">So I would drop my suggestion to split the libraries in such a way that it might benefit TableGen, and instead re-word my suggestion to include only classes such as StringRef, ArrayRef, and other STL-like utilities that can benefit utilities like our demangler etc that cannot depend on the rest of LLVM. If and when we ever require C++17 for building LLVM (a long ways away, obviously, but we might as well be forward thinking), we would certainly be able to use std::string_view and std::array_view in the demangler. So splitting things in a way such as this makes long term sense IMO.</div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Sun, Jun 4, 2017 at 10:50 AM Zachary Turner <<a href="mailto:zturner@google.com" class="">zturner@google.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Fair enough, i sort of regret mentioning that specific method of splitting originally.<br class=""><br class="">For the record, i think any splitting should make sense on its own merit without considering tablegen, and hopefully the end result of "tablegen eventually depends on less stuff" would happen naturally <br class=""><div class="gmail_quote"><div dir="ltr" class="">On Sun, Jun 4, 2017 at 10:37 AM Chris Lattner <<a href="mailto:clattner@nondot.org" target="_blank" class="">clattner@nondot.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br class="">
> On May 26, 2017, at 5:47 PM, Zachary Turner via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a>> wrote:<br class="">
><br class="">
> Changing a header file somewhere and having to spend 10 minutes waiting for a build leads to a lot of wasted developer time.<br class="">
><br class="">
> The real culprit here is tablegen. Can we split support and ADT into two - the parts that tablegen depends on and the parts that it doesn’t?<br class="">
<br class="">
In all the comments downthread, I think there is one thing that hasn't been mentioned: doing a split like this makes tblgen evolution more difficult. If libsupport was split into “used by tblgen” and “not used by tblgen” sections, and then a new tblgen feature needs to use other parts of libsupport, they’d have to be moved into the “used by tblgen” directory.<br class="">
<br class="">
Splitting libsupport as a whole out into its own llvm subproject has come up many times though, and does make a lot of sense.<br class="">
<br class="">
-Chris<br class="">
<br class="">
<br class="">
</blockquote></div></blockquote></div>
</div></blockquote></div><br class=""></body></html>