Commit Graph

1743 Commits

Author SHA1 Message Date
Chad Rosier 2933d05033 [driver] Remove an extra space with the -internal-externc-isystem option, so
that matching works correctly.
Part of rdar://12329974

llvm-svn: 167161
2012-10-31 19:28:55 +00:00
Rafael Espindola dcbf698dde getArchTypeForDarwinArchName is only used in the clang driver, copy it there.
I will remove it from llvm in the next commit.

llvm-svn: 167156
2012-10-31 18:51:07 +00:00
Chad Rosier 83f16bf445 [driver] Completely rework how superfluous options are stripped out of the crash
diagnostics script.

This addresses the FIXME pertaining to quoted arguments.  We also delineate
between those flags that have an argument (e.g., -D macro, -MF file) and
those that do not (e.g., -M, -MM, -MG).  Finally, we add the -dwarf-debug-flags
to the list of flags to be removed.
rdar://12329974

llvm-svn: 167152
2012-10-31 18:31:33 +00:00
Simon Atanasyan a47ba2958f Fix if-else braces layout accordingly to the style guide.
llvm-svn: 167118
2012-10-31 14:39:28 +00:00
Simon Atanasyan 86bdab7468 Extend -Bprefix functionality and make it closer to gcc. If the "prefix"
is not a directory, Driver::GetProgramPath() routine does not try to append
the program name as a "path component" to it. It just joins the "prefix" with
the program name and checks the resulting path existence.

The patch reviewed by Rafael Espindola.

llvm-svn: 167114
2012-10-31 12:01:53 +00:00
Rafael Espindola 69aa04dd8f Remove the -ccc-no-clang option.
llvm-svn: 167093
2012-10-31 01:21:20 +00:00
Rafael Espindola 74c5fd93b9 Remove ccc-no-clang-cpp, which is also dead now.
llvm-svn: 167062
2012-10-30 23:49:11 +00:00
Chad Rosier 616e8a5c0b [driver] Older versions of ld expect '-L<dir>' not '-L <dir>'. In Xcode4 and
later, '-L <dir>' is allowed, but rewrite these in the driver as '-L<dir>' to
maintain backward compatibility.  The same is true for the -I option.
rdar://12366753

llvm-svn: 167054
2012-10-30 21:42:09 +00:00
Rafael Espindola 84619411eb In the past "production" clang builds would not be used for c++, and
we had the -ccc-clang-cxx and -ccc-no-clang-cxx options to force them
on or off for testing.

Clang c++ support is now production quality and these options are dead.

llvm-svn: 166986
2012-10-30 00:13:16 +00:00
Rafael Espindola 077bc8bdaa Remove a bit of dead code.
llvm-svn: 166983
2012-10-29 23:41:43 +00:00
Mahesha S 19a429e7e6 Reverted back the changes made in 166868 and in 166869
llvm-svn: 166871
2012-10-27 10:44:42 +00:00
Mahesha S 6a682be48b -------------------------------------------------
Feature:
  OpenMP support in CLANG:

Sub-Feature: 
  Support for option -fopenmp

Files Changed/Added:
  * include/clang/Driver/Options.td (C)
  * include/clang/Basic/LangOptions.def (C)
  * lib/Driver/Tools.cpp (C)
  * lib/Frontend/CompilerInvocation.cpp (C)

Test Cases Changed/Added:
  * test/Driver/clang_fopenmp_opt.c (A)
-------------------------------------------------

llvm-svn: 166868
2012-10-27 07:47:56 +00:00
Argyrios Kyrtzidis c2c77c42ef [driver] Before applying the working directory check if the input path
is absolute.

llvm-svn: 166808
2012-10-26 20:09:24 +00:00
Argyrios Kyrtzidis 7ec3c09412 [options] Fix mishandling of aliased options that was introduced in r166444.
llvm-svn: 166801
2012-10-26 19:36:33 +00:00
Richard Smith 4d3110af06 -fcatch-undefined-behavior checking for appropriate vptr value: Clang CodeGen side.
llvm-svn: 166661
2012-10-25 02:14:12 +00:00
Rafael Espindola 1ad26f0423 Handle -pthread, -pg and -shared correctly on bitrig.
Patch by David Hill.

llvm-svn: 166483
2012-10-23 17:07:31 +00:00
Michael J. Spencer 929fccd476 [Options] Add prefixes to options.
Each option has a set of prefixes. When matching an argument such as
-funroll-loops. First the leading - is removed as it is a prefix. Then
a lower_bound search for "funroll-loops" is done against the option table by
option name. From there each option prefix + option name combination is tested
against the argument.

This allows us to support Microsoft style options where both / and - are valid
prefixes. It also simplifies the cases we already have where options come in
both - and -- forms. Almost every option for gnu-ld happens to have this form.

llvm-svn: 166444
2012-10-22 22:13:48 +00:00
Daniel Dunbar 5f18f6e4d6 driver/Darwin: Default to AAPCS for M-class CPUs.
- This is an assumption that is currently hardwired into the backend, we need
   to do this in order for the frontend and backend to agree.

llvm-svn: 166428
2012-10-22 18:30:51 +00:00
Benjamin Kramer a18228a95f Silence warning about && in ||.
llvm-svn: 166391
2012-10-21 15:21:56 +00:00
Simon Atanasyan 2d1b1ad831 Add support of MIPS n32 ABI to the Clang driver. The fix builds correct library/object files paths and passes appropriate command line options to the linker if user provides -mabi=n32 option.
The patch reviewed by Rafael Espindola.

llvm-svn: 166389
2012-10-21 11:44:57 +00:00
Michael J. Spencer 66e2b20d39 [Options] Make Option non clang specific.
llvm-svn: 166348
2012-10-19 22:37:06 +00:00
Michael J. Spencer fc790901d2 [Options] make Option a value type.
llvm-svn: 166347
2012-10-19 22:36:40 +00:00
Argyrios Kyrtzidis f552d3841b Revert r166223 and the subsequent commits that depend on it, r166230 & r166235.
This seems to have introduced assertion hit when building compiler-rt.

llvm-svn: 166245
2012-10-18 22:42:31 +00:00
Eric Christopher a2f7eb7c52 Add a new option for and disable column number information as there
are no known current users of column info. Robustify and fix up
a few tests in the process. Reduces the size of debug information
by a small amount.

Part of PR14106

llvm-svn: 166236
2012-10-18 21:52:18 +00:00
Michael J. Spencer 43897975cc [Options] Make Option non clang specific.
llvm-svn: 166230
2012-10-18 21:36:01 +00:00
Michael J. Spencer 842227a2e2 [Options] make Option a value type.
llvm-svn: 166223
2012-10-18 20:33:42 +00:00
David Chisnall a5f5941374 GNUstep runtime version default to 1.6, generate correct property attribute
metadata.

llvm-svn: 166023
2012-10-16 15:11:55 +00:00
Daniel Dunbar bd847cc562 Un-revert r164907 and r164902 (+ follow-ups), 10.6 build fix to follow.
llvm-svn: 165988
2012-10-15 22:23:53 +00:00
Nico Weber bec2bf1326 Revert r164907 and r164902 (+ follow-ups). They broke building on 10.6.
See PR14013.

llvm-svn: 165962
2012-10-15 20:37:01 +00:00
Eric Christopher 12de2bdfc5 Revert "[Options] make Option a value type."
Author: Michael J. Spencer <bigcheesegs@gmail.com>
Date:   Wed Oct 10 21:48:26 2012 +0000

    [Options] make Option a value type.

    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165663 91177308-0d34-0410-b5e6-96231b3b80d8

This reverts commit 0464fd5e4ce2193e786e5adcab6b828f9366dae3.

llvm-svn: 165667
2012-10-10 22:34:46 +00:00
Michael J. Spencer 91599874e9 [Options] make Option a value type.
llvm-svn: 165663
2012-10-10 21:48:26 +00:00
Rafael Espindola fc3fc0c936 The clang driver has a fairly fancy support for executing gcc instead of
clang itself. This dates back to clang's early days and while it looks like
some of it is still used (for kext for example), other parts are probably dead.

Remove the -ccc-clang-archs option and associated code. I don't think there
is any remaining setup where clang doesn't support an architecture but it can
expect an working gcc cross compiler to be available.

A nice side effect is that tests no longer need to differentiate architectures
that are included in production builds of clang and those that are not.

llvm-svn: 165545
2012-10-09 20:46:28 +00:00
Chad Rosier 31753473a6 [driver] Remove redundant cases due to overlapping commits between Ted (r165531, 165532) and I
(r165534), but leave the test case in place.

llvm-svn: 165537
2012-10-09 20:01:58 +00:00
Richard Smith e30752c93b -fcatch-undefined-behavior: emit calls to the runtime library whenever one of the checks fails.
llvm-svn: 165536
2012-10-09 19:52:38 +00:00
Chad Rosier 3530682558 [driver] Remove the -W[no-][int-conversion|constant-conversion|enum-conversion]
options when clang invokes cc1plus for i386 kexts.
rdar://12459188

llvm-svn: 165534
2012-10-09 19:43:33 +00:00
Ted Kremenek a88397d9ba Don't forward -Wenum-conversion to cc1plus.
llvm-svn: 165532
2012-10-09 19:29:48 +00:00
Ted Kremenek b476241840 Don't forward -Wint-conversion to cc1plus.
llvm-svn: 165531
2012-10-09 19:29:46 +00:00
Chandler Carruth c0f5cd1928 Make Bitrig's clang understand -stdlib= correctly.
With this patch Bitrig can use a different c++ library without pain and
within the normal commandline parameters.

Original patch by David Hill, with lots of fixes and cleanup by me.

llvm-svn: 165430
2012-10-08 21:31:38 +00:00
Rafael Espindola 35ca7d9ddf Use getArch instead of getArchName + string compare.
llvm-svn: 165370
2012-10-07 04:44:33 +00:00
Rafael Espindola e8bd4e50e4 Use getArch instead of getArchName.
The darwin change should be a nop since Triple::getArchTypeForDarwinArchName
doesn't know about amd64.

If things like amd64-mingw32 are to be rejected, we should print a error
earlier on instead of silently using the wrong abi.

Remove old comment that looks out of place, this is "in clang".

llvm-svn: 165368
2012-10-07 03:23:40 +00:00
Benjamin Kramer 058666a8d0 Driver: Link crtfastmath.o if it's available and -ffast-math is specified.
crtfastmath.o contains routines to set the floating point flags to a faster,
unsafe mode. Linking it in speeds up code dealing with denormals significantly
(PR14024).

For now this is only enabled on linux where I can test it and crtfastmath.o is
widely available. We may want to provide a similar file with compiler-rt
eventually and/or enable it on other platforms too.

llvm-svn: 165240
2012-10-04 19:42:20 +00:00
Benjamin Kramer 4f23bee060 Prefer StringRef::startswith to the strncmp/strlen contraption.
This may be slightly more efficient and is definitely more readable.

llvm-svn: 165217
2012-10-04 10:06:38 +00:00
Logan Chien cd679fda6c Fix typo in comments.
llvm-svn: 165216
2012-10-04 08:08:56 +00:00
Benjamin Kramer bf56beab7e Fix invalid reads by memcmp.
Str may be smaller than Start->Name here. Use strncmp to avoid scanning past the
end. Found by valgrind.

llvm-svn: 165157
2012-10-03 20:58:09 +00:00
Michael J. Spencer bfdde7cb60 [Options] Store the owning OptTable in Option so it can construct Group and Alias.
llvm-svn: 165150
2012-10-03 19:58:10 +00:00
Simon Atanasyan b16488c9fb Remove useless parameter "WantFile" from Driver::GetProgramPath().
This parameter is useless because nowhere used explicitly and always
gets its default value - "false".

The patch reviewed by Rafael Espindola.

llvm-svn: 165149
2012-10-03 19:52:37 +00:00
Simon Atanasyan 53fefd1f6a Implement Adnroid MIPS toolchain support:
1. Add mipsel-linux-android to the list of valid MIPS target triples.
2. Add <gcc install path>/mips-r2 to the list of toolchain specific path
   prefixes if target is mipsel-linux-android.

The patch reviewed by Logan Chien.

llvm-svn: 165131
2012-10-03 17:46:38 +00:00
Logan Chien b914d14e67 Fix typo in comments.
llvm-svn: 165105
2012-10-03 09:26:43 +00:00
Bill Wendling 3b2000fcac During LTO, we call 'dsymutil' when we compile source files. This necessitates
clang specifying a temporary file that it later cleans up so that it can survive
the linking stage. However, when we compile object files during LTO we don't
call 'dsymutil'. That's done at a different stage (if at all). We rely upon the
linker to specify a unique name for the temporary file it generates.
<rdar://problem/12401423>

llvm-svn: 165028
2012-10-02 18:02:50 +00:00
Bob Wilson 2afa011e0b Add Clang support for iOS6.
llvm-svn: 164907
2012-09-29 23:52:58 +00:00