Commit Graph

264 Commits

Author SHA1 Message Date
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
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