Commit Graph

362 Commits

Author SHA1 Message Date
Eli Friedman 5d3a16f693 ARM is a legitimate Darwin architecture; don't assert.
llvm-svn: 72538
2009-05-28 20:57:06 +00:00
Eli Friedman 5cd659fd32 Fix for PR4140: Add the start of a Linux toolchain (basically, just
barely enough to get the given usage of -print-file-name working).

llvm-svn: 72412
2009-05-26 07:52:18 +00:00
Daniel Dunbar b8fb96905d Fix use after free, found by Benjamin Kramer.
llvm-svn: 72333
2009-05-23 18:55:58 +00:00
Fariborz Jahanian a4404f21d1 This patch adds support for sender-aware dispatch in Objective-C for the GNU runtime, when
compiled with -fobjc-sender-dependent-dispatch.  This is used in AOP, COP, implementing object 
planes, and a few other things.
Patch by David Chisnall.

llvm-svn: 72275
2009-05-22 20:17:16 +00:00
Daniel Dunbar adeeb052ad Don't warn about -funit-at-a-time, and reject -fno-unit-at-a-time.
- We could just warn about -fno-unit-at-a-time, but in practice people using it
   probably aren't going to get what they want out of clang.

Also, use "clang" specified error for unsupported things instead of driver
unsupported error.

llvm-svn: 72272
2009-05-22 19:02:20 +00:00
Daniel Dunbar 51c7f97bea (llvm up) Use llvm::Triple for storing target triples.
- This commit has some messy stuff in it to extend string lifetimes, but that
   will go away once we switch to using the enum'd Triple interfaces.

llvm-svn: 72243
2009-05-22 02:53:45 +00:00
Daniel Dunbar 5bbebfe9bc Don't rely on getArchName() to return a constant string reference.
llvm-svn: 72241
2009-05-22 02:21:04 +00:00
Daniel Dunbar 58f345ceb1 Add --analyzer-no-default-checks and --analyzer-output options.
llvm-svn: 72238
2009-05-22 00:38:15 +00:00
Daniel Dunbar 13c358d9b8 Remove -fprintf-source-range-info from the Driver (this was renamed)
llvm-svn: 72061
2009-05-18 23:01:24 +00:00
Daniel Dunbar 82b22101e6 Reformat a comment
llvm-svn: 72046
2009-05-18 21:47:54 +00:00
Daniel Dunbar 8a35ef85d8 Driver: Emit an unsupported error on -iframework.
llvm-svn: 71698
2009-05-13 19:05:04 +00:00
Daniel Dunbar e5ae096bf8 Tweak x86 -mcpu defaults.
- Default to yonah on Darwin (to get SSE3).

 - Default to Pentium4 (32-bit) and x86-64 (64-bit) on
   non-Darwin. Welcome to the 21st century.

llvm-svn: 71069
2009-05-06 04:58:14 +00:00
Daniel Dunbar 4dbaaa6f43 Improve handling of (X86) target features.
- This is a WIP...

 - This adds -march= handling to the driver, and fixes the defaulting
   of -mcpu on Darwin (which was using the wrong test).

Instead of handling -m{sse, ...} in the driver, pass them to clang-cc as
 -target-feature [+-]name

In clang-cc, communicate with the (clang) target to discover the legal
features of a target, and the features which are enabled based on
-mcpu. This is currently hardcoded just enough to not be a feature
regression, we need to get this information from the backend's
TableGen information somehow.

This is used to construct the full list of features which are being
used, which is in turn used to initialize the predefines.

llvm-svn: 71061
2009-05-06 03:16:41 +00:00
Daniel Dunbar 5e051f9a86 Add --analyze-auto.
- Currently just an alias for --analyze, eventually we want to refit
   --analyze so that it is less automatic (i.e., does not force plist
   output and does not hard code the list of checks).

llvm-svn: 71056
2009-05-06 02:12:32 +00:00
Daniel Dunbar e993ba6fca Add -fobjc-tight-layout.
- This implements gcc style Objective-C interface layout (I
   think). Currently it is always off, there is no functionality
   change unless this is passed.
   
   For the curious, the deal is that gcc lays out the fields of a
   subclass as if they were part of the superclass. That is, the
   subclass fields immediately follow the super class fields instead
   of being padded to the alignment of the superclass structure.

 - Currently gcc uses the tight layout in 32-bit and 64-bit modes, and
   llvm-gcc uses it in 32-bit only, for reasons which aren't clear
   yet. We probably want to switch to matching gcc, once this makes it
   through testing... my hope is that we can also fix llvm-gcc in
   order to maintain compatibility between the compilers.

llvm-svn: 70827
2009-05-04 05:16:21 +00:00
Daniel Dunbar 5716d87ed1 Driver: When using the generic gcc tool, pass -m32 or -m64 if we
recognize the architecture.
 - This is an attempt to force gcc to the write target.

 - PR4094.

llvm-svn: 70647
2009-05-02 21:41:52 +00:00
Daniel Dunbar e3e263fb71 Driver: Generate an error when trying to pass an LLVM bc input to a
non-Darwin linker (sorry Gold + LTO-plugin users).

llvm-svn: 70641
2009-05-02 20:14:53 +00:00
Daniel Dunbar cc9123424f DragonFly ToolChain definition for driver.
- Patch by Alex Hornung!

llvm-svn: 70635
2009-05-02 18:28:39 +00:00
Douglas Gregor 4818553abd Implement -fmessage-length=N, which word-wraps diagnostics to N columns.
Also, put a line of whitespace between the diagnostic and the source
code/caret line when the start of the actual source code text lines up
(or nearly lines up) with the most recent line of the diagnostic. For
example, here it's okay for the last line of the diagnostic to be
(vertically) next to the source line, because there is horizontal
whitespace to separate them:

decl-expr-ambiguity.cpp:12:16: error: function-style cast to a builtin
      type can only take one argument
  typeof(int)(a,5)<<a;

However, here is a case where we need the vertical separation (since
there is no horizontal separation):

message-length.c:10:46: warning: incompatible pointer types initializing 'void
      (int, float, char, float)', expected 'int (*)(int, float, short,
      float)'

      int (*fp1)(int, float, short, float) = f;

This is part one of <rdar://problem/6711348>.

llvm-svn: 70578
2009-05-01 21:53:04 +00:00
Douglas Gregor e5f93b1e58 Revert r70424. We don't need it
llvm-svn: 70432
2009-04-29 23:06:13 +00:00
Douglas Gregor 424ac21318 Add PCH version to the -v output
llvm-svn: 70424
2009-04-29 22:47:43 +00:00
Daniel Dunbar 44e7122151 Make sure to pass the same options to the static analyzer as the
compiler.
 - Code generation options may still affect the language...

llvm-svn: 70393
2009-04-29 18:32:25 +00:00
Douglas Gregor 272842aa1c Enable PCH by default
llvm-svn: 70339
2009-04-28 22:44:02 +00:00
Daniel Dunbar fb83baaf76 With -ccc-pch-is-pch, always treat precompiled inputs as PCH,
regardless of extension.
 - Otherwise we can't expect that just plugging in -ccc-pch-is-pch
   will work.

llvm-svn: 70318
2009-04-28 19:38:45 +00:00
Douglas Gregor 7b71e63120 Add a header containing the Clang version; make the driver use this
Clang version value rather than hard-coding "1.0".

Add PCH and Clang version information into the PCH file. Reject PCH
files with the wrong version information.

llvm-svn: 70264
2009-04-27 22:23:34 +00:00
Douglas Gregor 060eaf6520 Turn PCH off by default, yet again. I'm happier about it this time, though
llvm-svn: 70168
2009-04-26 23:15:05 +00:00
Douglas Gregor 56930a4b81 Trying turning on PCH by default yet again. We might actually a chance at success now
llvm-svn: 70164
2009-04-26 22:21:26 +00:00
Douglas Gregor 8bdbf3628f Turn off PCH by default, again
llvm-svn: 70113
2009-04-26 05:09:50 +00:00
Douglas Gregor 5b21e96c56 One more crazy try with PCH-by-default
llvm-svn: 70112
2009-04-26 03:59:49 +00:00
Douglas Gregor 58d23997c8 Turn of PCH by default. I got the info I was looking for
llvm-svn: 70106
2009-04-26 01:34:47 +00:00
Daniel Dunbar 72a6090dc4 Driver: Add -std-default= option.
- This can be used to supply a default value for -std=; the idea is
   that this can be used in conjunction with CCC_ADD_ARGS or
   QA_OVERRIDE_GCC3_OPTIONS to change the default without having to
   modify the build system.

llvm-svn: 70102
2009-04-26 01:10:38 +00:00
Daniel Dunbar 3ba94d8778 Add option for AddAllArgsTranslated to control whether output argument
should be joined or separate.

llvm-svn: 70101
2009-04-26 01:07:52 +00:00
Douglas Gregor 06ccf7a463 Another shot at switching PCH on by default, now that we've cleaned up some bugs and improved performance. Will be reverted after Mr. Speedy gets done with it
llvm-svn: 70099
2009-04-26 00:37:38 +00:00
Douglas Gregor 25d85bcada Revert my PCH change. I'm happy now
llvm-svn: 70018
2009-04-25 07:18:06 +00:00
Douglas Gregor 9e17c07741 Temporarily try to build with PCH by default. Revert this change once
we see what trouble it causes.

llvm-svn: 70017
2009-04-25 06:28:32 +00:00
Daniel Dunbar 68f1d8ed0c Driver: -mkernel disables default use of unwind tables (although I
don't yet understand where this is happening in llvm-gcc).

llvm-svn: 70012
2009-04-25 05:49:54 +00:00
Daniel Dunbar 11892e951d Driver: -mkernel and -fapple-kext imply -mno-red-zone.
llvm-svn: 70010
2009-04-25 05:33:23 +00:00
Daniel Dunbar c1b1b4b2c9 Don't run dsymutil when making a fat executable direct source.
- Otherwise, we will end up with stray .dSYM files which don't get
   lipo'ed or removed.

 - Ideally we would run dsymutil on the result, but we don't have the
   infrastructure for that yet. Note that gcc doesn't handle this case
   either.

 - <rdar://problem/6809621> [driver] clang leaves .dSYM files lying
   around in tmp.

llvm-svn: 69951
2009-04-24 03:03:52 +00:00
Daniel Dunbar 838cbe19b7 Call ld, not collect2.
- <rdar://problem/6517382> [driver] call ld directly

llvm-svn: 69938
2009-04-23 23:17:23 +00:00
Chris Lattner 6968641ac5 rename -fprint-source-range-info -> -fdiagnostics-print-source-range-info.
Temporarily accept both of them, I'll rip out the old one after awhile.

llvm-svn: 69662
2009-04-21 05:34:31 +00:00
Daniel Dunbar 712e4dee26 Look at the TMP environment variable as well.
llvm-svn: 69638
2009-04-21 00:25:10 +00:00
Daniel Dunbar c35694da21 Also look at the TEMP environment variable as a place to put temporary
files.

llvm-svn: 69622
2009-04-20 20:28:21 +00:00
Daniel Dunbar ab8ce7cddb If defined, use TMPDIR environment variable as location for temporary files.
llvm-svn: 69609
2009-04-20 17:32:49 +00:00
Daniel Dunbar f5e9b1f5d0 Forward f[no-]dollars-in-identifiers to clang, when specified.
llvm-svn: 69549
2009-04-19 21:20:32 +00:00
Daniel Dunbar 8281bdeb4d Forward -fno-diagnostics-fixit-info to clang-cc.
llvm-svn: 69546
2009-04-19 21:09:34 +00:00
Douglas Gregor 111af7d7b4 Preliminary PCH support in the driver
llvm-svn: 69410
2009-04-18 00:34:01 +00:00
Fariborz Jahanian 493d4e080d Added -print-ivar-layout option. No change in functionality
yet.

llvm-svn: 69346
2009-04-17 03:04:15 +00:00
Daniel Dunbar f2df7c283f Driver: Allow using clang as a precompiler, even if it is an
unsupported arch.

llvm-svn: 69322
2009-04-16 23:10:13 +00:00
Daniel Dunbar 092f0ccd9c Pass -fdiagnostics-show-option to clang-cc by default.
- <rdar://problem/6796848> implement -fdiagnostics-show-option

llvm-svn: 69276
2009-04-16 06:32:38 +00:00
Daniel Dunbar b4b3709c5b Driver: Forward -W* to clang, it can handle all these itself now.
Remove clang_W_Group and clang_ignored_W_Group.

llvm-svn: 69261
2009-04-16 03:44:10 +00:00