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

256 Коммитов

Автор SHA1 Сообщение Дата
Fariborz Jahanian 090d1bd613 Fixes an ObjC++ parse crash caused by delayed parsing
of c-functions nested in namespace in method implementations
by turning off its delayed parsing until a proper solution is 
figured out. pr13418


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160552 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-20 17:19:54 +00:00
Jordan Rose b13291aa59 Capitalize "Objective-C" and "C++" in user-facing contexts.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160516 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-19 18:10:18 +00:00
Douglas Gregor b251302dd5 When performing the deduced/actual argument type check for C++
[temp.deduct.call]p4 under Objective-C++ ARC, make sure to adjust the
qualifiers to introduce the implicit strong lifetime when
needed. Fixes <rdar://problem/11825671>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160412 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-18 00:14:59 +00:00
Fariborz Jahanian 4d3db4eb6c objective-c++11: extend c++11 range-based loop to iterate
over objective-c container collection. // rdar://9293227


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159847 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-06 19:04:04 +00:00
Fariborz Jahanian 39700f81c5 objective-c++ parsing. Turn off delayed parsing
of out-of-line c++ method definition which happens
to be inside an objc class implementation
until I can figure out how to do it. This is to fix 
a broken project.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159772 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-05 19:34:20 +00:00
Fariborz Jahanian b0ed95c273 Obj-C++11 parser: handle a fall out of delayed
c-function parsing when a declaration with
C++0x braced-init-list is inside an @implementation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159693 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-03 23:22:13 +00:00
Douglas Gregor 14b23277db Teach the __is_trivially_assignable and __is_trivially_constructible
type traits that assignment to/construction of a lifetime-qualified
object under ARC is *not* trivial. Fixes <rdar://problem/11738725>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159401 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-29 00:49:17 +00:00
Fariborz Jahanian 67e8a8b00b objective-c: improve diagnostic when collection expression is
not a pointer to a fast-enumerable object. // rdar://11488666


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158998 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-22 15:37:00 +00:00
John McCall 260611a325 Restructure how the driver communicates information about the
target Objective-C runtime down to the frontend:  break this
down into a single target runtime kind and version, and compute
all the relevant information from that.  This makes it
relatively painless to add support for new runtimes to the
compiler.  Make the new -cc1 flag, -fobjc-runtime=blah-x.y.z,
available at the driver level as a better and more general
alternative to -fgnu-runtime and -fnext-runtime.  This new
concept of an Objective-C runtime also encompasses what we
were previously separating out as the "Objective-C ABI", so
fragile vs. non-fragile runtimes are now really modelled as
different kinds of runtime, paving the way for better overall
differentiation.

As a sort of special case, continue to accept the -cc1 flag
-fobjc-runtime-has-weak, as a sop to PLCompatibilityWeak.

I won't go so far as to say "no functionality change", even
ignoring the new driver flag, but subtle changes in driver
semantics are almost certainly not intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158793 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-20 06:18:46 +00:00
Jordan Rose 294e38664f Test that -Wauto-var-id fires in value-dependent contexts.
There was already a test that it did not fire in type-dependent contexts.
This was already behaving correctly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158530 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-15 18:19:43 +00:00
Jordan Rose 0abbdfe561 Warn in ObjC++ when an 'auto' variable deduces type 'id'.
This could happen for cases like this:

- (NSArray *)getAllNames:(NSArray *)images {
  NSMutableArray *results = [NSMutableArray array];
  for (auto img in images) {
    [results addObject:img.name];
  }
  return results;
}

Here the property access will fail because 'img' has type 'id', rather than,
say, NSImage.

This warning will not fire in templated code, since the 'id' could have
come from a template parameter.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158239 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-08 22:46:07 +00:00
Argyrios Kyrtzidis f5343ff93a Allow objc @() syntax for enum types.
Previously we would reject it as illegal using a value of
enum type and on ObjC++ it was illegal to use an enumerator
as well.

rdar://11454917

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156843 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-15 19:17:44 +00:00
Eli Friedman e4c043d3fd Add a missing RequireCompleteType call when synthesizing properties. <rdar://problem/11333367>.
While I'm here, fix source locations for other diagnostics related to property synthesis.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155953 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-01 22:26:06 +00:00
Douglas Gregor e7be1090e8 HandleDeclarator() returns NULL for semantic disasters. Deal with it
when we're in an Objective-C container context. Fixes
<rdar://problem/11286701>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155836 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-30 18:13:01 +00:00
Douglas Gregor e656b8397f Teach RequireCompleteType about multi-dimensional arrays. Fixes
<rdar://problem/11284902>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155356 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-23 16:42:52 +00:00
Fariborz Jahanian 93a49944e0 objective-c modern translator: buildit objc bool
type for rewriter project will be BoolTy.
// rdar://11231426. 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154861 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-16 21:03:30 +00:00
Douglas Gregor f53bc3126b super and class property reference expressions don't need to be
rebuilt. Fixes <rdar://problem/11052352>. 



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154667 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-13 15:53:08 +00:00
Fariborz Jahanian 9985038860 objective-c numeric literal: type of boolean is
that of typedef BOOL if found.
// rdar://11231426


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154595 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-12 17:49:18 +00:00
Patrick Beard b2f6820773 Added a new attribute, objc_root_class, which informs the compiler when a root class is intentionally declared.
The warning this inhibits, -Wobjc-root-class, is opt-in for now. However, all clang unit tests that would trigger
the warning have been updated to use -Wno-objc-root-class. <rdar://problem/7446698>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154187 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-06 18:12:22 +00:00
John McCall 100c6491c9 Forbid the block and lambda copy-capture of __autoreleasing variables
in ARC, under the usual reasoning limiting the use of __autoreleasing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153725 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-30 05:23:48 +00:00
Fariborz Jahanian b684a42154 Fix typo in my last patch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153602 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-28 21:13:53 +00:00
Fariborz Jahanian a78eca2042 objective-c: Improve diagnostics and
provide 'fixit' hint when dictionary index 
is not of proper type. // rdar://11062080


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153584 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-28 17:56:49 +00:00
Fariborz Jahanian 509fb3e2cd lldb support: under debugger support flag, when sending message
to forward class, and assigning to an 'id' type var, message
sends default to 'id'. // rdar"//10988847



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152420 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-09 18:47:16 +00:00
John McCall 5aba3eb1be Perform l2r conversions on delete operands before doing
type-analysis;  otherwise, we just completely do the
wrong thing for placeholders.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152375 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-09 04:08:29 +00:00
Ted Kremenek ebcb57a8d2 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152137 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-06 20:05:56 +00:00
Fariborz Jahanian f64bc202a2 objective-c++: Type of an objc string literal is NSString, not 'id'.
// rdar://10907410


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151296 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-23 22:51:36 +00:00
Douglas Gregor 8f70bda5ec In Objective-C++, allow the keyword 'class' to be used as a property
name for dot syntax, e.g., NSObject.class or foo.class. For other
C++-keywords-as-method-names, use message send syntax. Fixes
<rdar://problem/10794452>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150710 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-16 18:19:22 +00:00
John McCall d85bf9dd23 Only complain about __strong __strong id, not __strong SomeStrongTypedef
or __strong __typeof__(some.strong.thing).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150029 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-08 00:46:41 +00:00
Sean Callanan 1c59408841 Fixed some testsuite problems introduced by my
last commit.  Sorry for the outage.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149744 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-04 02:28:18 +00:00
Chad Rosier 7a0a31ce0c [frontend] Don't allow a mapping to a warning override an error/fatal mapping.
rdar://10736625

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149662 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-03 01:49:51 +00:00
Fariborz Jahanian 52b6236427 Look for declaration of CFBridgingRetain/CFBridgingRetain before
changing the diagnostic. Also use correct spelling for both.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149554 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 22:56:20 +00:00
Fariborz Jahanian 7eb82f0d09 objc-arc: In various diagnostics mention
CFBridgingRetain/CFBridgingRelease calls instead
of __bridge_retained/__bridge_transfer casts as preferred
way of moving cf objects to arc land. // rdar://10207950


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149449 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-31 23:42:37 +00:00
Fariborz Jahanian 466f45a06b objc: Issue a generic diagnostic assigning to
an objc object in any abi mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148847 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-24 19:40:13 +00:00
Fariborz Jahanian 7b383e4a38 objc: issue error if assigning objects in fragile-abi too.
// rdar://10731065


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148823 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-24 18:05:45 +00:00
Sebastian Redl b832f6dea8 Minor fixups for auto deduction of initializer lists.
Fix some review comments.
Add a test for deduction when std::initializer_list isn't available yet.
Fix redundant error messages. This fixes and outstanding FIXME too.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148735 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-23 22:09:39 +00:00
Fariborz Jahanian 556b1d0f3a objc: deprecate direct usage of 'isa' of objc objects
in favor of usage of api's intended for.
// rdar://8290002


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148404 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-18 19:08:56 +00:00
Eli Friedman 93c878ee09 Fix a couple issues where we didn't correctly delay diagnostics in PotentiallyPotentiallyEvaluated contexts. In preparation for making sizeof() PotentiallyPotentiallyEvaluated.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148367 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-18 01:05:54 +00:00
Douglas Gregor fdf187c4cb Reinstate test case accidentally reverted by r148028
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148118 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-13 16:56:26 +00:00
Douglas Gregor 1d7049a6ed In Objective-C++, actually compute the base type of a member access
expression for an Objective-C object or pointer type, so that we don't
attempt to treat the member name as a template. Fixes
<rdar://problem/10672501>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148028 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-12 16:11:24 +00:00
Eli Friedman ed0b31f847 Fix some edge cases with C++ casts and placeholder expressions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147984 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-12 00:44:34 +00:00
John McCall 52f220df13 Typo in test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147905 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-11 01:35:55 +00:00
John McCall 806054db66 Do placeholder conversions on array bounds in both declarators and
new-expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147900 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-11 00:14:46 +00:00
Fariborz Jahanian 20abee6b95 objc++: patch for IRgen for atomic properties of
c++ objects with non-trivial assignment/copy functions.
Also, one additional sema check. // rdar://6137845


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147817 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-10 00:37:01 +00:00
Richard Smith 5120188238 Unrevert r147271, reverted in r147361.
Also temporarily remove the assumption from IR gen that we can emit IR for every
constant we can fold, since it isn't currently true in C++11, to fix PR11676.

Original comment from r147271:

constexpr: perform zero-initialization prior to / instead of performing a
constructor call when appropriate. Thanks to Eli for spotting this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147384 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-30 21:15:51 +00:00
Rafael Espindola f8c2a33b6e Revert r147271. This fixes PR11676.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147362 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-30 03:11:50 +00:00
Richard Smith eba05b2e39 constexpr: perform zero-initialization prior to / instead of performing a
constructor call when appropriate. Thanks to Eli for spotting this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147271 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-25 20:00:17 +00:00
Douglas Gregor 7ab8ef99e6 "Accidentally" fixed a bug with overloading of functions with
Objective-C objects as parameters in r146659. Add a test for it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146660 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 17:20:18 +00:00
Douglas Gregor 5e3a8bea1c In debugger support mode, if we have a top-level message send
expression with an unknown result type, assume that the result type is
'id'. Fixes <rdar://problem/10400663>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146622 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 00:53:32 +00:00
Richard Trieu 2fe9b7fb07 Modify how the -verify flag works. Currently, the verification string and
diagnostic message are compared.  If either is a substring of the other, then
no error is given.  This gives rise to an unexpected case:

  // expect-error{{candidate function has different number of parameters}}

will match the following error messages from Clang:

  candidate function has different number of parameters (expected 1 but has 2)
  candidate function has different number of parameters

It will also match these other error messages:

  candidate function
  function has different number of parameters
  number of parameters

This patch will change so that the verification string must be a substring of
the diagnostic message before accepting.  Also, all the failing tests from this
change have been corrected.  Some stats from this cleanup:

87 - removed extra spaces around verification strings
70 - wording updates to diagnostics
40 - extra leading or trailing characters (typos, unmatched parens or quotes)
35 - diagnostic level was included (error:, warning:, or note:)
18 - flag name put in the warning (-Wprotocol)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146619 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 00:38:15 +00:00
John McCall 32509f1e60 Resolve placeholder expressions before trying to deduce
'auto'.  Introduce a convenience method to make this a bit
easier, and use it elsewhere.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144605 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-15 01:35:18 +00:00