Commit Graph

594 Commits

Author SHA1 Message Date
Fariborz Jahanian b5dd2cb13c objective-c: fix a sema and IRGen crash when property
getter result type is safe but does not match with property 
type resulting in spurious warning followed by crash in
IRGen. // rdar://11515196

llvm-svn: 157641
2012-05-29 19:56:01 +00:00
Argyrios Kyrtzidis da6d7679e8 Add documentation about boxing enum types and a codegen test to make
sure we pick up the underlying type, per suggestion by Fariborz.

No functionality change.

llvm-svn: 156851
2012-05-15 20:45:35 +00:00
Jordy Rose 0b9cfa2b06 Test for -fdebugger-objc-literal: missing methods should be generated like missing classes.
llvm-svn: 156746
2012-05-13 20:36:47 +00:00
Argyrios Kyrtzidis 74d7f15aed Add a test case for going through typedefs until we reach "BOOL", that NSAPI::isObjCTypedef() is doing.
llvm-svn: 156604
2012-05-11 01:53:27 +00:00
Argyrios Kyrtzidis 6062da47b8 [objc] When boxing a BOOL/NSInteger/NSUInteger type, use the corresponding
numberWithBool:/numberWithInteger:/numberWithUnsignedInteger: NSNumber selectors.

rdar://11428703

llvm-svn: 156583
2012-05-10 23:12:03 +00:00
Fariborz Jahanian 2faa82d4b8 Test case for previosu patch.
// rdar://11323676

llvm-svn: 155664
2012-04-26 21:34:02 +00:00
Eric Christopher 3cc207bbcc Forward declarations should take a context. This helps the debugger
find forward declarations in the context that the actual definition
will occur.

rdar://11291658

llvm-svn: 155381
2012-04-23 19:00:24 +00:00
Fariborz Jahanian 440b524b46 minor improvement to couple of tests.
llvm-svn: 155204
2012-04-20 17:07:07 +00:00
Patrick Beard 0caa39474b Implements boxed expressions for Objective-C. <rdar://problem/10194391>
llvm-svn: 155082
2012-04-19 00:25:12 +00:00
Eric Christopher 56ef374611 The copy and destroy helper functions aren't prototyped, don't call them
so.

llvm-svn: 154569
2012-04-12 00:35:04 +00:00
Eric Christopher 03c50998cb Add a triple to this test.
llvm-svn: 154485
2012-04-11 07:08:37 +00:00
Eric Christopher d79e19ea84 Try to fix the windows buildbots by making this test a little less
dependent upon metadata ordering.

llvm-svn: 154482
2012-04-11 06:09:33 +00:00
Eric Christopher 3d19de9910 Enable debug info for objective c implementations that may not have
an explicit instance variable.

rdar://10590352

llvm-svn: 154481
2012-04-11 05:56:05 +00:00
David Chisnall 58464d0fe1 Revert r154321, pending more discussion.
llvm-svn: 154327
2012-04-09 17:25:11 +00:00
David Chisnall 4ec2af2fab Add -fobjc-trace to emit a call before and after each Objective-C message send
for hooking in code flow visualisation applications.  

llvm-svn: 154321
2012-04-09 15:42:15 +00:00
Eric Christopher c465ce9e79 Enhance testing a bit to make sure that we're omitting the
getter and setter when they're synthesized with the default
names.

rdar://11179756

llvm-svn: 154130
2012-04-05 22:03:35 +00:00
Eric Christopher f3dd713bce Only emit the getter and setter names if they're not the default
synthesized ones. Reasonable debug info size reduction for objc.

rdar://11179756

llvm-svn: 154129
2012-04-05 22:03:32 +00:00
John McCall 3abee49d1c Enter an expression evaluation context when parsing
statement-expressions.  Prevents cleanups and such from being
claimed by the first full-expression in the block.

llvm-svn: 153989
2012-04-04 01:27:53 +00:00
Eric Christopher b7e821a6aa Change location information for synthesized properties to be at the
property file/line rather than the @synthesize file/line. Avoids
some nasty confusing-ness with conflating the file from the scope
and the line from the original declaration. Use    the current scope
location as a separate parameter so that we can    match it up
better in the line table with the beginning of the scope.

Update a couple of testcases accordingly since I had to change
that we actually use the passed in location in EmitFunctionStart
and for the new metadata parameter and add a new testcase to
make sure we've got the right line numbers for synthesized
properties.

Part of rdar://11026482

llvm-svn: 153917
2012-04-03 00:44:15 +00:00
Eric Christopher fef37f81b4 Revert previous commit changing location information to see if this
is causing the gdb test failures on the bots.

llvm-svn: 153727
2012-03-30 05:42:12 +00:00
Eli Friedman 410fc7ae89 Make sure we perform the relevant implied conversions correctly for ObjC methods with related result types. PR12384.
llvm-svn: 153716
2012-03-30 01:13:43 +00:00
Eric Christopher f4d006348b Testcase for the previous commit.
llvm-svn: 153715
2012-03-30 01:07:51 +00:00
Eric Christopher df02b36a2c Change location information for synthesized properties to be at the
property file/line rather than the @synthesize file/line. Avoids
some nasty confusing-ness with conflating the file from the scope
and the line from the original declaration.

Update a couple of testcases accordingly since I had to change
that we actually use the passed in location in EmitFunctionStart.

Fixes rdar://11026482

llvm-svn: 153714
2012-03-30 01:07:48 +00:00
Bill Wendling 82b87f19e2 The UTF16 string referenced by a CFString should go into the __TEXT,__ustring
section. A 'normal' string will go into the __TEXT,__const section, but this
isn't good for UTF16 strings. The __ustring section allows for coalescing, among
other niceties (such as allowing the linker to easily split up strings).

Instead of outputting the UTF16 string as a series of bytes, output it as a
series of shorts. The back-end will then nicely place the UTF16 string into the
correct section, because it's a mensch.
<rdar://problem/10655949>

llvm-svn: 153710
2012-03-30 00:26:17 +00:00
Eric Christopher bd9c910c8c Go back to using just the selector name for the getter and setter
in the property debug info. Any more isn't necessary after all.

rdar://11144023

llvm-svn: 153659
2012-03-29 17:31:33 +00:00
Eric Christopher eb03169b9a Add support for objc property decls according to the page at:
http://llvm.org/docs/SourceLevelDebugging.html#objcproperty

    including type and DECL. Expand the getter and setter names
    into the fully qualified names.

    rdar://11144023

llvm-svn: 153640
2012-03-29 08:43:37 +00:00
Ted Kremenek e65b086e07 Add clang support for new Objective-C literal syntax for NSDictionary, NSArray,
NSNumber, and boolean literals.  This includes both Sema and Codegen support.
Included is also support for new Objective-C container subscripting.

My apologies for the large patch.  It was very difficult to break apart.
The patch introduces changes to the driver as well to cause clang to link
in additional runtime support when needed to support the new language features.

Docs are forthcoming to document the implementation and behavior of these features.

llvm-svn: 152137
2012-03-06 20:05:56 +00:00
Fariborz Jahanian e5d9b0b8c8 Test is fixed.
llvm-svn: 151280
2012-02-23 20:43:56 +00:00
Fariborz Jahanian 1e2303379d XFAIL test until I figure out how to make test pass on different platforms.
llvm-svn: 151277
2012-02-23 20:22:21 +00:00
Fariborz Jahanian 7cef65a3b6 Change test again so it passes in build-bot until I can figure out what is
going on.

llvm-svn: 151275
2012-02-23 20:07:38 +00:00
Fariborz Jahanian b96a293a59 fix test for patch in r151268.
llvm-svn: 151272
2012-02-23 18:57:03 +00:00
Fariborz Jahanian 2f0de8bdb9 objective-c default synthesis. classes which adopt protocol properties
must still auto synthesize those propeties which have been redeclared 
in the class. // rdar://10907410

llvm-svn: 151268
2012-02-23 18:21:25 +00:00
Eli Friedman 91f5ae5022 Try to handle qualifiers more consistently for array InitListExprs. Fixes <rdar://problem/10907510>, and makes the ASTs a bit more self-consistent.
(I've chosen to keep the qualifiers, but it isn't a strong preference; if anyone prefers removing them, please yell.)

llvm-svn: 151229
2012-02-23 02:25:10 +00:00
Eli Friedman 91d5bb1ee5 Make sure null initialization in arrays works correctly with ARC types. <rdar://problem/10907547>.
llvm-svn: 151133
2012-02-22 05:38:59 +00:00
Fariborz Jahanian caabf1bb64 objc IRGen: force CSE of load of ivar offsets by setting
the 'invariant.load' metadata tag onto those loads.
// rdar://10840980

llvm-svn: 150994
2012-02-20 22:42:22 +00:00
Chad Rosier 112e71ee7c Make test case less sensitive to metadata numbering.
llvm-svn: 150983
2012-02-20 19:51:44 +00:00
Eric Christopher 66562a4a54 Remove the type retaining from the clang frontend. This is now
handled by the caching and rauw. Also fix one cache that wasn't
being added to highlighted by this patch. Update all testcases
accordingly.

This should fix the deall failure.

llvm-svn: 150977
2012-02-20 18:05:24 +00:00
John McCall a729c62b81 Whether an argument is required (in contrast with being an
optional argument passed through the variadic ellipsis)
potentially affects how we need to lower it.  Propagate
this information down to the various getFunctionInfo(...)
overloads on CodeGenTypes.  Furthermore, rename those
overloads to clarify their distinct purposes, and make
sure we're calling the right one in the right place.
This has a nice side-effect of making it easier to construct
a function type, since the 'variadic' bit is no longer
separable.

This shouldn't really change anything for our existing
platforms, with one minor exception --- we should now call
variadic ObjC methods with the ... in the "right place"
(see the test case), which I guess matters for anyone
running GNUStep on MIPS.  Mostly it's just a substantial
clean-up.

llvm-svn: 150788
2012-02-17 03:33:10 +00:00
Dan Gohman 7537838499 Fix this test to work with and without Asserts mode.
llvm-svn: 150713
2012-02-16 18:51:05 +00:00
Bill Wendling 75ff46d917 Fix test to not depend upon metadata numbers.
llvm-svn: 150668
2012-02-16 08:58:11 +00:00
NAKAMURA Takumi 59b1bc16eb test/CodeGenObjC/arc-no-arc-exceptions.m: Disable it at -Asserts for now.
llvm-svn: 150666
2012-02-16 08:12:12 +00:00
Chad Rosier ffbf9f1406 Fix test for r150648.
llvm-svn: 150650
2012-02-16 01:56:55 +00:00
Bill Wendling b6f795eee6 Use the new method for specifying garbage collection metadata in the module.
The garbage collection metadata needs to be merged "intelligently", when two or
more modules are linked together, and not merely appended. (Appending creates a
section which is too large.) The module flags metadata method is the way to do
this.
<rdar://problem/8198537>

llvm-svn: 150648
2012-02-16 01:13:30 +00:00
Dan Gohman 515a60daff Teach clang to add metadata tags to calls and invokes in ObjC with
-fno-objc-arc-exceptions. This will allow the optimizer to perform
optimizations which are only safe under that flag.

This is a part of rdar://10803830.

llvm-svn: 150644
2012-02-16 00:57:37 +00:00
Fariborz Jahanian 430b35edf8 objc-arc: For arc's ivar layout, treat __unsafe_unretained ivars
as unscanned. // rdar://10832643

llvm-svn: 150639
2012-02-16 00:15:02 +00:00
Devang Patel 37a5c9564d Emit debug info for properites that are not backed by an ivar.
llvm-svn: 149995
2012-02-07 18:40:30 +00:00
Devang Patel f93d0b8b28 Relax valid location check. This fixes a clang crash while emitting debug info for properties that are synthesized by the compiler by default.
llvm-svn: 149929
2012-02-06 23:24:13 +00:00
Devang Patel 60fc242545 Let an ivar directly refer property TAG.
llvm-svn: 149881
2012-02-06 18:20:02 +00:00
Richard Smith 5d8e7593e3 Unbreak failing test added in r149738.
llvm-svn: 149766
2012-02-04 05:33:36 +00:00
Devang Patel c047c4d15b New test case.
llvm-svn: 149738
2012-02-04 01:30:45 +00:00