Commit Graph

194 Commits

Author SHA1 Message Date
Joerg Sonnenberger 428ef1e368 Add support for -stdlib=libc++ in the NetBSD toolchain.
llvm-svn: 180766
2013-04-30 01:21:43 +00:00
John McCall 65b8da0623 Fix the driver logic for recent versions of DragonFly.
Patch by John Marino.

llvm-svn: 179334
2013-04-11 22:55:55 +00:00
Daniel Dunbar c6c2375317 [Frontend] Factor AddUnmappedPath() out of AddPath() and simplify.
llvm-svn: 173871
2013-01-30 01:06:03 +00:00
Daniel Dunbar 9f2374565e [Frontend] Add an ExternCSystem include entry group.
- The only group where it makes sense for the "ExternC" bit is System, so this
   simplifies having to have the extra isCXXAware (or ImplicitExternC, depending
   on what code you talk to) bit caried around.

llvm-svn: 173859
2013-01-30 00:19:24 +00:00
Daniel Dunbar f79ee383ac [Frontend] Make the include dir group independent from the "use sysroot" bit.
- This slightly decouples the path handling, since before the group sometimes
   dominated the "use sysroot" bit, but it was still passed in via the API.

 - No functionality change.

llvm-svn: 173855
2013-01-29 23:59:45 +00:00
Daniel Dunbar 335a37b7e0 [Frontend] Rename a member variable to clarify its intent.
llvm-svn: 173854
2013-01-29 23:59:43 +00:00
Daniel Dunbar 2e8eb01a71 [Frontend] Factor out helper function, for clarity.
llvm-svn: 173853
2013-01-29 23:59:37 +00:00
Daniel Dunbar 6b04f1d1be [Frontend] Drop the isUserSupplied argument to InitHeaderSearch, it is unused.
llvm-svn: 173411
2013-01-25 01:50:39 +00:00
Daniel Dunbar ae4feb62e0 [Lex] Remove DirectoryLookup.UserSpecified, which is unused.
llvm-svn: 173409
2013-01-25 01:50:28 +00:00
Chandler Carruth 3a02247dc9 Sort all of Clang's files under 'lib', and fix up the broken headers
uncovered.

This required manually correcting all of the incorrect main-module
headers I could find, and running the new llvm/utils/sort_includes.py
script over the files.

I also manually added quite a few missing headers that were uncovered by
shuffling the order or moving headers up to be main-module-headers.

llvm-svn: 169237
2012-12-04 09:13:33 +00:00
Douglas Gregor b85b9ccb76 Move HeaderSearchOptions into the Lex library, make it intrusively
reference-counted, and hold a reference to it in HeaderSearch.

llvm-svn: 166583
2012-10-24 16:19:39 +00:00
NAKAMURA Takumi 4a7a5610ce InitHeaderSearch.cpp: [mingw] Handle DOSish paths only on Win32 hosts.
llvm-svn: 163776
2012-09-13 05:53:23 +00:00
Eli Friedman 9fa2885522 clang support for Bitrig (an OpenBSD fork); patch by David Hill.
llvm-svn: 161546
2012-08-08 23:57:20 +00:00
Hans Wennborg ae298f2c08 Correct AddDefaultCIncludePaths for OpenBSD to not include /usr/local/include
in the default search path. Compilers on *BSD OS's only include /usr/include by
default.

Contributed by Brad Smith <brad@comstyle.com>

llvm-svn: 161173
2012-08-02 12:27:08 +00:00
Richard Smith 8acadcb84b Add -isystem-prefix and -ino-system-prefix arguments, which can be used to
override whether headers are system headers by checking for prefixes of the
header name specified in the #include directive.

This allows warnings to be disabled for third-party code which is found in
specific subdirectories of include paths.

llvm-svn: 158418
2012-06-13 20:27:03 +00:00
Aaron Ballman eceaddc864 Since this change is generating a considerable amount of discussion (and possibly even a regression for known bad versions), I'm reverting it.
llvm-svn: 153420
2012-03-25 22:46:17 +00:00
Aaron Ballman 9345d68ff7 No longer hard coding paths to the MinGW include directories; using a regular expression instead.
Patch thanks to Nikola Smiljanic

llvm-svn: 153413
2012-03-25 15:47:41 +00:00
Aaron Ballman 564acc9b0f Adding in newer MinGW header paths.
Patch thanks to Nikola Smiljanic

llvm-svn: 152801
2012-03-15 14:31:30 +00:00
David Chisnall e04307e47c Add the Solaris support directory to the header search when using libc++.
Unconditionally define __C99FEATURES__ when using C++ on Solaris.  This is a
(hopefully temporary) work around for libc++ exposing C99-but-not-C++98
features in C++98 mode.

llvm-svn: 151889
2012-03-02 10:49:52 +00:00
David Chisnall 0c52c0f0fd Some more Solaris fixes. Now successfully building libc++ on Solaris with clang (and linking clang against it).
llvm-svn: 151632
2012-02-28 17:10:04 +00:00
David Chisnall 1026fb0797 Add some Solaris include paths and fix a -lgcc_eh that apparently should be -lgcc_s.
llvm-svn: 150602
2012-02-15 18:24:31 +00:00
Dylan Noblesmith 4d9cbffbe2 include clang's config.h unconditionally (v2)
And remove HAVE_CLANG_CONFIG_H, now that the header is generated
in the autoconf build, too.

Reverts r149571/restores r149504, now that config.h is generated
correctly by LLVM's configure in all build configurations.

llvm-svn: 150487
2012-02-14 15:54:49 +00:00
Dylan Noblesmith 2c1dd2716a Basic: import SmallString<> into clang namespace
(I was going to fix the TODO about DenseMap too, but
that would break self-host right now. See PR11922.)

llvm-svn: 149799
2012-02-05 02:13:05 +00:00
Rafael Espindola c29af947d6 Replace the old --with-cxx-* configure options with a single --with-gcc-toolchain
that just uses the new toolchain probing logic. This fixes linking with -m32 on
64 bit systems (the /32 dir was not being added to the search).

llvm-svn: 149652
2012-02-03 01:01:20 +00:00
Douglas Gregor 3ec6663be0 Back out my heinous hack that tricked the module generation mechanism
into using non-absolute system includes (<foo>)...

... and introduce another hack that is simultaneously more heineous
and more effective. We whitelist Clang-supplied headers that augment
or override system headers (such as float.h, stdarg.h, and
tgmath.h). For these headers, Clang does not provide a module
mapping. Instead, a system-supplied module map can refer to these
headers in a system module, and Clang will look both in its own
include directory and wherever the system-supplied module map
suggests, then adds either or both headers. The end result is that
Clang-supplied headers get merged into the system-supplied module for
the C standard library.

As a drive-by, fix up a few dependencies in the _Builtin_instrinsics
module.

llvm-svn: 149611
2012-02-02 18:42:48 +00:00
Dylan Noblesmith 4f4e745725 back out r149504
Too many weird build failures.

llvm-svn: 149571
2012-02-02 00:40:14 +00:00
Dylan Noblesmith 86780e906b include clang's config.h unconditionally
And remove HAVE_CLANG_CONFIG_H, now that the header is generated
in the autoconf build, too. (clang r149497 / llvm r149498)

Also include the config.h header after all other headers, per
the LLVM coding standards.

It also turns out WindowsToolChain.cpp wasn't using the config
header at all, so that include's just deleted now.

llvm-svn: 149504
2012-02-01 14:25:28 +00:00
NAKAMURA Takumi eb3f454a67 lib/Frontend/InitHeaderSearch.cpp: [Cygwin] Add 4.5.3.
llvm-svn: 148637
2012-01-21 14:46:07 +00:00
NAKAMURA Takumi 44193b732e [Cygwin] Abandon Cygwin-1.5 and g++-3. Use g++-4.3 and higher on Cygwin-1.7.
llvm-svn: 148636
2012-01-21 14:46:01 +00:00
Eli Friedman b0692cb858 Add a couple more GCC versions to C++ search paths for MinGW. Patch by Ruben Van Boxem.
(We should probably start doing some sort of autodetection like we do on Linux at some point.)

llvm-svn: 145326
2011-11-28 23:58:55 +00:00
Chandler Carruth a796f53821 Move the Linux header searching from the Frontend to the Driver. This is
the first (and diff-noisiest) step to making Linux header searching
tremendously more principled and less brittle. Note that this step
should have essentially no functional impact. We still search the exact
same set of paths in the exact same order. The only change here is where
the code implementing such a search lives.

This has one obvious negative impact -- we now pass a ludicrous number
of flags to the CC1 layer. That should go away as I re-base this logic
on the logic to detect a GCC installation. I want to do this in two
phases so the bots can tell me if this step alone breaks something, and
so that the diffs of the refactoring make more sense.

llvm-svn: 143822
2011-11-05 20:17:13 +00:00
Chandler Carruth 611cb64453 Add two flags to the CC1 layer that I was hoping to avoid. We need to
encode the *exact* semantics which the header search paths internally
built by the Frontend layer have had, which is both non-user-provided,
and at times adding the implicit extern "C" bit to the directory entry.

There are lots of CC1 options that are very close, but none do quite
this, and they are all already overloaded for other purposes. In some
senses this makes the command lines more clean as it clearly indicates
which flags are exclusively used to implement internal detection of
"standard" header search paths.

Lots of the implementation of this is really crufty, due to the
surrounding cruft. It doesn't seem worth investing lots of time cleaning
this up as it isn't new, and hopefully *lots* of this code will melt
away as header search inside of the frontend becomes increasingly
trivial.

llvm-svn: 143798
2011-11-05 08:30:29 +00:00
Chandler Carruth df52783e32 Begin the migration of header search logic to the driver, starting with
Windows. There are still FIXMEs and lots of problems with this code.
Some of them will be addressed shortly by my follow-up patches, but most
are going to wait until we isolate this code and can fix it properly.
This version should be no worse than what we had before.

llvm-svn: 143752
2011-11-04 23:49:05 +00:00
Chandler Carruth e0a89ab702 Add the newest Gentoo GCC version based on the reported installed
version in PR11298.

I hear-by apologize for adding yet more code to this monstrosity.

llvm-svn: 143567
2011-11-02 20:09:56 +00:00
Chandler Carruth 68ed0ae51c Add "just one more" include path to the monstrosity that is our header
search logic. The Debian multiarch seems to have completely changed from
when these were originally added, and I'd like to remove a bunch of
them, but I'll be lazy and delay that until this logic is hoisted into
the driver where it belongs.

This should resolve PR11223.

llvm-svn: 143345
2011-10-31 08:42:27 +00:00
Daniel Dunbar b25bfde52d Frontend: Replace -nostdinc by -nostdsysteminc (which is just system include
paths). The -nostdinc behavior is now -nostdsysteminc + -nobuiltininc.

llvm-svn: 141691
2011-10-11 18:20:10 +00:00
Chad Rosier fd3c90c620 When an included non-system directory duplicates a system directory the clang
frontend removes the non-system directory to maintain gcc compatibility.  When
this happens NumAngled needs to be updated.
PR11097

llvm-svn: 141565
2011-10-10 18:44:24 +00:00
Justin Holewinski 83aacf82e7 Fix include path detection on Fedora 15 with GCC 4.6.1. Patch by Arthur Haas.
llvm-svn: 141086
2011-10-04 15:35:52 +00:00
Benjamin Kramer 559865c89d Reenable -cxx-isystem for Objective C++, until I come up with a better solution
llvm-svn: 140365
2011-09-23 02:25:14 +00:00
Benjamin Kramer 8404eb0bad Add support for CPATH and friends.
This moves the existing code for CPATH into the driver and adds the environment lookup and path splitting there.
The paths are then passed down to cc1 with -I options (CPATH), added after the normal user-specified include dirs.
Language specific paths are passed via -LANG-isystem and the actual filtering is performed in the frontend.

I tried to match GCC's behavior as close as possible

Fixes PR8971.

llvm-svn: 140341
2011-09-22 21:41:16 +00:00
Douglas Gregor 1735f4e752 For modules, use a hash of the compiler version, language options, and
target triple to separate modules built under different
conditions. The hash is used to create a subdirectory in the module
cache path where other invocations of the compiler (with the same
version, language options, etc.) can find the precompiled modules.

llvm-svn: 139662
2011-09-13 23:15:45 +00:00
Douglas Gregor 1e44e02292 Introduce a cc1-level option to provide the path to the module cache,
where the compiler will look for module files. Eliminates the
egregious hack where we looked into the header search paths for
modules.

llvm-svn: 139538
2011-09-12 20:41:59 +00:00
Eli Friedman d62d51c84d Some minor updates to the Linux search path handling for Slackware. Patch by Will Dietz. PR10692.
llvm-svn: 138753
2011-08-29 18:56:43 +00:00
Nico Weber 80806a7b91 Add Gentoo gcc 4.3.4 include paths
llvm-svn: 137834
2011-08-17 17:55:30 +00:00
Douglas Gregor f4016fdf71 On Darwin, libc++ may be installed alongside the compiler in
lib/c++/v1. Look there first, before falling back to the normal
/usr/include/c++/v1. <rdar://problem/9866149>

llvm-svn: 136507
2011-07-29 20:21:18 +00:00
Douglas Gregor 9f93e38aaf Introduce the "-index-header-map" option, to give special semantics
for quoted header lookup when dealing with not-yet-installed
frameworks. Fixes <rdar://problem/9824020>.

llvm-svn: 136331
2011-07-28 04:45:53 +00:00
Chris Lattner 0e62c1cc0b remove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports
them into the clang namespace.

llvm-svn: 135852
2011-07-23 10:55:15 +00:00
Francois Pichet 8e122b9fca Do not modify string returned by getenv on Windows.
Fixes PR9875, patch by Nikola Smiljanic!

llvm-svn: 135356
2011-07-16 21:17:14 +00:00
Douglas Gregor c750b6c436 Update header-search paths for MinGW, from Ruben Van Boxem
llvm-svn: 134406
2011-07-05 14:16:05 +00:00
Chandler Carruth 42f96b78ec Make the GCC version proliferation worse by N+1 for the sake of
ArchLinux. =/ Fixes PR10246.

llvm-svn: 134299
2011-07-02 00:51:03 +00:00