[PATCH] D54724: [Driver] Automatically include C++ library dependencies

2018-12-19 Thread Petr Hosek via Phabricator via cfe-commits
phosek added a comment. In D54724#1304986 , @dim wrote: > I think I understand the motivation, it's just that the toolchain classes > were split up specifically to avoid `if(OS==foo) ... else if(OS==bar) ... > else if(OS==baz)` mazes. So this feels a li

[PATCH] D54724: [Driver] Automatically include C++ library dependencies

2018-11-20 Thread Dimitry Andric via Phabricator via cfe-commits
dim added a comment. In https://reviews.llvm.org/D54724#1303844, @phosek wrote: > In https://reviews.llvm.org/D54724#1303809, @dim wrote: > > > I think this is the wrong direction, placing "common" code in > > `addCXXStdlibLinkDeps`, which then has all kinds of ugly ifs and switches > > for dif

[PATCH] D54724: [Driver] Automatically include C++ library dependencies

2018-11-19 Thread Petr Hosek via Phabricator via cfe-commits
phosek added a comment. In https://reviews.llvm.org/D54724#1303809, @dim wrote: > I think this is the wrong direction, placing "common" code in > `addCXXStdlibLinkDeps`, which then has all kinds of ugly ifs and switches for > different OSes? Let different OSes handle this in their own way, may

[PATCH] D54724: [Driver] Automatically include C++ library dependencies

2018-11-19 Thread Dimitry Andric via Phabricator via cfe-commits
dim added a comment. I think this is the wrong direction, placing "common" code in `addCXXStdlibLinkDeps`, which then has all kinds of ugly ifs and switches for different OSes? Let different OSes handle this in their own way, maybe. Until now I have not encountered an issue where I needed to a

[PATCH] D54724: [Driver] Automatically include C++ library dependencies

2018-11-19 Thread Petr Hosek via Phabricator via cfe-commits
phosek created this revision. Herald added subscribers: cfe-commits, jfb, srhines, emaste. Existing drivers already include -lm as C++ library dependency, but that alone is not sufficient when statically linking the C++ library. To handle that case, we introduce a new method addCXXStdlibLinkDeps w