Bob Wilson
05de0298d2
Rip out flags for controlling C++ "production mode" separately.
...
This is old leftover cruft from the days when C++ was not yet ready
for prime time.
llvm-svn: 141063
2011-10-04 05:34:14 +00:00
Daniel Dunbar
920844c36e
Revert my --working-directory option, which wasn't well thought through.
...
llvm-svn: 140889
2011-09-30 21:33:09 +00:00
Benjamin Kramer
fcfb53d5a5
Driver: Fix two bad typos that were breaking the buildbots.
...
llvm-svn: 140682
2011-09-28 05:33:02 +00:00
David Chisnall
ddbd68fbd2
Check for GCC paths that have the target triple in them. This is required for a lot of cross-compile toolchains. Also add some slightly better support for -B.
...
llvm-svn: 140645
2011-09-27 22:03:18 +00:00
David Blaikie
9c902b5502
Rename Diagnostic to DiagnosticsEngine as per issue 5397
...
llvm-svn: 140478
2011-09-25 23:23:43 +00:00
Daniel Dunbar
eb5348ac31
Driver: Use sys::Process::SetWorkingDirectory, for consistency.
...
llvm-svn: 140434
2011-09-23 23:32:02 +00:00
Benjamin Kramer
333198cbd7
Driver: Explicitly include <unistd.h>, libstdc++'s <map> pulls it in, libc++ doesn't.
...
Also, on windows, chdir seems to live in <direct.h>.
llvm-svn: 140414
2011-09-23 21:03:19 +00:00
Daniel Dunbar
10d398f894
Driver: Add a --working-directory option which can be used to cause the compiler
...
to operate "as if" in a certain working directory.
- For now, we just implement this by changing the actual working directory, but
eventually we would want to handle this transparently. This is useful to
avoid an extra exec() pair in some situations, and will be something we would
want to support for more flexibility in using the Clang libraries.
llvm-svn: 140409
2011-09-23 20:33:41 +00:00
David Blaikie
aa347f9392
Removing a bunch of dead returns/breaks after llvm_unreachables.
...
llvm-svn: 140407
2011-09-23 20:26:49 +00:00
David Blaikie
7900020616
More missing header inclusions from llvm_unreachable migration.
...
llvm-svn: 140369
2011-09-23 05:57:42 +00:00
David Blaikie
83d382b1ca
Switch assert(0/false) llvm_unreachable.
...
llvm-svn: 140367
2011-09-23 05:06:16 +00:00
Chad Rosier
8230116066
[driver] Add support for the COMPILER_PATH environment variable, which adds the
...
specified path(s) to the list of prefix directories.
rdar://10097714
llvm-svn: 139677
2011-09-14 00:47:55 +00:00
Chad Rosier
e75ef40843
[driver] When clang crashes, don't try to generate diagnostics (i.e.,
...
preprocessor output) with multiple -arch options.
llvm-svn: 139207
2011-09-06 23:52:36 +00:00
Peter Collingbourne
fa9771ffec
Add the resource directory to the search path for Driver::GetFilePath,
...
as well as the search path printed by -print-search-dirs.
The main purpose of this change is to cause -print-file-name=include
to print the path to the include directory under Clang's resource
directory, instead of the system compiler's include directory, whose
header files Clang may not be able to parse. Some build scripts will
do something like:
$(CC) -nostdinc -I`$(CC) -print-file-name=include`
to exclude all header paths except the compiler's.
llvm-svn: 139127
2011-09-06 02:08:31 +00:00
Chad Rosier
97c373793b
Cleanup r138662 per Ben and David's suggestions, thanks.
...
llvm-svn: 138670
2011-08-26 22:27:02 +00:00
Chad Rosier
f0be551d68
Make sure the std::string isn't deallocated prior to use. Many thanks to Eli
...
for catching this.
llvm-svn: 138666
2011-08-26 21:47:20 +00:00
Chad Rosier
39ab743e59
[driver] When generating temporary files allow a prefix to be added. In many
...
cases we want the prefix to be the original file name less the suffix. For an
input such as test.c to named temporary would be something like test-3O4Clq.o
Part of <rdar://problem/8314451>
llvm-svn: 138662
2011-08-26 21:28:44 +00:00
Chad Rosier
160276dc93
[driver] Do not add -kext to the link command line when compiling with
...
-fapple-kext.
Fixes <rdar://problem/10013310>. Reverts <rdar://problem/7809940>.
llvm-svn: 138564
2011-08-25 17:33:03 +00:00
Eric Christopher
551ef45e85
Add support for a verifier to the driver. Currently only verifies debug
...
output on darwin so is hard coded there.
As a note this will need a little bit of refactoring in the class
hierarchy to separate it out for different verifiers based on input type.
Fixes rdar://8256258.
llvm-svn: 138343
2011-08-23 17:56:55 +00:00
Chad Rosier
d57133dcca
[driver] Don't generate diagnostics (i.e., preprocessed source) if reading
...
from stdin. This allows Eli and the like to continue with their debugging
trickery without loss of limb (or car) on my part. :)
llvm-svn: 137906
2011-08-18 00:22:25 +00:00
Chad Rosier
6fdf38bfbd
Fix else style. No functionality change intended.
...
llvm-svn: 137896
2011-08-17 23:08:45 +00:00
Eric Christopher
f901e85533
Fix typo.
...
llvm-svn: 137893
2011-08-17 22:59:59 +00:00
Chad Rosier
4f81fc21a0
[driver] When generating clang failure diagnostics, don't try to preprocess
...
inputs that aren't preprocessable.
llvm-svn: 137532
2011-08-12 23:30:05 +00:00
Chad Rosier
ecdede8f5f
[driver] Refactor a bit to enable a few fixes when generating diagnostics. No functional change intended.
...
llvm-svn: 137524
2011-08-12 22:08:57 +00:00
Chad Rosier
7b15b2e828
Fix cmake for r136702 (at least for the most part). Chandler has been kind
...
enough to offer to investigate the underlying issue. Thanks to Doug for his
assistance as well.
llvm-svn: 136719
2011-08-02 20:44:34 +00:00
Chad Rosier
edbb3ef902
Temporarily revert parts of r136702 to make cmake builds happy.
...
Someone with more cmake experience want to throw me a bone? :)
llvm-svn: 136709
2011-08-02 18:33:29 +00:00
Chad Rosier
be10f9853c
When the compiler crashes, the compiler driver now produces diagnostic
...
information including the fully preprocessed source file(s) and command line
arguments. The developer is asked to attach this diagnostic information to a
bug report.
rdar://9575623
llvm-svn: 136702
2011-08-02 17:58:04 +00:00
Chad Rosier
7742b5de70
The -fapple-kext flag was designed to "do the right thing" for building code for
...
use in KEXTs. However, users/Xcode still need to tweak the linker flags to do
the right thing, and end up using -Xlinker, for example. Instead, have the
driver "do the right thing" when linking when -fapple-kext is present on the
command line, and we should have Xcode use -fapple-kext instead of setting other
flags like -Xlinker -kext or -nodefaultlibs.
rdar://7809940
llvm-svn: 136294
2011-07-27 23:36:45 +00:00
Chris Lattner
54b1677d23
Move ArrayRef to LLVM.h and eliminate now-redundant qualifiers, patch by Jon Mulder!
...
llvm-svn: 135855
2011-07-23 17:14:25 +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
Chad Rosier
1988642124
Temporarily revert r135614 while I fix the cmake build.
...
llvm-svn: 135621
2011-07-20 21:16:17 +00:00
Chad Rosier
e3805fc118
When the compiler crashes, the compiler driver now produces diagnostic information
...
including the fully preprocessed source file(s) and command line arguments. The
developer is asked to attach this diagnostic information to a bug report.
llvm-svn: 135614
2011-07-20 20:26:32 +00:00
Joerg Sonnenberger
9c3e69ba88
Correctly handle sysroot prefix in -print-search-dirs. Makes libtool
...
more happy on NetBSD.
llvm-svn: 135344
2011-07-16 10:50:05 +00:00
Chad Rosier
f8412cdae9
Prevent the -save-temps flag from modifying the input file if the input filename
...
conflicts with a to be produced temp filename.
rdar://9724657
llvm-svn: 135308
2011-07-15 21:54:29 +00:00
Daniel Dunbar
8f1fe5b5c3
Driver: Factor out IsUsingLTO helper function.
...
llvm-svn: 133542
2011-06-21 20:55:08 +00:00
Nick Lewycky
62188bbb90
Identifiers with _CapitalLetter are reserved, so don't use them. Prefer the
...
common C++ pattern of using the same name for the constructor argument as you
do for the member. Noticed by inspection.
llvm-svn: 132626
2011-06-04 05:19:42 +00:00
Argyrios Kyrtzidis
0e37afa15e
A StringRef-ication of the DiagnosticIDs API and internals.
...
Patch by Matthieu Monrocq with tweaks by me to avoid StringRefs in the static
diagnostic data structures, which resulted in a huge global-var-init function.
Depends on llvm commit r132046.
llvm-svn: 132047
2011-05-25 05:05:01 +00:00
Joerg Sonnenberger
5fe4a7dc96
Rename ContainsCompileAction to ContainsCompileOrAssembleAction to
...
properly reflect its behavior.
llvm-svn: 130981
2011-05-06 14:05:11 +00:00
Daniel Dunbar
2db3e73c38
Driver: Suppress some additional warnings with -Qunused-arguments.
...
llvm-svn: 129853
2011-04-20 15:44:48 +00:00
Daniel Dunbar
10d0868efb
Driver: Support -fno-lto.
...
llvm-svn: 129712
2011-04-18 19:44:09 +00:00
Dylan Noblesmith
70e73a3d60
refactor -ccc-gcc-name code
...
Put the logic for deciding the default name for gcc/g++
in the only place that actually cares about it.
This also pushes an ifdef out of the generic driver code
to a little further down, when the target is actually known.
Hopefully it can be changed into just a runtime check
in the future.
llvm-svn: 129212
2011-04-09 13:31:59 +00:00
Daniel Dunbar
529c03bc1e
Driver: Sketch driver support for a CC_LOG_DIAGNOSTICS options, similar to the
...
existing CC_PRINT_OPTIONS and CC_PRINT_HEADERS, which can be used to
transparently capture the compiler diagnostics from a build.
llvm-svn: 129082
2011-04-07 18:01:20 +00:00
Argyrios Kyrtzidis
5cf423ec8a
Move Driver::createInvocationFromArgs function to Frontend library to avoid dependency cycle
...
between libFrontend and libDriver.
llvm-svn: 128852
2011-04-04 23:11:45 +00:00
Argyrios Kyrtzidis
f606b82e9a
Introduce Driver::createInvocationFromArgs used to create a CompilerInvocation from command-line args.
...
llvm-svn: 128848
2011-04-04 21:38:51 +00:00
Daniel Dunbar
67fea71c2d
Driver/Darwin: Dsymutil actions should put the dSYM adjacent to the output file.
...
llvm-svn: 128292
2011-03-25 18:16:51 +00:00
Chris Lattner
ce6c42f65f
switch a few Driver APIs to use llvm::ArrayRef, cleaning up code.
...
llvm-svn: 128142
2011-03-23 04:04:01 +00:00
Joerg Sonnenberger
bc923f3f7d
Memorize presence/absence of -nostdlib in Driver.
...
Drop program paths on NetBSD (unused). Only include lib dir, if
-nostdlib is absent. Use = to allow --sysroot to work.
llvm-svn: 127995
2011-03-21 13:59:26 +00:00
Joerg Sonnenberger
6165ab1132
Remember sysroot in Driver. Pass it down to ld for NetBSD, FreeBSD
...
and DragonFly. Use the --sysroot= form for Linux. Fix handling of =
prefix for -B.
llvm-svn: 127994
2011-03-21 13:51:29 +00:00
Daniel Dunbar
1e1c3ca51c
Driver: Give SelectTool access to the action inputs.
...
llvm-svn: 127902
2011-03-18 20:14:00 +00:00
Rafael Espindola
6b314b3d94
On !Darwin, do use the integrated as with -static.
...
llvm-svn: 127879
2011-03-18 15:50:12 +00:00