Граф коммитов

92 Коммитов

Автор SHA1 Сообщение Дата
Daniel Dunbar f7b8eec37c OpenBSD support.
- Patch by Jonathan Gray!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74453 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-29 20:52:51 +00:00
Bill Wendling 45483f7a1b Add stack protector support to clang. This generates the 'ssp' and 'sspreq'
function attributes. There are predefined macros that are defined when stack
protectors are used: __SSP__=1 with -fstack-protector and __SSP_ALL__=2 with
-fstack-protector-all.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74405 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-28 07:36:13 +00:00
Daniel Dunbar 3a183d3d46 Forward -C and -CC to clang.
- <rdar://problem/6945384> Driver should pass down -C and -CC


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73087 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-08 21:48:20 +00:00
Daniel Dunbar 75eb1d6478 PR4016: Forward -fno-show-source-location to clang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73082 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-08 21:13:54 +00:00
Devang Patel acebb397fa Set function Attribute::NoImplicitFloat appropriately.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72961 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 22:05:48 +00:00
Eli Friedman 5a77973d9b Add driver support for -fsigned-char/-funsigned-char.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72930 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 07:21:14 +00:00
Torok Edwin a46c71abb1 forward -fno-color-diagnostics to clang-cc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72856 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-04 07:27:53 +00:00
Daniel Dunbar e528028657 Driver: Support -mllvm; this just forwards options to clang-cc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72780 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-03 16:16:27 +00:00
Fariborz Jahanian 34e65770ad 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72275 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-22 20:17:16 +00:00
Daniel Dunbar e027a4b239 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72272 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-22 19:02:20 +00:00
Daniel Dunbar 7cfe31a713 Don't rely on getArchName() to return a constant string reference.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72241 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-22 02:21:04 +00:00
Daniel Dunbar d8fc0f2e77 Add --analyzer-no-default-checks and --analyzer-output options.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72238 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-22 00:38:15 +00:00
Daniel Dunbar f4e2486145 Remove -fprintf-source-range-info from the Driver (this was renamed)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72061 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-18 23:01:24 +00:00
Daniel Dunbar 95a0da7b26 Driver: Emit an unsupported error on -iframework.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71698 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-13 19:05:04 +00:00
Daniel Dunbar 500aec477c 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71069 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-06 04:58:14 +00:00
Daniel Dunbar 868bd0aa92 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71061 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-06 03:16:41 +00:00
Daniel Dunbar d6884a0b90 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70827 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-04 05:16:21 +00:00
Daniel Dunbar 6ecc7a993f 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70647 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-02 21:41:52 +00:00
Daniel Dunbar a8304f6729 Driver: Generate an error when trying to pass an LLVM bc input to a
non-Darwin linker (sorry Gold + LTO-plugin users).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70641 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-02 20:14:53 +00:00
Daniel Dunbar 11e1b40d75 DragonFly ToolChain definition for driver.
- Patch by Alex Hornung!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70635 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-02 18:28:39 +00:00
Douglas Gregor fffd93f383 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>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70578 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-01 21:53:04 +00:00
Daniel Dunbar bc85be8577 Make sure to pass the same options to the static analyzer as the
compiler.
 - Code generation options may still affect the language...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70393 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-29 18:32:25 +00:00
Daniel Dunbar ea71a5b388 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70318 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-28 19:38:45 +00:00
Daniel Dunbar a3ff202ee4 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70102 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-26 01:10:38 +00:00
Daniel Dunbar 9c7db4a209 Driver: -mkernel disables default use of unwind tables (although I
don't yet understand where this is happening in llvm-gcc).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70012 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-25 05:49:54 +00:00
Daniel Dunbar 8abf881c8f Driver: -mkernel and -fapple-kext imply -mno-red-zone.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70010 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-25 05:33:23 +00:00
Daniel Dunbar 3ed2945226 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69951 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-24 03:03:52 +00:00
Daniel Dunbar 99612939d0 Call ld, not collect2.
- <rdar://problem/6517382> [driver] call ld directly


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69938 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-23 23:17:23 +00:00
Chris Lattner 182e09240a rename -fprint-source-range-info -> -fdiagnostics-print-source-range-info.
Temporarily accept both of them, I'll rip out the old one after awhile.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69662 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-21 05:34:31 +00:00
Daniel Dunbar 7695fba302 Forward f[no-]dollars-in-identifiers to clang, when specified.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69549 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-19 21:20:32 +00:00
Daniel Dunbar 49138fc59e Forward -fno-diagnostics-fixit-info to clang-cc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69546 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-19 21:09:34 +00:00
Douglas Gregor df91ef3d6c Preliminary PCH support in the driver
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69410 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18 00:34:01 +00:00
Fariborz Jahanian 448f5e6c19 Added -print-ivar-layout option. No change in functionality
yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69346 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-17 03:04:15 +00:00
Daniel Dunbar 9e820ee054 Pass -fdiagnostics-show-option to clang-cc by default.
- <rdar://problem/6796848> implement -fdiagnostics-show-option


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69276 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-16 06:32:38 +00:00
Daniel Dunbar 06ef3c3e9b Driver: Forward -W* to clang, it can handle all these itself now.
Remove clang_W_Group and clang_ignored_W_Group.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69261 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-16 03:44:10 +00:00
Daniel Dunbar 70d3c92820 Driver: For clang, accept -fsigned-bitfields and reject
-funsigned-bitfields for now (clang defaults to -fsigned-bitfields).
 - <rdar://problem/6790309> ER: Support
   -fsigned-bitfields/-funsigned-bitfields


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69131 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 02:37:43 +00:00
Chris Lattner d82df3ad43 Implement support for GCC's -dD mode, which dumps -E output *and*
macro definitions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68884 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-12 01:56:53 +00:00
Daniel Dunbar ff8857a9e6 Driver: Forward -miphoneos-version-min to clang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68816 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10 20:11:50 +00:00
Daniel Dunbar c21c485b4f Driver: Split out CPP specific options for clang so that we don't end
up adding them twice when running with -no-integrated-cpp or
-save-temps.
 - <rdar://problem/6766636> -save-temps falls over with prefix headers


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68660 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 23:54:23 +00:00
Daniel Dunbar 3bbc75302f More fixes to builtin preprocessor defines.
- Add -static-define option driver can use when __STATIC__ should be
   defined (instead of __DYNAMIC__).

 - Don't set __OPTIMIZE_SIZE__ on Os, __OPTIMIZE_SIZE__ is tied to Oz.

 - Set __NO_INLINE__ following GCC 4.2.

 - Set __GNU_GNU_INLINE__ or __GNU_STDC_INLINE__ following GCC 4.2.

 - Set __EXCEPTIONS for Objective-C NonFragile ABI.

 - Set __STRICT_ANSI__ for standard conforming modes.

 - I added a clang style test case in utils for this, but its not
   particularly portable and I don't think it belongs in the test
   suite.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68621 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 18:03:55 +00:00
Daniel Dunbar edfa02b85b Darwin ld: Unconditionally add -lstdc++ if we are pretending to be
g++.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68601 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 06:06:21 +00:00
Daniel Dunbar c9abc043af Make debug info work when using -save-temps.
- This is pretty ugly, but the most obvious solution. Chime in if you
   have a nicer one.

 - The problem is that with -save-temps, clang-cc has no idea what the
   name of the original input file is. However, the user expects to be
   able to set breakpoints based on the input file name.

 - We support this by providing a new option -main-file-name (similar
   to -dumpbase used by gcc) which allows the driver to pass in the
   original file name.

 - <rdar://problem/6753383> building with clang using --save-temps
   gets the compile unit name from the .i file...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68595 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 05:11:16 +00:00
Daniel Dunbar 9fd0b1f845 Set __PIC__ (more) correctly.
- Add -pic-level clang-cc option to specify the value for the define,
   updated driver to pass this.

 - Added __pic__

 - Added OBJC_ZEROCOST_EXCEPTIONS define while I was here (to match gcc).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68584 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 03:03:23 +00:00
Daniel Dunbar 82d0068852 Driver: Fix forwarding of -fpascal-strings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68570 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 23:51:44 +00:00
Daniel Dunbar d573d26e1a Driver: Fix forwarding of -{std,ansi,trigraphs} when there are
multiple instances of an option.

Also, removed direct -ansi support from clang-cc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68558 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 22:13:21 +00:00
Daniel Dunbar 3aaf082689 Driver: Forward remaining -f options to clang manually.
- Groups are really just intended to hold inherent structure of the
   options, not be abused for individual tool argument translation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68554 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 21:51:40 +00:00
Daniel Dunbar 2ac9fc2ad6 Driver: Only forward last instance of -mmacosx-version-min= and
-isysroot to clang.
 - Don't forward arbitrary -i* options to clang, just the ones we know
   about.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68553 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 21:42:00 +00:00
Daniel Dunbar 48d1ef782c Driver: Manually translate a number of -f with no- variants options to
clang.
 - We will eventually want some more driver infrastructre for this
   probably.

 - For now, the clang-cc interface stays relatively the same, but we
   don't accept multiple instances anymore, or the [no-] variants
   directly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68550 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 21:16:11 +00:00
Daniel Dunbar 5c1aaafbd6 Driver: Explicitly warn that -pg isn't supported (even though we
aren't failing the compilation).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68540 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 19:18:24 +00:00
Daniel Dunbar 16fd3a9f51 Driver: More verbosity reduction.
- Ignore some more -W options and -[fm] options which we can somewhat
   safely ignore.

 - Recognize that -W is an alias for -Wextra

W: -Wdeclaration-after-statement -Werror-implicit-function-declaration -Wfour-char-constants -Winit-self -Wmissing-format-attribute -Wno-#warnings -Wno-comment -Wno-long-long -Wno-variadic-macros -Wold-style-definition -Wstrict-prototypes -Wunused-parameter

f: -fconstant-cfstrings -fdollars-in-identifiers -finline -finline-functions -fno-inline -fno-keep-inline-functions -fno-strict-aliasing -fobjc-atdefs -fobjc-call-cxx-cdtors -fobjc-new-property -fstack-protector

m: -mconstant-cfstrings -mfix-and-continue


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68487 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 02:59:27 +00:00