Commit Graph

244 Commits

Author SHA1 Message Date
Alex Lorenz 5b2dfe4f4d [frontend] Don't include the C++ stdlib for -x assembler-with-cpp
The new C++ stdlib warning added in r335081 gets
triggered when compiling an assembly file with -x assembler-with-cpp.
This commit ensures that the C++ stdlib is not included when compiling assembly.
In general, it's not really useful to include the C++ stdlib search path when
compiling assembly source.

rdar://41359632

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335940 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-28 23:23:45 +00:00
Alex Lorenz cd6d4e81a7 Recommit r335063: [Darwin] Add a warning for missing include path for libstdc++
The recommit ensures that the tests that failed on bots don't trigger the warning.

Xcode 10 removes support for libstdc++, but the users just get a confusing
include not file warning when including an STL header (when building for iOS6
which uses libstdc++ by default for example).
This patch adds a new warning that lets the user know that the libstdc++ include
path was not found to ensure that the user is more aware of why the error occurs.

rdar://40830462

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335081 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-19 22:47:53 +00:00
Alex Lorenz 4e85e01664 Revert r335063 as it causes bot failures
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335073 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-19 19:43:07 +00:00
Alex Lorenz 78e14633a4 [Darwin] Add a warning for missing include path for libstdc++
Xcode 10 removes support for libstdc++, but the users just get a confusing
include not file warning when including an STL header (when building for iOS6
which uses libstdc++ by default for example).
This patch adds a new warning that lets the user know that the libstdc++ include
path was not found to ensure that the user is more aware of why the error occurs.

rdar://40830462

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335063 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-19 17:56:03 +00:00
Nico Weber 3ffe6de5f1 s/LLVM_ON_WIN32/_WIN32/, clang
LLVM_ON_WIN32 is set exactly with MSVC and MinGW (but not Cygwin) in
HandleLLVMOptions.cmake, which is where _WIN32 defined too.  Just use the
default macro instead of a reinvented one.

See thread "Replacing LLVM_ON_WIN32 with just _WIN32" on llvm-dev and cfe-dev.
No intended behavior change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331069 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-27 19:11:14 +00:00
Petr Hosek da7d513709 [Frontend] Avoid including default system header paths on Fuchsia
These paths aren't used and don't make sense on Fuchsia.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@326542 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-02 07:19:42 +00:00
Fedor Sergeev b0e5924479 [Solaris] gcc toolchain handling revamp
Summary:
General idea is to utilize generic (mostly Generic_GCC) code
and get rid of Solaris-specific handling as much as possible.

In particular:
- scanLibDirForGCCTripleSolaris was removed, relying on generic
  CollectLibDirsAndTriples

- findBiarchMultilibs is now properly utilized to switch between
   m32 and m64 include & lib paths on Solaris

- C system include handling copied from Linux (bar multilib hacks)

Fixes PR24606.

Reviewers: dlj, rafael, jyknight, theraven, tstellar

Reviewed By: jyknight

Subscribers: aaron.ballman, mgorny, krytarowski, ro, joerg, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@323193 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-23 12:23:52 +00:00
Douglas Gregor c6d74ce7e8 Revert "Add /System/Library/PrivateFrameworks as a header search path."
This reverts commit f7a95215a4.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@314697 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-02 18:22:19 +00:00
Douglas Gregor f7a95215a4 Add /System/Library/PrivateFrameworks as a header search path.
Addresses rdar://problem/34438708.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313317 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-14 23:38:44 +00:00
Erich Keane 7d9f2d7ae0 Remove Bitrig: Clang Changes
Bitrig code has been merged back to OpenBSD, thus the OS has been abandoned.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308797 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-21 22:46:31 +00:00
Galina Kistanova 0ed287ec53 Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304645 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-03 06:27:16 +00:00
Alex Lorenz 35ec7f07b8 [Frontend] Fix an issue where a quoted search path is incorrectly
removed as a duplicate header search path

The commit r126167 started passing the First index into RemoveDuplicates, but
forgot to update 0 to First in the loop that looks for the duplicate. This
resulted in a bug where an -iquoted search path was incorrectly removed if you
passed in the same path into -iquote and more than one time into -isystem.

rdar://23991350

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288491 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-02 09:51:51 +00:00
Mehdi Amini 3353f9f983 Use StringRef for MemoryBuffer identifier API (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@283043 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-01 16:38:28 +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
Paul Robinson e57f2755bb [PS4] Change the names of some "environmental" things to what our
licensees actually see in the toolchain we deliver to them.  This will
reduce the set of local patches we have to maintain.  The triple is
not changing.  (The term ORBIS is an internal code name for PS4.)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269671 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 17:22:25 +00:00
Reid Kleckner ffe7e3ff08 Update clang support on recent Haiku
[ Copied from https://llvm.org/bugs/show_bug.cgi?id=26404 ]

clang support on Haiku is lagging a bit, and missing on x86_64.

This patch updates support for x86 and add support for x86_64. It should
apply directly to trunk and it's harmless in the sense that it only
affects Haiku.

Reviewers: rnk, rsmith

Patch by Jérôme Duval

Differential Revision: http://reviews.llvm.org/D16797

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269201 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-11 16:19:05 +00:00
Chandler Carruth 52996d2bc4 [ptr-traits] Add #includes of headers rather than forward declarations
for types which are used as pointees in PointerUnions, PointerIntPairs,
and DenseMap pointer keys.

This is part of a series of patches to allow LLVM to check for complete
pointee types when computing its pointer traits. This is absolutely
necessary to get correct (or reproducible) results for things like how
many low bits are guaranteed to be zero.

I think this is the last patch for getting Clang clean here!!!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@256615 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-30 03:40:23 +00:00
Dimitry Andric 8d4a5fa209 Fix C++ support on recent DragonFly BSD releases
Summary:
[ Copied from https://llvm.org/bugs/show_bug.cgi?id=25597 ]

Clang support for DragonFly BSD is lagging a bit, resulting in poor
support for c++.

DragonFlyBSD is unique in that it has two base compilers.  At the time
of the last Clang update for DragonFly, these compilers were GCC 4.4 and
GCC 4.7 (default).

With DragonFly Release 4.2, GCC 4.4 was replaced with GCC 5.0, partially
because the C++11 support of GCC 4.7 was incomplete.  The DragonFly
project will Release version 4.4 soon.

This patch updates the Clang driver to use libstdc++ from GCC 5.2 The
support for falling back to the alternate compiler was removed for two
reasons:

1) The last release to use GCC 4.7 is DF 4.0 which has already reached EOL
2) GCC 4.7 libstdc++ is insufficient for many "ports"

Therefore, I think it is reasonable that the development version of
clang expects GCC 5.2 to be in place and not try to fall back to another
compiler.

The attached patch will do this.  The Tools.cpp file was signficantly
modified to fix the linking which had been changed somewhere along the
line.  The rest of the changes should be self-explanatory.

Reviewers: joerg, rsmith, davide

Subscribers: jrmarino, davide, cfe-commits

Differential Revision: http://reviews.llvm.org/D15166

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@256467 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-27 10:01:44 +00:00
Andrey Bokhanko 791a40edf6 [x86] Exclusion of incorrect include headers paths for MCU target
Exclusion of /usr/include and /usr/local/include headers paths for MCU target.

Differential Revision: http://reviews.llvm.org/D14954


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@255766 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-16 13:27:38 +00:00
Filipe Cabecinhas 5d7c81cfa5 Bring back r250262: PS4 toolchain
There was a minor problem with a test. Sorry for the noise yesterday.

This patch adds missing pieces to clang, including the PS4 toolchain
definition, added warnings, PS4 defaults, and Driver changes needed for
our compiler.

A patch by Filipe Cabecinhas, Pierre Gousseau and Katya Romanova!

Differential Revision: http://reviews.llvm.org/D13482

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@250293 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-14 12:25:43 +00:00
Sean Silva 00a91779d6 Revert-to-green r250262 (PS4 toolchain patch)
It is breaking llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast
e.g. http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/1362

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@250273 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-14 06:45:07 +00:00
Ekaterina Romanova fb7d1d842e I took care of the build problem in the commit 250252.
Resubmitting the patch. 

This patch adds missing pieces to clang, including the PS4 toolchain
definition, added warnings, PS4 defaults, and Driver changes needed for
our compiler.

A patch by Filipe Cabecinhas, Pierre Gousseau and Katya Romanova!

Differential Revision: http://reviews.llvm.org/D13482



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@250262 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-14 01:09:02 +00:00
Ekaterina Romanova 08b6d449b7 reverting my patch, cause build problems
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@250257 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-14 00:03:20 +00:00
Ekaterina Romanova 1254d89521 This patch adds missing pieces to clang, including the PS4 toolchain
definition, added warnings, PS4 defaults, and Driver changes needed for
our compiler.

A patch by Filipe Cabecinhas, Pierre Gousseau and Katya Romanova!

Differential Revision: http://reviews.llvm.org/D13482



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@250252 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-13 23:40:02 +00:00
Yaron Keren ba5881e7bd C++11 rangify for loops, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249001 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-01 11:19:28 +00:00
Greg Bedwell fc7ebbf512 Revert "This patch adds missing pieces to clang, including the PS4 toolchain definition, added warnings, PS4 defaults, and Driver changes needed for our compiler."
This reverts commit r248546 to get our bot green again while we discuss the best way forward.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@248578 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-25 16:11:00 +00:00
Ekaterina Romanova 41604ec4c1 This patch adds missing pieces to clang, including the PS4 toolchain
definition, added warnings, PS4 defaults, and Driver changes needed for
our compiler.

A patch by Filipe Cabecinhas, Pierre Gousseau and Katya Romanova!

Differential Revision: http://reviews.llvm.org/D11279



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@248546 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-24 22:06:52 +00:00
Rafael Espindola 876e7c2866 [Solaris] Use the GCC Installation detector to add the C++ include paths.
Patch by Xan López!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247144 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-09 13:36:00 +00:00
Yaron Keren 99d997e97a Support mingw-w64 and mingw.org toolchains at any install location.
No more hardcoded paths: clang will use -sysroot as gcc root location if
provided. Otherwise, it will search for gcc on the path. If not found it
will use the driver installed location.

 http://reviews.llvm.org/D5268

Patch by Ruben Van Boxem, Martell Malone, Yaron Keren.
Reviewed by Reid Kleckner.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241241 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-02 04:45:27 +00:00
Benjamin Kramer b7b56528f9 Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial types
If the type isn't trivially moveable emplace can skip a potentially
expensive move. It also saves a couple of characters.


Call sites were found with the ASTMatcher + some semi-automated cleanup.

memberCallExpr(
    argumentCountIs(1), callee(methodDecl(hasName("push_back"))),
    on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))),
    hasArgument(0, bindTemporaryExpr(
                       hasType(recordDecl(hasNonTrivialDestructor())),
                       has(constructExpr()))),
    unless(isInTemplateInstantiation()))

No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238601 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-29 19:42:19 +00:00
Derek Schuff 1d94133561 Add driver support for Native Client SDK
Add Tool and ToolChain support for clang to target the NaCl OS using the NaCl
SDK for x86-32, x86-64 and ARM.

Includes nacltools::Assemble and Link which are derived from gnutools. They
are similar to Linux but different enought that they warrant their own class.
Also includes a NaCl_TC in ToolChains derived from Generic_ELF with library
and include paths suitable for an SDK and independent of the system tools.

Differential Revision: http://reviews.llvm.org/D8590

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233594 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 20:31:33 +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
Ed Schouten e35c8f1192 Fix up default header paths for CloudABI.
CloudABI is a pure cross compilation target. This means that we should
not add /usr/include and /usr/local/include. Instead, headers are stored
in $sysroot/$triple/include.

The method of going back to the sysroot (by using "../../..") is also
used in this function for some of the other environments (e.g., MinGW).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@231913 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 08:46:01 +00:00
Eric Christopher b0c1091c1b Use isOSBinFormatMachO() instead of comparing the object format
against an enum.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223422 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05 00:22:48 +00:00
David Blaikie f8fdd74444 Update for LLVM API change to make Small(Ptr)Set::insert return pair<iterator, bool> as per the C++ standard's associative container concept.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222335 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-19 07:49:47 +00:00
Sylvestre Ledru 01af2ae2cd Add the break in the switch case (even if there is llvm_unreachable. It will silent coverity warning CID 1231654
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215897 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-18 15:13:44 +00:00
Rafael Espindola 7e5485ce09 Delete support for AuroraUX.
auroraux.org is not resolving.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215644 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-14 15:14:51 +00:00
Tim Northover eb8c2c992e AArch64: update Clang for merged arm64/aarch64 triples.
The main subtlety here is that the Darwin tools still need to be given "-arch
arm64" rather than "-arch aarch64". Fortunately this already goes via a custom
function to handle weird edge-cases in other architectures, and it tested.

I removed a few arm64_be tests because that really isn't an interesting thing
to worry about. No-one using big-endian is also referring to the target as
arm64 (at least as far as toolchains go). Mostly they date from when arm64 was
a separate target and we *did* need a parallel name simply to test it at all.
Now aarch64_be is sufficient.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213744 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-23 12:32:58 +00:00
Bob Wilson 38193396ad Fix crash with x86_64-pc-win32-macho target. <rdar://problem/17235840>
The changes in r204978 broke win32-macho targets. There were checks added for
MSVC and Itanium environments as special cases, and win32-macho needs to be
treated the same way.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210584 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-10 21:07:12 +00:00
Tim Northover 8d681a2f93 AArch64/ARM64: rename ARM64 components to AArch64
This keeps Clang consistent with backend naming conventions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209579 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-24 12:52:07 +00:00
Tim Northover 7e0e8ef787 ARM64: initial clang support commit.
This adds Clang support for the ARM64 backend. There are definitely
still some rough edges, so please bring up any issues you see with
this patch.

As with the LLVM commit though, we think it'll be more useful for
merging with AArch64 from within the tree.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205100 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-29 15:09:45 +00:00
Saleem Abdulrasool 1e57f17deb Use the new Windows environment for target detection
This follows the LLVM change to canonicalise the Windows target triple
spellings.  Rather than treating each Windows environment as a single entity,
the environments are now modelled properly as an environment.  This is a
mechanical change to convert the triple use to reflect that change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204978 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-27 22:50:18 +00:00
Roman Divacky 2a27efa915 Dont unconditionally add gcc4.2 include paths on FreeBSD.
Newer FreeBSD doesnt ship with gcc and defaults to using libc++.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203700 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-12 19:32:42 +00:00
Hans Wennborg d0f57d66d4 Check for LLVM_ON_WIN32 instead of _WIN32.
This is a follow-up to r203624 to address Anton's comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203668 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-12 16:07:46 +00:00
Yaron Keren 92a148049e With the new update to the ABI, we should not look for installations
of MinGW older than 4.7 with incompatible C++ libraries.

This patch makes clang look for all MinGW versions from 4.7:

  4.7.0, 4.7.1, 4.7.2, 4.7.3
  4.8.0, 4.8.1, 4.8.2.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197176 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-12 20:30:41 +00:00
Justin Bogner c3e16a2f1c Darwin: Look for libc++ headers in include/, rather than lib/
Up until now we were expecting that when libc++ is installed alongside
clang the headers would be in lib/, which was true if the configure
build was used and false if the cmake build was.

We've now corrected the configure build to install in include/, and
with this change we'll be able to find the correct headers with both
build systems.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194834 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-15 18:07:59 +00:00
Hans Wennborg 5ff6c11545 Add another MinGW header include path
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192982 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-18 15:48:58 +00:00
NAKAMURA Takumi dcc520ebc7 InitHeaderSearch.cpp: [Cygwin] Add 4.7.3.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188638 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-18 15:03:03 +00:00
Benjamin Kramer 0b214905f7 Modernize some low-hanging PathV1 uses.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183903 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-13 14:26:04 +00:00
Rafael Espindola 34392373fe Include PathV1.h in files that use it.
This is preparation for replacing Path.h with PathV2.h.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183781 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-11 19:59:07 +00:00