Commit Graph

235 Commits

Author SHA1 Message Date
Joerg Sonnenberger 9c8ad5fe02 Explicitly initialize CCCIsCPP
llvm-svn: 127139
2011-03-07 00:09:32 +00:00
Joerg Sonnenberger b86f5f4106 If called as *cpp or *cpp-[^-]*, run only the preprocessor. If no
input is specified, use stdin implicitly. Based on a patch from
Roman Divacky.

llvm-svn: 127137
2011-03-06 23:31:01 +00:00
Anton Korobeynikov a9ff8576fb Normalize target triple passed out of driver. Basically this means
that at cc1 level we will always have normalized triple and thus can
provide necessary default based on e.g. environment value (e.g. for
"arm-eabi" triple, etc.)

llvm-svn: 127087
2011-03-05 16:05:17 +00:00
NAKAMURA Takumi 31ea2f14bc Triple::MinGW64 is deprecated and removed. We can use Triple::MinGW32 instead.
No one uses *-mingw64. mingw-w64 is represented as {i686|x86_64}-w64-mingw32.

llvm-svn: 125742
2011-02-17 08:51:38 +00:00
Benjamin Kramer 1a648d1930 Allow multiple -B prefixes. Patch by Joerg Sonnenberger.
llvm-svn: 125111
2011-02-08 20:31:42 +00:00
Oscar Fuentes edeaf16f2c Moved here from LLVM Clang's configuration options and related macros.
llvm-svn: 124825
2011-02-03 22:48:20 +00:00
Daniel Dunbar ac540b3859 clang: Add support for a CC_PRINT_HEADERS environment variable, which mirrors
CC_PRINT_OPTIONS and can be used to get some out-of-band information on header
usage from a build.

llvm-svn: 124751
2011-02-02 21:11:35 +00:00
Benjamin Kramer 24f1d3e60a Add NetBSD target support. Patch by Joerg Sonnenberger.
llvm-svn: 124736
2011-02-02 18:59:27 +00:00
Daniel Dunbar e26e500b79 Driver: Change -dumpversion to return a GCC compatible answer.
- See comment for why.

llvm-svn: 123296
2011-01-12 00:43:47 +00:00
Michael J. Spencer f6efe58d45 Replace all uses of PathV1::exists with PathV2::fs::exists.
llvm-svn: 123150
2011-01-10 02:34:13 +00:00
Michael J. Spencer e47230f9b5 Replace all uses of PathV1::get{Basename,Dirname,Suffix} with their PathV2 equivalents.
llvm-svn: 122140
2010-12-18 04:13:32 +00:00
Michael J. Spencer e169675474 Replace all uses of PathV1::getLast with PathV2::filename.
llvm-svn: 122117
2010-12-18 00:19:12 +00:00
Eric Christopher 62a78b04a8 Going back to the drawing board with these two awful hacks.
llvm-svn: 122096
2010-12-17 22:46:41 +00:00
Michael J. Spencer 1a4fe8c991 Fix spelling.
llvm-svn: 122088
2010-12-17 21:22:33 +00:00
Michael J. Spencer f28df4cdba Replace all uses of PathV1::isAbsolute with PathV2::is_{absolute,relative}.
llvm-svn: 122087
2010-12-17 21:22:22 +00:00
Eric Christopher 4698e938b1 Horrible hack for systems that use -dumpversion with clang to expect versions
that match gcc versions. Eew.

llvm-svn: 122080
2010-12-17 19:13:21 +00:00
Daniel Dunbar 86aed7d5fc Driver: M and MM should be grouped together, <rdar://problem/8744831>.
llvm-svn: 121284
2010-12-08 21:33:40 +00:00
Michael J. Spencer 8aaf49959c Merge System into Support.
llvm-svn: 120297
2010-11-29 18:12:39 +00:00
Argyrios Kyrtzidis 31448a415e Use hasErrorOccurred() instead of getNumErrors() where it makes sense.
llvm-svn: 119746
2010-11-18 21:47:07 +00:00
Argyrios Kyrtzidis d004064864 Refactoring of Diagnostic class.
-Move the stuff of Diagnostic related to creating/querying diagnostic IDs into a new DiagnosticIDs class.
-DiagnosticIDs can be shared among multiple Diagnostics for multiple translation units.
-The rest of the state in Diagnostic object is considered related and tied to one translation unit.
-Have Diagnostic point to the SourceManager that is related with. Diagnostic can now accept just a
   SourceLocation instead of a FullSourceLoc.
-Reflect the changes to various interfaces.

llvm-svn: 119730
2010-11-18 20:06:41 +00:00
Argyrios Kyrtzidis 71731d6b05 Implement -working-directory.
When -working-directory is passed in command line, file paths are resolved relative to the specified directory.
This helps both when using libclang (where we can't require the user to actually change the working directory)
and to help reproduce test cases when the reproduction work comes along.

--FileSystemOptions is introduced which controls how file system operations are performed (currently it just contains
 the working directory value if set).
--FileSystemOptions are passed around to various interfaces that perform file operations.
--Opening & reading the content of files should be done only through FileManager. This is useful in general since
 file operations will be abstracted in the future for the reproduction mechanism.

FileSystemOptions is independent of FileManager so that we can have multiple translation units sharing the same
FileManager but with different FileSystemOptions.

Addresses rdar://8583824.

llvm-svn: 118203
2010-11-03 22:45:23 +00:00
Chandler Carruth 06067c556a Use CLANG_RESOURCE_DIR define if one is provided, otherwise use the default of
'../lib/clang/<version>'. Actually use '..' rather than removing the trailing
component to correctly handle paths containing '.' or symlinks in the presence
of -no-canonical-prefixes, etc. This shouldn't change any existing behavior.

llvm-svn: 116803
2010-10-19 08:47:51 +00:00
NAKAMURA Takumi 89acd1e7ef lib/Driver/Driver.cpp: Use the driver g++-4 for Cygwin-1.5.
llvm-svn: 116183
2010-10-11 02:28:42 +00:00
Nick Lewycky 6e1ce29b01 Revert r114712 due to failure on darwin buildbot.
llvm-svn: 114713
2010-09-24 00:46:53 +00:00
Nick Lewycky e351fed104 Make -M/-MM behave like in gcc; use -MF first then -o else use stdout.
llvm-svn: 114712
2010-09-23 23:49:25 +00:00
Nick Lewycky e47c245b90 Fix header comment so we don't break emacs.
llvm-svn: 114711
2010-09-23 23:48:20 +00:00
Shantonu Sen afeb03b41d Driver: implement driver automagic support for -lcc_kext
Rewrite linker arguments to use libclang_rt.cc_kext.a
instead of gcc-specific libcc_kext.a

Resolves Radar 7808495

llvm-svn: 114193
2010-09-17 18:39:08 +00:00
Daniel Dunbar 1b09e04f9e Driver: Support -dumpmachine.
llvm-svn: 114155
2010-09-17 02:47:28 +00:00
Daniel Dunbar 2cc3f17a26 Driver: Add magic handling for "reserved library names", starting with
-lstdc++. This is the best gross solution for a gross problem.

This issue is that historically, GCC has add -L options to its internally
library directories. This has allowed users and platforms to end up depending on
the layout of GCC's internal library directories.

We want to correct this mistake by eliminating that -L, but this means that
existing libraries which are in the GCC lib dir won't be found. We are going to
handle this by treating those -l names as "reserved", and requiring toolchains
to know how to add the right full path to the reserved library.

The immediately side effect of this is that users trying to use -L to find their
own -lstdc++ will need to start using -nostdlib (which is a good idea
anyway). Another side effect is that -stdlib=libc++ -lstdc++ will now do the
"right" thing, for curious definitions of right.

llvm-svn: 114144
2010-09-17 00:45:02 +00:00
Rafael Espindola b2d0d40c3d Make "-ccc-cxx" option work on Linux.
Patch by nobled.

I also took the opportunity to make the field private since now it is only ready from the
outside.

llvm-svn: 113138
2010-09-06 02:36:23 +00:00
Daniel Dunbar 5d3b70a6fc Driver: Update -ccc-install-dir to also set the installed dir. Totally
non-obvious.

llvm-svn: 111838
2010-08-23 20:58:50 +00:00
Michael J. Spencer b186bc3c4b Visual Studio tools used on win32 hosts when targeting win32.
llvm-svn: 111748
2010-08-21 21:55:07 +00:00
Daniel Dunbar b613ffc1aa Driver: Claim the -mlinker-version synthesized argument, it shouldn't be
reported as unused.

llvm-svn: 111310
2010-08-17 22:32:45 +00:00
Daniel Dunbar 628fcf4e3b Driver: Use the compile time linker version as the default for -mlinker-version,
if detected.
 - This is a hack, we really want the linker version at execution time, but we
   don't have any infrastructure for getting that. Yet.

llvm-svn: 110886
2010-08-12 00:05:12 +00:00
Daniel Dunbar a73a9845e2 Driver: Have -ccc-host-triple simply override the default in the driver, for
now.

llvm-svn: 110027
2010-08-02 05:44:04 +00:00
Daniel Dunbar cc7df6cc7b Driver: Move HostInfo::lookupTypeForExtension to ToolChain::LookupTypeForExtension.
llvm-svn: 110024
2010-08-02 05:43:56 +00:00
Daniel Dunbar a36c2b3a62 Driver: Give Build{Universal,}Actions access to the default host tool chain. I
avoided this originally to enforce that the driver actions aren't toolchain
dependent, but it isn't worth the cumbersone additional hostinfo split.

llvm-svn: 110023
2010-08-02 05:43:51 +00:00
Daniel Dunbar 7fbaf53470 Driver: Add Compilation::addCommand and switch tools to using it, now that we
don't have to deal with nested jobs.

llvm-svn: 110015
2010-08-02 02:38:28 +00:00
Daniel Dunbar d00272f6d6 Driver: Simplify.
llvm-svn: 110011
2010-08-02 02:38:15 +00:00
Daniel Dunbar c12a412cb6 Driver: Eliminate now unused argument.
llvm-svn: 110010
2010-08-02 02:38:12 +00:00
Daniel Dunbar 89f791e2c2 Driver: Simplify logic for sending 'clang -E t.c' output to stdout.
llvm-svn: 110009
2010-08-02 02:38:08 +00:00
Daniel Dunbar a7dd15888b Driver: Never try to use piped inputs.
llvm-svn: 110008
2010-08-02 02:38:06 +00:00
Daniel Dunbar 926f81fce5 Driver: Start ripping out support for -pipe, which is worthless and complicates
too many other things.

llvm-svn: 110007
2010-08-02 02:38:03 +00:00
Daniel Dunbar e38764c66c Driver: Change the driver to take the path to the main executable, instead of
taking it in pieces.
 - Fixes a problem where the Clang executable path was not initialized properly
   on Win32, because sys::Path::getBasename() doesn't do what I always think it
   does. Imagine that, a sys::Path interface that is confusing!

llvm-svn: 108667
2010-07-19 00:44:04 +00:00
Daniel Dunbar 9765b9817d Driver: When re'execing clang, use path to the main executable instead of
looking up Clang in the normal search paths (which may end up finding the wrong
clang).

llvm-svn: 108346
2010-07-14 18:46:27 +00:00
Chris Lattner 3e2ee147d0 add driver support for minix, patch by Kees van Reeuwijk
from PR7583

llvm-svn: 107788
2010-07-07 16:01:42 +00:00
Daniel Dunbar 00d3d8e902 Driver/Darwin: Only run dsymutil when we are also compiling/assembling as part
of the compilation.
 - <rdar://problem/8141387> clang is always invoking dsymutil

llvm-svn: 107149
2010-06-29 16:38:33 +00:00
Daniel Dunbar 3648ba756f Driver: Support -Wp,-MMD,FOO, which I found an instance of. :(
llvm-svn: 106039
2010-06-15 20:30:18 +00:00
Daniel Dunbar 5a9d1835be Driver: Fix PR4062 by dissecting one particular -Wp, form.
llvm-svn: 105966
2010-06-14 21:37:09 +00:00
Daniel Dunbar fb3d747fc6 Driver: Dissect -Wl, and -Xlinker arguments to remove --no-demangle, which was a
collect2 option that is passed by some projects (notably WebKit).

llvm-svn: 105964
2010-06-14 21:23:12 +00:00