Commit Graph

238 Commits

Author SHA1 Message Date
Nick Lewycky 1abf57d5a9 Fix this test on machines that don't run clang -cc1as when asked to assemble.
llvm-svn: 133688
2011-06-23 05:38:06 +00:00
John McCall b5f652e3ef It is possible to request the nonfragile ABI with -fobjc-abi-version=2;
respect that when deciding whether -objc-exceptions implies the
-fexceptions -cc1 option.

llvm-svn: 133590
2011-06-22 00:53:57 +00:00
Daniel Dunbar 3d125d329c Driver/Darwin: Fixup version check for -object_path_lto support.
llvm-svn: 133548
2011-06-21 21:18:32 +00:00
Daniel Dunbar ef889c7c9b Driver/Darwin: When invoking the linker, automatically pass -object_path_lto so
that the linker has a place to put the temporary object file and can leave it
around (for the driver to clean up). This is important so that the object file
references in the debug info are preserved for possible use by dsymutil.
 - <rdar://problem/8294279> executable has no debug symbols when compiled with LTO

llvm-svn: 133543
2011-06-21 20:55:11 +00:00
Nick Lewycky 9e8bf1ba06 Also fix the warning about using "clang" instead of %clang.
llvm-svn: 133492
2011-06-21 00:23:47 +00:00
Nick Lewycky 65df58582c Remove the leading hyphen so that grep doesn't parse it as one long option :)
llvm-svn: 133491
2011-06-21 00:21:22 +00:00
Daniel Dunbar 471c4f8299 Driver/Darwin: Honor -Xarch_FOO when the arch matches either the toolchain or
the architecture being bound.
 - Fixes things like -Xarch_armv7.

llvm-svn: 133490
2011-06-21 00:20:17 +00:00
Nick Lewycky ca6b90d8af Add support for -Wa,--noexecstack when building from a non-assembly file. For
an assembly file it worked correctly, while for a .c file it would given an
error about how --noexecstack is not a supported argument to -Wa.

llvm-svn: 133489
2011-06-21 00:14:18 +00:00
Eli Friedman 623e2ba435 Add support for -force_load flag, for compat with Apple gcc. rdar://9555962 .
llvm-svn: 133218
2011-06-16 23:59:43 +00:00
John McCall 17b4c83c91 Make this test pretend to be on a darwin host.
llvm-svn: 133125
2011-06-16 01:18:08 +00:00
John McCall 31168b077c Automatic Reference Counting.
Language-design credit goes to a lot of people, but I particularly want
to single out Blaine Garst and Patrick Beard for their contributions.

Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself,
in no particular order.

llvm-svn: 133103
2011-06-15 23:02:42 +00:00
Douglas Gregor a860e6aebc Introduce a -cc1-level option to turn off related result type
inference, to be used (only) by the Objective-C rewriter.

llvm-svn: 133025
2011-06-14 23:20:43 +00:00
Douglas Gregor c9224d6714 Eliminate the -f[no]objc-infer-related-result-type flags; there's no
reason to allow the user to control these semantics through a flag.

llvm-svn: 132919
2011-06-13 16:42:53 +00:00
Douglas Gregor 33823727c8 Implement Objective-C Related Result Type semantics.
Related result types apply Cocoa conventions to the type of message
sends and property accesses to Objective-C methods that are known to
always return objects whose type is the same as the type of the
receiving class (or a subclass thereof), such as +alloc and
-init. This tightens up static type safety for Objective-C, so that we
now diagnose mistakes like this:

t.m:4:10: warning: incompatible pointer types initializing 'NSSet *'
with an
      expression of type 'NSArray *' [-Wincompatible-pointer-types]
  NSSet *array = [[NSArray alloc] init];
         ^       ~~~~~~~~~~~~~~~~~~~~~~
/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:72:1:
note: 
      instance method 'init' is assumed to return an instance of its
      receiver
      type ('NSArray *')
- (id)init;
^

It also means that we get decent type inference when writing code in
Objective-C++0x:

  auto array = [[NSMutableArray alloc] initWithObjects:@"one",  @"two",nil];
  //    ^ now infers NSMutableArray* rather than id

llvm-svn: 132868
2011-06-11 01:09:30 +00:00
Nick Lewycky 97864dac76 On linux, -nostdlib was causing a --start-group with no --end-group to be passed
to the linker.

llvm-svn: 132629
2011-06-04 06:27:06 +00:00
Eli Friedman 1ddf91621e Fix the Windows buildbots, now that I can actually see what was going wrong with this test.
llvm-svn: 132521
2011-06-03 00:54:56 +00:00
Eli Friedman 8c5014dc5e Switch a ridiculous grep over to FileCheck.
llvm-svn: 132496
2011-06-02 22:16:39 +00:00
Rafael Espindola 9d4a8cf481 Change how we link libprofile_rt.a. While at it, refactor the code a bit.
llvm-svn: 132474
2011-06-02 18:58:46 +00:00
Nick Lewycky 8a54c3d4ce Fix Darwin test for r132006.
llvm-svn: 132013
2011-05-24 22:18:08 +00:00
Rafael Espindola f934f98ad2 The logic about -static is darwin only. For now assume that all non
darwin assembler can handle cfi. Add a test.

llvm-svn: 131464
2011-05-17 16:26:17 +00:00
Daniel Dunbar eb86b04595 Driver/Darwin: Put dsymutil -o arguments first, so that dysmutil doesn't barf
when POSIXLY_COMPLIANT is set.
 - Patch by Dave Vasilevsky!

llvm-svn: 131084
2011-05-09 17:23:16 +00:00
Daniel Dunbar ce1035c20f Frontend: Fix a crash in CC_LOG_DIAGNOSTICS handling.
llvm-svn: 130909
2011-05-05 02:12:02 +00:00
Daniel Dunbar 7e0058626a tests: Tweak test to at least use a standard arch, to ensure we try to invoke
Clang.

llvm-svn: 130861
2011-05-04 19:52:08 +00:00
Devang Patel 85ac42339c Update metadata id number in string compare check.
llvm-svn: 130757
2011-05-03 16:19:38 +00:00
Daniel Dunbar 8438464b41 Driver/Darwin: Honor --sysroot= when invoking the linker, on Darwin.
llvm-svn: 130723
2011-05-02 21:03:47 +00:00
Daniel Dunbar c44d313cff Driver/Darwin/ld: Set the deployment target following the version information in
the tool chain, instead of based on the translated arguments.

llvm-svn: 130440
2011-04-28 21:23:41 +00:00
Chandler Carruth 30483fb188 Move all of the logic for __DEPRECATED to the driver based on comments
from dgregor.

llvm-svn: 130066
2011-04-23 19:48:40 +00:00
Chandler Carruth 61fbf62838 Fix Clang's __DEPRECATED define to be controled by -Wdeprecated. This
matches GCC behavior which libstdc++ uses to limit #warning-based
messages about deprecation.

The machinery involves threading this through a new '-fdeprecated-macro'
flag for CC1. The flag defaults to "on", similarly to -Wdeprecated. We
turn the flag off in the driver when the warning is turned off (modulo
matching some GCC bugs). We record this as a language option, and key
the preprocessor on the option when introducing the define.

A separate flag rather than a '-D' flag allows us to properly represent
the difference between C and C++ builds (only C++ receives the define),
and it allows the specific behavior of following -Wdeprecated without
potentially impacting the set of user-provided macro flags.

llvm-svn: 130055
2011-04-23 09:27:53 +00:00
Chandler Carruth b009b14971 There were some frustrating problems with the implementation of
-Wwrite-strings. First and foremost, once the positive form of the flag
was passed, it could never be disabled by passing -Wno-write-strings.
Also, the diagnostic engine couldn't in turn use -Wwrite-strings to
control diagnostics (as GCC does) because it was essentially hijacked to
drive the language semantics.

Fix this by giving CC1 a clean '-fconst-strings' flag to enable
const-qualified strings in C and ObjC compilations. Corresponding
'-fno-const-strings' is also added. Then the driver is taught to
introduce '-fconst-strings' in the CC1 command when '-Wwrite-strings'
dominates.

This entire flag is basically GCC-bug-compatibility driven, so we also
match GCC's bug where '-w' doesn't actually disable -Wwrite-strings. I'm
open to changing this though as it seems insane.

llvm-svn: 130051
2011-04-23 06:30:43 +00:00
Daniel Dunbar bbd482226e Driver/Darwin: Allow OS X deployment targets like 10.4.11, even though they
can't be represented in the environment define.

llvm-svn: 129939
2011-04-21 21:27:33 +00:00
Daniel Dunbar fcd2389b7a TWEAK
llvm-svn: 129835
2011-04-19 23:34:21 +00:00
Daniel Dunbar 5c56828d91 Driver/Darwin: Switch to using new style triples.
llvm-svn: 129824
2011-04-19 21:45:47 +00:00
Chris Lattner 57540c5be0 fix a bunch of comment typos found by codespell. Patch by
Luis Felipe Strano Moraes!

llvm-svn: 129559
2011-04-15 05:22:18 +00:00
Chandler Carruth a7773f719e Add -no-canonical-prefixes to tests which assert on the name of the
built clang binary that is used by the test. Build systems that use
symlinks for build outputs will fail these assertions otherwise.

llvm-svn: 129482
2011-04-13 22:28:36 +00:00
Daniel Dunbar 2f8d10e8d7 Fronted/CC_LOG_DIAGNOSTICS: Add test case.
llvm-svn: 129097
2011-04-07 19:05:06 +00:00
Chandler Carruth 82701204a4 Add my test case for r128353. I think this is the last test case to fail
to be added... Sorry for the noise.

llvm-svn: 128395
2011-03-27 21:03:41 +00:00
Daniel Dunbar 67fea71c2d Driver/Darwin: Dsymutil actions should put the dSYM adjacent to the output file.
llvm-svn: 128292
2011-03-25 18:16:51 +00:00
Daniel Dunbar 12100e2c7f Frontend: Add a more explicit -backend-option flag for passing backend command
line options, instead of leveraging the blanket -mllvm option.
 - This allows using the frontend itself without requiring the backend have
   those options available (i.e., if the target wasn't built).

llvm-svn: 128087
2011-03-22 16:48:17 +00:00
Daniel Dunbar 151a372113 Driver/Darwin: Transparently fallback when compiling i386 -fapple-kext code, we
don't support the ABI yet.

llvm-svn: 127903
2011-03-18 20:14:03 +00:00
NAKAMURA Takumi f5606922f8 test/Driver/sysroot-flags.c: Tweak for Mingw MSYS bash.
MSYS substitutes path (that begins with "/") to de-mounted Windows path, even if it were nonexistent.
"/foo/bar" might be substituted to "C:/msysgit/foo/bar".

llvm-svn: 127861
2011-03-18 03:21:33 +00:00
NAKAMURA Takumi 1bd6491f7f test/Driver/darwin-cc.c: FileCheck-ize and tweak for Mingw MSYS bash.
MSYS substitutes path (that begins with "/") to de-mounted Windows path.
"/tmp" might be substituted as "C:/DOCUME~1/chapuni/LOCALS~1/Temp".

llvm-svn: 127860
2011-03-18 03:21:26 +00:00
Daniel Dunbar c44f8cf7b8 Driver/Obj-C: Be compatible with GCC behavior in that -fno-exceptions *does not*
disable Obj-C exceptions.

llvm-svn: 127836
2011-03-17 23:28:31 +00:00
Daniel Dunbar 033a4bc49e Driver/Darwin: These are command line options, not target features.
llvm-svn: 127820
2011-03-17 18:29:04 +00:00
Daniel Dunbar c9388c11f1 Driver/Darwin/ARM: Kernel/kext code has more strict alignment requirements.
llvm-svn: 127815
2011-03-17 17:10:06 +00:00
Daniel Dunbar b1db4b69cc Driver/ARM: Match GCC behavior in that -msoft-float disables NEON, despite this
not being consistent at all with other parts of the GCC implementation.

llvm-svn: 127777
2011-03-17 00:07:34 +00:00
NAKAMURA Takumi c9998aa1f4 test/Driver/hello.c: Tweak for cygming.
- Driver's name may be "clang(-\d.\d).exe".
  - Emitted executable file is named as "%t.exe". It must be harmless on other OS.

llvm-svn: 127729
2011-03-16 13:51:46 +00:00
Chandler Carruth 306f98c241 Add a test case that would have caught the bug fixed in r126640.
I've only covered C++'s flags here, we should probably do something
similar for ObjC flags.

llvm-svn: 126641
2011-02-28 07:38:09 +00:00
Frits van Bommel ba6ce03e46 Fix this test case for CMake builds after r126502, which sneakily changed the actual executable name to clang-<version>.
llvm-svn: 126560
2011-02-27 01:17:12 +00:00
Anders Carlsson 3320e1575f Make clang -cc1 disable Objective-C exceptions by default, and add a -fobjc-exceptions flag to turn them on.
Update all tests accordingly.

llvm-svn: 126177
2011-02-22 01:52:06 +00:00
Daniel Dunbar bd466d404a tests: Fix test on Win32.
llvm-svn: 126087
2011-02-20 17:41:24 +00:00