Commit Graph

911 Commits

Author SHA1 Message Date
Michael J. Spencer f25faaaffb Use error_code instead of std::string* for MemoryBuffer.
llvm-svn: 121378
2010-12-09 17:36:38 +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
Nick Lewycky c7a020af87 Remove stray emacs mode marker.
llvm-svn: 120554
2010-12-01 04:33:27 +00:00
Peter Collingbourne 62089b82bb Driver, Frontend: add CUDA language support
llvm-svn: 120544
2010-12-01 03:15:20 +00:00
Rafael Espindola 81937ec1b6 Handle -nostartfiles.
llvm-svn: 120528
2010-12-01 01:52:43 +00:00
Michael J. Spencer 8aaf49959c Merge System into Support.
llvm-svn: 120297
2010-11-29 18:12:39 +00:00
Rafael Espindola 739b9cf104 Add missing else.
llvm-svn: 120231
2010-11-28 01:08:36 +00:00
Anders Carlsson d470fef01d Forward the -fno-elide-constructor argument to clang -cc1. Fixes PR8652.
llvm-svn: 119915
2010-11-21 00:09:52 +00:00
Rafael Espindola 64fff2998d Check for gcc 4.3.4.
llvm-svn: 119839
2010-11-19 21:02:06 +00:00
Daniel Dunbar 6d776eb1e8 Driver/Darwin: Don't pass -demangle to an iOS linker, which may not understand
it.

llvm-svn: 119809
2010-11-19 17:51:40 +00:00
Nuno Lopes eb156609fe add support for the i686-pc-linux-gnu triple (used by Gentoo x86)
llvm-svn: 119807
2010-11-19 17:26:57 +00:00
Daniel Dunbar 7c87433513 Driver: Ignore -force_cpusubtype_ALL.
llvm-svn: 119803
2010-11-19 16:23:35 +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 ef6c8da50f -Rename -Wargument-larger-than -> -Wlarge-by-value-copy
-Improve the diagnostic message
-Add some comments

Suggestions by Chris.

llvm-svn: 119594
2010-11-18 00:20:36 +00:00
Argyrios Kyrtzidis af84ec0a96 Introduce option -Wargument-larger-than[=N] which warns about function definitions if they take by-value
or return by-value any POD that is larger than some threshold (default is 64 bytes).

Implements rdar://8548050.

llvm-svn: 119583
2010-11-17 23:11:54 +00:00
Rafael Espindola d47ac23154 Implement -pie.
llvm-svn: 119577
2010-11-17 22:26:15 +00:00
Rafael Espindola cfaaddaee0 Don't warn about
clang -w -c foo.s
Helps with the gdb testsuite.

llvm-svn: 119574
2010-11-17 22:13:25 +00:00
Rafael Espindola f92614c578 Don't warn about -w not being used in a link. Necessary to get sane
results in the gdb testsuite.

llvm-svn: 119552
2010-11-17 20:37:10 +00:00
Rafael Espindola 9b6fae5d6d Silence warning for "clang -O2 -O0 -c foo.c -o foo.o.
Fixes PR8607.

llvm-svn: 119498
2010-11-17 15:16:14 +00:00
Rafael Espindola 2abb162631 Add support for distros that like x86_64-unknown-linux-gnu.
llvm-svn: 119425
2010-11-17 00:25:26 +00:00
Rafael Espindola d1002f6fce Fixes PR8611.
Silence warning about -g not being used during linking. I couldn't find any
change in behavior in gcc liking when given -g. Please open another bug if
I missed something.

llvm-svn: 119166
2010-11-15 18:28:16 +00:00
Zhongxing Xu 14776cf96a Add driver support for Ubuntu 9.10.
llvm-svn: 119137
2010-11-15 09:01:52 +00:00
Daniel Dunbar fc8aefb0ba Driver: Support -Oz as an alias for -Os.
llvm-svn: 119003
2010-11-13 18:17:11 +00:00
Rafael Espindola 9aa60e964e Add support for -nostdlib in the linux toolchain.
llvm-svn: 118878
2010-11-12 03:00:39 +00:00
Rafael Espindola 34d77dc49a Add support for -s, -pthread and -pthreads. Thanks to Hans Wennborg and
Cosmin Truta for reporting it.

llvm-svn: 118826
2010-11-11 19:34:42 +00:00
Daniel Dunbar aeed5fe6a2 Driver: Allow build system override of default non-fragile ABI version.
llvm-svn: 118786
2010-11-11 16:08:59 +00:00
Rafael Espindola 7ba97afc4d Add -rdynamic to freebsd and openbsd. Patch by Ruben.
llvm-svn: 118771
2010-11-11 02:17:51 +00:00
Rafael Espindola 124798484a Add support for Exherbo. Patch by Elias Pipping.
llvm-svn: 118769
2010-11-11 02:07:13 +00:00
Rafael Espindola 66b291a41b Add support for Ubuntu Jaunty.
llvm-svn: 118673
2010-11-10 05:00:22 +00:00
Bruno Cardoso Lopes e7f211c89f Add support for soft/hard float options to the Sparc target
llvm-svn: 118514
2010-11-09 17:21:19 +00:00
Roman Divacky b45d2672f7 Add a forgotten break. Found by Rafael Espindola!
llvm-svn: 118433
2010-11-08 19:39:10 +00:00
Roman Divacky 137426a42f Use integrated-as for processing .s files on FreeBSD. Copied
from Linux/OpenBSD code.

llvm-svn: 118419
2010-11-08 17:46:39 +00:00
Rafael Espindola c5688628d8 Pass "-z relro" as two arguments. This works with both gnu ld and gold.
Patch by Frits van Bommel.

llvm-svn: 118406
2010-11-08 14:48:47 +00:00
Rafael Espindola 96aef794ba Use the integrated assembler when procession .s files on OpenBSD and Linux.
Original patch for OpenBSD by Vladimir Kirillov.

llvm-svn: 118386
2010-11-07 23:13:01 +00:00
Rafael Espindola 1c76c59bbc Add support for -rdynamic.
llvm-svn: 118384
2010-11-07 22:57:16 +00:00
Rafael Espindola c8f008f649 Use ld directly on linux. Changes from the previous try:
*) Try to detect as much as possible from the system itself, not the distro.
   This should make it easier to port to a new distro and more likely to
   work on a unknown one.
*) The distro enum now doesn't include the arch. Just use the existing
   host detection support in LLVM.
*) Correctly handle --sysroot.

A small regression is that now clang will pass bitcode file to the linker.
This is necessary for the gold plugin support to work.

It might be better to detect this at configure/cmake time, but doing it in
c++ first is a lot easier.

llvm-svn: 118382
2010-11-07 20:14:31 +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
Rafael Espindola b2cbd85be8 Revert while I debug test failures :-(
llvm-svn: 118150
2010-11-03 04:43:56 +00:00
Rafael Espindola c5dfb607f5 Switch clang to run ld directly on linux. I tested this on all the linux
distros listed by running

gcc main.o -o main
g++ main.o -o main
gcc main.o -o main -static
g++ main.o -o main -static
gcc f.o -o f.so -shared
g++ f.o -o f.so -shared

and comparing the ld line with the one created by clang. I also added
-m32/m64 in distros that support it.

While I tested many distros, there will always be more. If you are hit by this
it should be somewhat easy to add your distro. If you are in a hurry, do
revert this, but please inform how to detect you distro and the ld command
lines produced by the above gcc invocations. Most distros have some patches
on gcc :-(

llvm-svn: 118149
2010-11-03 04:37:51 +00:00
Daniel Dunbar 3ada2b7996 Driver: Silently ignore -fasm-blocks for now instead of error'ing, this cause
some unexpected fallout.

llvm-svn: 118037
2010-11-02 19:42:04 +00:00
Benjamin Kramer 7d11382b8c Use the expanded form of S_ISREG. Hopefully this unbreaks the MSVC build.
llvm-svn: 117779
2010-10-30 08:28:42 +00:00
Dan Gohman e89c04e518 Don't test isRegularFile before calling eraseFromDisk, since
eraseFromDisk does the same check. This avoids a stat call
in the common case.

llvm-svn: 117744
2010-10-29 23:26:14 +00:00
Rafael Espindola acc8709850 Switch to using the integrated assembler by default on x86 and x86-64 ELF
systems.

llvm-svn: 117697
2010-10-29 20:14:02 +00:00
Daniel Dunbar a78e589b08 Driver/IA: Ignore -L for now, which users shouldn't be using for semantic effect.
llvm-svn: 117600
2010-10-28 20:36:23 +00:00
Michael J. Spencer 4992ca4b17 Reorganize predefined macros for all Windows targets.
This adds an option to set the _MSC_VER macro without
recompiling. This is very useful when testing compatibility
with the Windows SDK and c++stdlib headers.

-fmsc-version=<version> (defaults to VS2003 (1300))

llvm-svn: 116999
2010-10-21 05:21:48 +00:00
Michael J. Spencer 4c0ffa823f Fix Whitespace.
llvm-svn: 116990
2010-10-21 03:16:25 +00:00
Chandler Carruth 24e17e175d Add support for the '--sysroot' flag, and an accompanying test of its
interactions with -isysroot and other driver commands.

llvm-svn: 116912
2010-10-20 07:00:47 +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
Daniel Dunbar 473f8a6f88 Driver: Reject -fasm-blocks except on X86 (where we just ignore it, since
passing it is very prevalent in some circles).

llvm-svn: 116761
2010-10-18 22:49:46 +00:00