Commit Graph

19 Commits

Author SHA1 Message Date
Eugene Zelenko c2eb4fa159 [Driver] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@328044 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-20 21:08:59 +00:00
Jonathan Roelofs 7eaea28742 Multilib: add dump methods
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302296 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-05 21:30:13 +00:00
David L. Jones 1c814d10cf [Driver] Consolidate tools and toolchains by target platform. (NFC)
Summary:
(This is a move-only refactoring patch. There are no functionality changes.)

This patch splits apart the Clang driver's tool and toolchain implementation
files. Each target platform toolchain is moved to its own file, along with the
closest-related tools. Each target platform toolchain has separate headers and
implementation files, so the hierarchy of classes is unchanged.

There are some remaining shared free functions, mostly from Tools.cpp. Several
of these move to their own architecture-specific files, similar to r296056. Some
of them are only used by a single target platform; since the tools and
toolchains are now together, some helpers now live in a platform-specific file.
The balance are helpers related to manipulating argument lists, so they are now
in a new file pair, CommonArgs.h and .cpp.

I've tried to cluster the code logically, which is fairly straightforward for
most of the target platforms and shared architectures. I think I've made
reasonable choices for these, as well as the various shared helpers; but of
course, I'm happy to hear feedback in the review.

There are some particular things I don't like about this patch, but haven't been
able to find a better overall solution. The first is the proliferation of files:
there are several files that are tiny because the toolchain is not very
different from its base (usually the Gnu tools/toolchain). I think this is
mostly a reflection of the true complexity, though, so it may not be "fixable"
in any reasonable sense. The second thing I don't like are the includes like
"../Something.h". I've avoided this largely by clustering into the current file
structure. However, a few of these includes remain, and in those cases it
doesn't make sense to me to sink an existing file any deeper.

Reviewers: rsmith, mehdi_amini, compnerd, rnk, javed.absar

Subscribers: emaste, jfb, danalbert, srhines, dschuff, jyknight, nemanjai, nhaehnle, mgorny, cfe-commits

Differential Revision: https://reviews.llvm.org/D30372

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297250 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-08 01:02:16 +00:00
Mehdi Amini 2e23251d3e [NFC] Header cleanup
Summary: Removed unused headers, replaced some headers with forward class declarations

Patch by: Eugene <claprix@yandex.ru>

Differential Revision: https://reviews.llvm.org/D20100

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275882 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 19:02:11 +00:00
Simon Atanasyan 41af455f5e [Driver] Remove `else` after `return`
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@250043 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-12 14:32:57 +00:00
Benjamin Kramer edcfa30346 [multilib] Turn virtual functor into functin_ref
And update code to use lambdas where possible, plus random cleanup. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@232916 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-22 15:56:12 +00:00
Yaron Keren 9bd91b686a Remove many superfluous SmallString::str() calls.
Now that SmallString is a first-class citizen, most SmallString::str()
calls are not required. This patch removes a whole bunch of them, yet
there are lots more.

There are two use cases where str() is really needed:
1) To use one of StringRef member functions which is not available in
SmallString.
2) To convert to std::string, as StringRef implicitly converts while 
SmallString do not. We may wish to change this, but it may introduce
ambiguity.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@232622 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-18 10:17:07 +00:00
Justin Bogner d5699807d5 Driver: Simplify a use of the path API
It's a bit more obvious what's going on if we use path::filename
rather than decrementing an iterator here.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214668 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-03 21:46:33 +00:00
Simon Atanasyan 838b0764d7 [Driver] Range-based loop simplification.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208354 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-08 19:32:46 +00:00
Benjamin Kramer 99249c61b4 Revert "[C++11] Replace trivial lambda with std::cref."
MSVC2013's standard library is too broken to understand this pattern.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202971 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-05 13:25:00 +00:00
Benjamin Kramer 3fff5b31a0 [C++11] Replace trivial lambda with std::cref.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202968 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-05 11:38:18 +00:00
Chandler Carruth de49053bc1 [cleanup] Re-sort includes with llvm/utils/sort_includes.py and fix
a missing include from CLog.h.

CLog.h referenced most of the core libclang types but never directly
included Index.h that provides them. Previously it got lucky and other
headers were always included first but with the sorting it ended up
first in one case and stopped compiling. Adding the Index.h include
fixes it right up.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202810 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04 10:05:20 +00:00
Craig Topper caa4c61ee5 Switch all uses of LLVM_OVERRIDE to just use 'override' directly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202625 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-02 09:32:10 +00:00
Benjamin Kramer 802ac72495 [C++11] Replace verbose functors with succinct lambdas
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202590 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-01 14:48:57 +00:00
NAKAMURA Takumi 32986cdb1c clang/lib/Driver/Multilib.cpp: Rewrite normalizePathSegment() to be tolerant dosish pathsep.
FIXME: It could be more simple...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201227 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-12 11:42:02 +00:00
Jonathan Roelofs a60a522fce Fix r201205's use-after-free bug caught by sanitizer bot
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201209 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-12 06:37:27 +00:00
Jonathan Roelofs ddccd4eca1 Add Multilib selection machinery
This patch improves the support for picking Multilibs from gcc installations.
It also provides a better approximation for the flags '-print-multi-directory'
and '-print-multi-lib'.

This reverts r201203 (i.e. re-applying r201202 with small fixes in
unittests/CMakeLists.txtto make the build bots happy).

review: http://llvm-reviews.chandlerc.com/D2538


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201205 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-12 03:21:20 +00:00
Jonathan Roelofs 56c7cf67c6 Revert 201202
Breaks cmake configure of new unit tests directory


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201203 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-12 01:36:51 +00:00
Jonathan Roelofs 1b6afd89e6 Add Multilib selection machinery
This patch improves the support for picking Multilibs from gcc installations.
It also provides a better approximation for the flags '-print-multi-directory'
and '-print-multi-lib'.

review: http://llvm-reviews.chandlerc.com/D2538


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201202 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-12 01:29:25 +00:00