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
Joerg Sonnenberger
bdbdf70334
Use C as fallback type if in C preprocessor mode.
...
llvm-svn: 127769
2011-03-16 22:45:02 +00:00
Joerg Sonnenberger
f496164ceb
Redo part of r127137:
...
Pass down the correct C->getArgs, but keep it with the original
DerivedArgList type. Slightly adjust the MakeIndex call for the
different base type. This unbreaks the handling of --no-mangle on Darwin.
llvm-svn: 127142
2011-03-07 01:15:29 +00:00
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