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

73 Коммитов

Автор SHA1 Сообщение Дата
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
Daniel Dunbar 0b46e1b538 Driver: Handle properly calling dsymutil when source input is
preceeded by a linker input flag.
 - <rdar://problem/6757236> clang should make a dSYM when going
   straight from source to binary

 - This still matches gcc, but the right way to solve this would be to
   detect the situation we care about (we are compiling from source
   and linking in one step), instead of looking at the suffix of the
   input file. The Tool doesn't quite have enough information to do
   this yet, however.

 - Also, find the suffix correctly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68417 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-04 00:55:30 +00:00
Daniel Dunbar 68fb469aeb Driver: Explicitly ignore -fpch-preprocess when using clang, we don't
need to do anything special to support this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68403 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-03 20:51:31 +00:00
Daniel Dunbar 8a2073a856 Driver: Add missed translation for darwin::Preprocess (gcc), -d*
wasn't being forwarded.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68365 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-03 01:27:06 +00:00
Ed Schouten c66a5a30a2 Add some whitespace to test my commit privileges.
Approved by:	ddunbar


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68343 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-02 19:13:12 +00:00
Daniel Dunbar 78d8a089c8 Driver: Allow -ccc-gcc-name to specify the name/path to use when
calling gcc in generic configurations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68260 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-01 23:34:41 +00:00
Daniel Dunbar bf54a06f9b Quick and dirty (!) fix to make sure we use powerpc in triples.
- PR3922

 - I have a clean solution for this in flight, but it may take a while
   to come to fruition so we'll take a quick fix for now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68241 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-01 20:33:11 +00:00
Daniel Dunbar 008f54a542 Driver: Add freebsd::Link
- Patch by Ed Schouten!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68233 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-01 19:36:32 +00:00
Daniel Dunbar bb71b39272 Remove a FIXME, use -emit-pth to drive PTH generation.
-  c.f. r68164


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68184 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-01 03:28:10 +00:00
Daniel Dunbar 8a8d8afa3d Tweak/cleanup darwin::Link a bit, add several FIXMES, and improve test
case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68182 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-01 03:17:40 +00:00
Daniel Dunbar 8e4fea6750 Tweak darwin::Assemble and add a FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68165 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-01 00:27:44 +00:00
Daniel Dunbar 077ba6a3ac Driver: Forward -Wp, and -Xpreprocessor arguments to clang when using
the preprocessor.
 - PR3602.

 - As is inherent in the blanket forwarding options, this will only
   work if clang-cc happens to accept what the user passed. Users by
   and large should use driver options to interact with the
   preprocessor, if at all possible.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68144 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-31 20:53:55 +00:00
Daniel Dunbar 68a31d406c Driver: Call 'as' directly on FreeBSD.
- Patch by Ed Schouten!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68121 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-31 17:45:15 +00:00
Daniel Dunbar af07f936b6 (LLVM up) Update to use llvm::sys::getHostTriple().
- Always pass -triple to clang-cc (-arch will be removed).

 - clang-cc doesn't play guess work with the target triple anymore.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68119 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-31 17:35:15 +00:00
Daniel Dunbar 46562b9122 Fix -MD with no -MT when -o is specified (and fix test case).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68042 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-30 17:59:58 +00:00
Daniel Dunbar cd8e4c44dd Driver: Support -M and -MM.
- Not particularly elegant, but my hand is forced by gcc.

Also, tweak -ccc-print-bindings output.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68027 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-30 06:36:42 +00:00
Daniel Dunbar a5a7bd0de7 Improve dependency file support.
- Rip out various bits of logic from clang-cc's dependency file gen,
   force driver to provide instead.

 - -MD output now goes to proper location
<rdar://problem/6723948> clang -MD puts dep file in /tmp with wrong name

 - -M and -MM still don't work correctly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68022 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-30 00:34:04 +00:00
Daniel Dunbar 9120f179fd Driver: Add test case for darwin::Preprocess and darwin::Compile
tools, and enable them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68019 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-29 22:27:40 +00:00
Daniel Dunbar a3ec60e0cf Driver: Finish porting Darwin::Preprocess and Compile port (still
unused, and lacking a test case).
 - ccc is now on death row, pending some more testing and bug fixes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68012 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-29 18:40:18 +00:00
Daniel Dunbar 40f1265ebd Driver: Start porting Darwin::Preprocess and Compile implementations
(currently unused).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68003 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-29 17:08:39 +00:00