Commit Graph

1867 Commits

Author SHA1 Message Date
Alexey Samsonov cc42980335 UBSan: enable proper linking with UBsan runtime on Darwin. Turn on building ubsan on OS X in 'make' build system. Patch by Jean-Daniel Dupas.
llvm-svn: 168168
2012-11-16 12:53:14 +00:00
Fariborz Jahanian 0e3043b2ed block extended signatur option. Change previous option
to a cc1 -fencode-extended-block-signature and pass it
to cc1 and recognize this option to produce extended block
type signature. // rdar://12109031 

llvm-svn: 168063
2012-11-15 19:02:45 +00:00
Dmitri Gribenko b2aa9234b6 Use empty parens for empty function parameter list instead of '(void)'.
llvm-svn: 168041
2012-11-15 14:28:07 +00:00
Nick Lewycky 5cc9ebb723 Revert r167567, restoring the ability of clang to run gcc in cases where it
can't handle the input file type. This resulted in PR14338.

llvm-svn: 168024
2012-11-15 05:36:36 +00:00
Benjamin Kramer 76db2907b0 This patch makes the behavior of clang consistent with the behavior of gcc 4.6 in cases where both -fPIC and -fPIE is used.
- Separately check if -fPIE was specified in the command line and define both __PIC__ and __PIE__ when -fPIE is used. We need to check this separately because -fPIE will infer -fPIC even if its not explicitly used.
- Fixed existing tests.
- Added new tests for cases where both -fPIC and -fPIE is used.

Author: Tareq A. Siraj <tareq.a.siraj@intel.com>
Fixes: PR13221
Review: http://llvm-reviews.chandlerc.com/D94
llvm-svn: 167846
2012-11-13 15:32:35 +00:00
Bill Wendling 744611f9ba Disable accelerator tables when compiling with LTO.
LTO doesn't generate correct accelerator tables. This is due to the general lack
correct of debug info for LTO. Disable it when using LTO.
<rdar://problem/12401423>

llvm-svn: 167799
2012-11-13 00:54:24 +00:00
Richard Smith e70ed8690f PR14303: Add a NoDriverOption flag to those options which are not accepted by
the driver (the options defined in CC1Options.td) and exclude their help from
"clang --help".

llvm-svn: 167638
2012-11-09 22:36:44 +00:00
Chad Rosier d87e4f7ad8 Implement -mstrict-align using '-backend-option -arm-strict-align' as this saves
us from having to make any backend changes.

llvm-svn: 167623
2012-11-09 18:27:01 +00:00
Chad Rosier 6002702b06 [driver] Add a -mstrict-align compiler option for ARM targets.
rdar://12340498

llvm-svn: 167619
2012-11-09 17:29:19 +00:00
Bob Wilson 5ad5a9511c Remove old driver code to grab the iOS simulator version from the -D option.
We can now rely on the -mios-simulator-version-min command line option
and remove the awful hack. <rdar://problem/10304510>

llvm-svn: 167603
2012-11-09 01:59:30 +00:00
Bob Wilson a2d228b570 Remove more code related to invoking llvm-gcc. <rdar://problem/11991320>
llvm-svn: 167598
2012-11-08 23:21:22 +00:00
Daniel Dunbar c3bd9f5c50 Driver/Darwin: The -arch argument values aren't exactly the arch names from a
triple.

 - Translate the special case of powerpc to its expected -arch name.

llvm-svn: 167571
2012-11-08 03:38:26 +00:00
Bob Wilson 0c79f3cf3e Rip out a bunch of code for invoking gcc from clang.
llvm-svn: 167567
2012-11-08 01:03:34 +00:00
Bob Wilson d0de8ceb57 Remove code to fall back to llvm-gcc for i386 kexts.
More cleanups to follow in separate commits....

llvm-svn: 167566
2012-11-08 01:03:29 +00:00
Michael J. Spencer 70d85be6d3 [Driver] Fix -Wp,-MMD pr13959
llvm-svn: 167559
2012-11-07 23:37:14 +00:00
NAKAMURA Takumi ab0603603e clang/lib/Driver/Tools.cpp: Fix abuse of StringRef.
llvm-svn: 167494
2012-11-06 22:02:00 +00:00
Alexey Samsonov 627b10f712 Follow-up for r167411 to un-break ASan on Mac. Move SanitizerArgs to a header file and use it on Darwin toolchain.
llvm-svn: 167460
2012-11-06 15:09:03 +00:00
Richard Smith aa71657749 Per discussion on cfe-commits, treat -faddress-sanitizer,
-fno-address-sanitizer, -fthread-sanitizer, -fno-thread-sanitizer, and
-fcatch-undefined-behavior as deprecated: produce a warning if they are used
pointing to the corresponding -fsanitize= option. In passing add the missing
'-' to some diagnostics.

llvm-svn: 167429
2012-11-06 01:12:02 +00:00
Richard Smith b1b0ab41e7 Use the individual -fsanitize=<...> arguments to control which of the UBSan
checks to enable. Remove frontend support for -fcatch-undefined-behavior,
-faddress-sanitizer and -fthread-sanitizer now that they don't do anything.

llvm-svn: 167413
2012-11-05 22:21:05 +00:00
Richard Smith 52be619c84 Add -fsanitize=<sanitizers> argument to driver and frontend, and add
-fno-sanitize=<sanitizers> argument to driver. These allow ASan, TSan, and the
various UBSan checks to be enabled and disabled separately. Right now, the
different modes can't be combined, but the intention is that combining UBSan
and the other sanitizers will be permitted in the near future.

Currently, the UBSan checks will all be enabled if any of them is; that will be
fixed by the next patch.

llvm-svn: 167411
2012-11-05 22:04:41 +00:00
Rafael Espindola 7df3501b49 Improve x86 android support:
* -Bsymbolic must be added for x86 as well.
* Default CPU name also set to 'core2' for x86 android.
Patch by Edwin Vane.

llvm-svn: 167307
2012-11-02 20:41:30 +00:00
Richard Smith 437abed3ae Add -lpthread when building with Ubsan on Linux, in preparation for making libclang-rt.ubsan pull in sanitizer_common, which in turn depends on pthreads.
llvm-svn: 167305
2012-11-02 20:32:19 +00:00
Richard Smith bd55daf2ee Remove first argument from Arg::getValue; it's been unused since r105760.
llvm-svn: 167211
2012-11-01 04:30:05 +00:00
Chad Rosier 37756b0714 [driver] Remove an extra space with the -iprefix option, so that
matching works correctly.
Part of rdar://12329974

llvm-svn: 167173
2012-10-31 21:08:30 +00:00
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
Bob Wilson d7cf104dae Add armv7s and some other arm variants supported by Mach-O files.
llvm-svn: 164905
2012-09-29 23:52:50 +00:00
Fariborz Jahanian 659bc4a792 Modern objcective-C translator. When doing rewriting, Do not
use the integrated pre-processor, preprocess in objective-c++ mode. 
// rdar://12189793.

llvm-svn: 164836
2012-09-28 19:05:17 +00:00
Sylvestre Ledru 33b5baf189 Revert 'Fix a typo 'iff' => 'if''. iff is an abreviation of if and only if. See: http://en.wikipedia.org/wiki/If_and_only_if Commit 164766
llvm-svn: 164769
2012-09-27 10:16:10 +00:00
Sylvestre Ledru a876013dc9 Fix a typo 'iff' => 'if'
llvm-svn: 164766
2012-09-27 09:57:10 +00:00
Benjamin Kramer 2715fce524 Allow -MF to be used in combination with -E -M or -E -MM.
Fixes PR13851. Patch by Dimitry Andric!

llvm-svn: 164717
2012-09-26 19:01:49 +00:00
Michael J. Spencer 9d1221a281 [Options] Store the option ID in OptTable::Info.
llvm-svn: 164644
2012-09-25 23:12:48 +00:00
Chad Rosier c30eb1c282 [driver] Add support for the -fno-fast-math option.
rdar://12299433

llvm-svn: 164638
2012-09-25 22:03:25 +00:00
Anna Zaks b9828203df [analyzer] Really turn on dynamic-bifurcation on by default.
Thanks to Byoungyoung for realizing taht we are not passing the default
option correctly.

llvm-svn: 164543
2012-09-24 17:43:47 +00:00
Rafael Espindola 151a957fb0 Implement ToolChain::IsUnwindTablesDefault to reduce code duplication a bit.
llvm-svn: 164473
2012-09-23 03:05:41 +00:00
Rafael Espindola 66431cd10f On Hexagon getArchName() never returns x86_64, simplify the function.
llvm-svn: 164470
2012-09-22 22:58:57 +00:00
Rafael Espindola 08f1ebb2b7 Fix pr13749. There is still a lot of code using getArchName that should be
using getArch, but I will try to fix them one at time to add tests.

llvm-svn: 164460
2012-09-22 15:04:11 +00:00
Simon Atanasyan 2efe53e448 Add four new command line options for MIPS CPU selection:
-mips32, -mips32r2, -mips64, -mips64r2.

The patch reviewed by Eric Christopher.

llvm-svn: 164410
2012-09-21 20:19:32 +00:00
Hal Finkel f358791e27 Add C/C++ header locations for the Freescale SDK.
The Freescale SDK is based on OpenEmbedded, and this might be useful
for other OpenEmbedded-based configurations as well.

With minor modifications, patch by Tobias von Koch!

llvm-svn: 164177
2012-09-18 22:25:07 +00:00
Hal Finkel f6d6cb0218 Add e500mc and e5500 to the list of valid PPC CPU names.
Patch by Tobias von Koch!

llvm-svn: 164176
2012-09-18 22:25:03 +00:00
Simon Atanasyan d44138808f Do not use "lib32" directory to create a library/object files
paths when target is MIPS 32-bit.

The patch reviewed by Chandler Carruth.

llvm-svn: 163898
2012-09-14 11:27:24 +00:00
Bob Wilson 1ec4a5e190 Improve the driver title as shown in the --help message. <rdar://12297538>
llvm-svn: 163870
2012-09-14 03:35:42 +00:00
Silviu Baranga 157f7c6742 This patch introduces A15 as a target in Clang.
llvm-svn: 163804
2012-09-13 15:06:00 +00:00
Ted Kremenek b47e6bc597 Conditionally parse documentation comments in system headers by
passing -fretain-comments-from-system-headers.  By default, the
compiler no longer parses such documentation comments, as they
can result in a noticeable compile time/PCH slowdown.

Fixes <rdar://problem/11860820>.

llvm-svn: 163778
2012-09-13 06:41:18 +00:00
Eric Christopher 17674ec8c6 Properly link libpthread_p when using profiling on OpenBSD.
Patch by Brad Smith.

llvm-svn: 163777
2012-09-13 06:32:34 +00:00
Joerg Sonnenberger 85e2bbc3f8 Claim --param ssp-buffer-size, even if the stack protector is not
active.

llvm-svn: 163705
2012-09-12 13:51:14 +00:00
Evgeniy Stepanov cac6aaab0d Make -faddress-sanitizer on Android link to the new-style runtime.
llvm-svn: 163689
2012-09-12 09:09:08 +00:00
Evgeniy Stepanov c9cde48f3a Wrong crtbegin/crtend pair used for PIE on Android.
Android uses the same flavour of crt*.o for PIE and non-PIE executables, and a
different one for DSOs. GNU/Linux, on the other hand, uses one set of crt*.o
for non-PIE executables, and another for both PIE executables and DSOs.

llvm-svn: 163500
2012-09-10 10:30:12 +00:00
Simon Atanasyan 464a7f7e89 MIPS: Use -march=arch option to select either generic MIPS ISA,
or the name of a particular processor.

The patch reviewed by Douglas Gregor.

llvm-svn: 163492
2012-09-10 08:32:41 +00:00
Roman Divacky a3c5024277 Link to crtend.S when PIE in the FreeBSD driver. Patch by Brooks Davis!
llvm-svn: 163388
2012-09-07 13:36:21 +00:00
Eric Christopher c0f1a5e46e Apply some driver improvements for freebsd-*-mips*.
Patch by Brooks Davis.

llvm-svn: 163249
2012-09-05 21:32:44 +00:00
Joao Matos 792d7afdc1 Revert r163076 per chandlerc's request.
llvm-svn: 163146
2012-09-04 17:29:52 +00:00
Evgeniy Stepanov 763671edeb Android standalone toolchain support.
This change adds detection of C++ headers and libraries paths when
building with the standalone toolchain from Android NDK. They are in a
slightly unusual place.

llvm-svn: 163109
2012-09-03 09:05:50 +00:00
Logan Chien c6fd820937 Rename ANDROIDEABI to Android.
Most of the code guarded with ANDROIDEABI are not
ARM-specific, and having no relation with arm-eabi.
Thus, it will be more natural to call this
environment "Android" instead of "ANDROIDEABI".

Note: We are not using ANDROID because several projects
are using "-DANDROID" as the conditional compilation
flag.

llvm-svn: 163088
2012-09-02 09:30:11 +00:00
Joao Matos 2898134f15 Fixed typo causing tests to fail on non-MSVC machines.
llvm-svn: 163077
2012-09-01 23:24:10 +00:00
Joao Matos 344e9f61de Refactored the Windows headers location lookup code. Expose it so standalone tools can have access to it.
llvm-svn: 163076
2012-09-01 22:33:43 +00:00
Nico Weber 723b4f02a7 Reland r160052: Default to -std=c++11 on Windows.
Also update the tests that rely on c++98 to explicitly mention that.

llvm-svn: 162890
2012-08-30 02:08:31 +00:00
Bill Wendling 8c0b4bc339 Emit .gcda files as absolute paths instead of relative paths.
This improves compatibility with gcc in this regard, and this file generation
can be ameliorated with GCOV_PREFIX and GCOV_PREFIX_STRIP. It's also useful if
your build directory doesn't specify -o <abspath> and it uses a recursive make
structure, so it's not relative to the toplevel.

Patch by Joshua Cranmer!
<rdar://problem/12179524>

llvm-svn: 162884
2012-08-30 00:43:41 +00:00
Roman Divacky afe2f23a3c Cleanup FreeBSD linking and add support for -pie.
Path by Brooks Davis, tests and fixes from me.

llvm-svn: 162761
2012-08-28 15:09:03 +00:00
Simon Atanasyan ec4b1c194b MIPS: Use -G option to specify MIPS section threshold. Translate it
to the -mllvm -mips-ssection-threshold=<value> pair and pass to the frontend.
The patch suggested by Carl Norum.

llvm-svn: 162697
2012-08-27 20:55:56 +00:00
John McCall 9320707aac Tweak the ARC-requires-10.6 diagnostic according to Jordan's review.
llvm-svn: 162651
2012-08-27 01:56:21 +00:00
Michael J. Spencer d492219e59 Reduce the amount of state in the Option class by relying on the data from OptTable::Info.
llvm-svn: 162299
2012-08-21 18:51:17 +00:00
Chad Rosier db3da83b28 [driver] Add support for the --param ssp-buffer-size= driver option.
PR9673

llvm-svn: 162285
2012-08-21 16:16:06 +00:00
John McCall 3deb1ad40c Screw around with ObjCRuntime some more, changing the
diagnostics for bad deployment targets and adding a few
more predicates.  Includes a patch by Jonathan Schleifer
to enable ARC for ObjFW.

llvm-svn: 162252
2012-08-21 02:47:43 +00:00
David Blaikie b6b9623952 Fix -Wswitch warning introduced by r162231
llvm-svn: 162236
2012-08-20 22:22:51 +00:00
Michael J. Spencer ad3ccc3cb0 Make Option non virtual.
llvm-svn: 162231
2012-08-20 21:41:17 +00:00
Daniel Dunbar 455a0496b2 darwin/driver: Support using SDKROOT to define the default for -isysroot.
- The SDKROOT environment variable is the de facto way to set the default SDK
   for a number of tools, join forces with them.

llvm-svn: 162116
2012-08-17 18:43:50 +00:00
Nick Lewycky 2fe6aab788 Fix -Wl,--no-demangle to actually pass the flag to the linker on Linux instead
of silently dropping it on the floor.

llvm-svn: 162075
2012-08-17 03:39:16 +00:00
Eli Friedman 5bb2ba0503 Followup to r161546, to unbreak linking on Bitrig. Patch by David Hill.
llvm-svn: 161630
2012-08-09 22:42:04 +00:00
Eli Friedman 9fa2885522 clang support for Bitrig (an OpenBSD fork); patch by David Hill.
llvm-svn: 161546
2012-08-08 23:57:20 +00:00
Bob Wilson 29536fcbd5 Don't complain about -fobjc-link-runtime being unused with -fobjc-arc.
If you build with -fobjc-arc, then -fobjc-link-runtime is implied but we
don't need to warn about it being unused in that case.  rdar://12039965

llvm-svn: 161444
2012-08-07 19:58:00 +00:00
Ted Kremenek 34556ff026 Handle null suffixes in GetTemporaryPath (PCH files don't have suffixes).
llvm-svn: 161367
2012-08-07 00:02:30 +00:00
Richard Smith 403f76ee02 PR13529: Don't crash if the driver sees an unused input file when running as
'clang-cpp'.

For now, the test uses "REQUIRES: shell" to determine if the host system
supports "ln -s", which it uses to create a 'clang-cpp' symlink. This is a bit
hacky and should likely be directly supported by lit.cfg.

llvm-svn: 161317
2012-08-06 04:09:06 +00:00
Fariborz Jahanian c934daba9b Make property synthesis the default on Windows.
llvm-svn: 161266
2012-08-03 21:51:38 +00:00
Chad Rosier 637ecd2098 [driver] Lipo can handle the lto-bc type.
rdar://12000401

llvm-svn: 161216
2012-08-02 21:39:47 +00:00
Jiangning Liu 61b06cbcb4 Support ARM hard float (arm-linux-gnueabihf).
llvm-svn: 161038
2012-07-31 08:06:29 +00:00
Aaron Ballman 1f10cc5eb4 No longer emitting a PCH file when using -fsyntax-only on a header file. Fixes PR13343.
llvm-svn: 161019
2012-07-31 01:21:00 +00:00
Jiangning Liu eabbf92223 Fix dynamic object linker for ARM GNUEABIHF.
llvm-svn: 160958
2012-07-30 11:05:56 +00:00
David Chisnall 5f99f48bcd Provide correct linker command line options on FreeBSD 8 (GNU ld 2.15) and on newer FreeBSD (GNU ld 2.17).
Patch by Dimitry Andric!

llvm-svn: 160931
2012-07-29 15:24:44 +00:00
NAKAMURA Takumi 836926dbdf clang/lib: [CMake] Update tblgen'd dependencies.
llvm-svn: 160851
2012-07-27 06:18:33 +00:00
NAKAMURA Takumi 075c89bc06 clang/lib: [CMake] Reformat, alphabetize lists.
llvm-svn: 160850
2012-07-27 06:18:12 +00:00
Chad Rosier ae7581dfd6 [driver crash diagnostics] Strip -internal-isystem and -internal-externc-isystem.
rdar://11949066

llvm-svn: 160752
2012-07-25 18:55:43 +00:00
Chad Rosier 7a42ff546a [driver crash diagnostics] Strip -idirafter, -iprefix, -iwithprefix,
-iwithprefixbefore, and -isystem options, per Matt's suggestion.
rdar://11949066

llvm-svn: 160750
2012-07-25 18:38:57 +00:00
Chad Rosier 959f0b3a07 [driver crash diagnostics] A few enhancements:
-Strip -iquote and -M options.
 -Quote -D options to avoid problems with command line macros that include
  parens.
rdar://11949066

llvm-svn: 160743
2012-07-25 17:52:16 +00:00
Chad Rosier d3957e57f6 Rename -fms-inline-asm to -fenable-experimental-ms-inline-asm.
llvm-svn: 160590
2012-07-20 23:12:26 +00:00
Chad Rosier ed94324e70 Add a new flag, -fms-inline-asm, that enables the output of MS-style inline
assembly.  

By default, we don't emit IR for MS-style inline assembly (see r158833 as to 
why).  This is strictly for testing purposes and should not be enabled with the
expectation that things will work.  This is a temporary flag and will be removed
once MS-style inline assembly is fully supported.

llvm-svn: 160573
2012-07-20 21:20:33 +00:00
Bob Wilson 6a039161d7 Define __FINITE_MATH_ONLY__ based on -ffast-math and -ffinite-math-only.
This macro was being unconditionally set to zero, preceded by a FIXME comment.
This fixes <rdar://problem/11845441>.  Patch by Michael Gottesman!

llvm-svn: 160491
2012-07-19 03:52:53 +00:00
Bob Wilson 25d3bfd895 Force the OS X version to 10.6 for old-style simulator builds.
The hack of recognizing a -D__IPHONE_OS_VERSION_MIN_REQUIRED option
in place of -mios-simulator-version-min leaves the Darwin version
unspecified.  It can be set separately with -mmacosx-version-min (which
makes no sense) or inferred to match the host version (which is unpredictable
and usually wrong).  This really needs to get cleaned up, but in the
meantime, force the OS X version to 10.6 so that the behavior is sane for
the iOS simulator.  Thanks for Argyrios for the patch.
<rdar://problem/11858187>

llvm-svn: 160484
2012-07-19 01:35:55 +00:00
NAKAMURA Takumi ed5bbe9020 [Win32] Rework crash-report since r145389.
- lib/Driver/Driver.cpp, tools/driver/driver.cpp: Exit status should not be propagated, although clang driver should catch exceptions.
  - test/Driver/crash-report.c: Add REQUIRES:shell for now.
    FIXME: setenv should work also on Lit.InternalShellRunner.
  - test/Driver/crash-report.c: Remove XFAIL.

Thanks to Chad, To point out the issue.

llvm-svn: 160343
2012-07-17 05:09:29 +00:00
David Chisnall df3045f0e3 Enable new linker behaviour on FreeBSD.
llvm-svn: 160231
2012-07-15 12:53:06 +00:00
NAKAMURA Takumi e5494ffe4f Revert r160052, "Default to -std=c++11 on Windows.", for now.
Failing Tests (3):
    Clang :: Index/complete-cxx-inline-methods.cpp
    Clang :: Index/recursive-cxx-member-calls.cpp
    Clang :: SemaTemplate/inject-templated-friend-post.cpp

llvm-svn: 160103
2012-07-12 03:14:56 +00:00
Chad Rosier 4dce73af05 [driver] Fix so that clang can find correct path prefix for libc object files
from GNU binutils supporting multi-arch folder for ARM target.
Patch by Jiangning Liu <jiangning.liu@arm.com>.

llvm-svn: 160060
2012-07-11 19:08:21 +00:00
Nico Weber cc19aec7ae Default to -std=c++11 on Windows.
llvm-svn: 160052
2012-07-11 16:46:17 +00:00
Chad Rosier 6213549751 80-column and whitespace.
llvm-svn: 159942
2012-07-09 17:31:28 +00:00
Ted Kremenek b22ea2acea Re-apply r159875 with fixes.
- Split pedantic driver flag test into separate test file, and XFAIL on cygwin,mingw32
- Fix bug in tablegen logic where a missing '{' caused errors to be included in -Wpedantic.

llvm-svn: 159892
2012-07-07 05:53:30 +00:00
NAKAMURA Takumi eec53e4069 Revert rr159875, "Implement -Wpedantic and --no-pedantic to complement -Weverything." It broke several builds.
I suspect FileCheck might match assertion failure, even if clang/test/Misc/warning-flags.c passed the test.

> 0. Program arguments: bin/./clang -### -pedantic -Wpedantic clang/test/Driver/warning-options.cpp

llvm-svn: 159886
2012-07-07 02:48:02 +00:00
Ted Kremenek 9877f689f2 Implement -Wpedantic and --no-pedantic to complement -Weverything.
This patch introduces some magic in tablegen to create a "Pedantic" diagnostic
group which automagically includes all warnings that are extensions.  This
allows a user to suppress specific warnings traditionally under -pedantic used
an ordinary warning flag.  This also allows users to use #pragma to silence
specific -pedantic warnings, or promote them to errors, within blocks of text
(just like any other warning).

-Wpedantic is NOT an alias for -pedantic.  Instead, it provides another way
to (a) activate -pedantic warnings and (b) disable them.  Where they differ
is that -pedantic changes the behavior of the preprocessor slightly, whereas
-Wpedantic does not (it just turns on the warnings).

The magic in the tablegen diagnostic emitter has to do with computing the minimal
set of diagnostic groups and diagnostics that should go into -Wpedantic, as those
diagnostics that already members of groups that themselves are (transitively) members
of -Wpedantic do not need to be included in the Pedantic group directly.  I went
back and forth on whether or not to magically generate this group, and the invariant
was that we always wanted extension warnings to be included in -Wpedantic "some how",
but the bookkeeping would be very onerous to manage by hand.

-no-pedantic (and --no-pedantic) is included for completeness, and matches many of the
same kind of flags the compiler already supports.  It does what it says: cancels out
-pedantic.  One discrepancy is that if one specifies --no-pedantic and -Weverything or
-Wpedantic the pedantic warnings are still enabled (essentially the -W flags win).  We
can debate the correct behavior here.

Along the way, this patch nukes some code in TextDiagnosticPrinter.cpp and CXStoredDiagnostic.cpp
that determine whether to include the "-pedantic" flag in the warning output.  This is
no longer needed, as all extensions now have a -W flag.

This patch also significantly reduces the number of warnings not under flags from 229
to 158 (all extension warnings).  That's a 31% reduction.

llvm-svn: 159875
2012-07-06 23:07:31 +00:00
Lang Hames aa53b936ec Add -ffp-contract = { fast | on | off } command line option support.
This flag sets the 'fp-contract' mode, which controls the formation of fused
floating point operations. Available modes are:

- Fast: Form fused operations anywhere. 
- On: Form fused operations where allowed by FP_CONTRACT. This is the default
      mode.
- Off: Don't form fused operations (in future this may be relaxed to forming
       fused operations where it can be proved that the result won't be
       affected).

Currently clang doesn't support the FP_CONTRACT pragma, so the 'On' and 'Off'
modes are equivalent.

llvm-svn: 159794
2012-07-06 00:59:19 +00:00
Simon Atanasyan 9c6f1f7f23 MIPS: Add -mdsp/-mno-dsp and -mdspr2/-mno-dspr2 command line options support.
llvm-svn: 159769
2012-07-05 19:23:00 +00:00
Simon Atanasyan 9b1932d4e4 MIPS: Factor out the code converting command line options to target features.
llvm-svn: 159767
2012-07-05 18:51:43 +00:00
Simon Atanasyan 6f23fa0f18 MIPS: Add -mips16 / -mno-mips16 command line support.
llvm-svn: 159747
2012-07-05 14:19:39 +00:00
David Chisnall da22535573 Hoist the logic for selecting the Objective-C dispatch method into the runtime
class, from the target.  No functionality change, just less duplicated logic.

llvm-svn: 159710
2012-07-04 11:52:24 +00:00