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

287 Коммитов

Автор SHA1 Сообщение Дата
Eli Friedman a70779f6b9 Fix crash-on-invalid. <rdar://problem/12765391>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168851 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-29 03:13:49 +00:00
NAKAMURA Takumi 7a29070e01 clang/test: Suppress two tests on LLP64 target, Windows x64.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168303 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-19 10:00:59 +00:00
John McCall b8a8de316d Accept and pass arguments to __unknown_anytype in argument
positions of Objective-C methods.

It is possible to recover a lot of type information about
Objective-C methods from the reflective metadata for their
implementations.  This information is not rich when it
comes to struct types, however, and it is not possible to
produce a type in the debugger's round-tripped AST which
will really do anything useful during type-checking.
Therefore we allow __unknown_anytype in these positions,
which essentially disables type-checking for that argument.
We infer the parameter type to be the unqualified type of
the argument expression unless that expression is an
explicit cast, in which case it becomes the type-as-written
of that cast.

rdar://problem/12565338

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167896 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-14 00:49:39 +00:00
Eli Friedman 25f071eedf Don't try to save the assigned value in a Objective-C property assignment
if the type of the value is a non-trivial class type.  Fixes PR14318.

(There's a minor ObjC++ language change here: given that we can't save the
value, the type of the assignment expression is void in such cases.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167884 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-13 23:16:33 +00:00
Douglas Gregor 403f2c6804 Add a simple test involving decltype on Objective-C properties and ivars
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166562 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-24 14:13:21 +00:00
Andy Gibbs 8e8fb3be5b Prior to adding the new "expected-no-diagnostics" directive to VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166280 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-19 12:44:48 +00:00
Eli Friedman 9a14db3fef Fix Objective-C implicit property synthesis for C++ classes so we use valid
source locations in places where it is necessary for diagnostics.  By itself,
this causes assertions, so while I'm here, also fix property synthesis
for properties of C++ class type so we use so we properly set up a scope
and mark variable declarations.

<rdar://problem/12514189>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166219 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-18 20:14:08 +00:00
Jordan Rose 66360e2246 -Wformat: Don't check format strings in uninstantiated templates.
Also applies to -Wnonnull, -Wtype-safety, and -Wnon-pod-varargs.
All of these can be better checked at instantiation time.

This change does not actually affect regular CallExpr function calls,
since the checks there only happen after overload resolution.
However, it will affect Objective-C method calls.

<rdar://problem/12373934>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164984 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02 01:49:54 +00:00
Fariborz Jahanian 59ed9e40bb objective-C: remove use of 'ivar' in favor of
'instance variable' in text of all diagnostics
for objective-C: // rdar://12352442


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164559 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-24 22:00:36 +00:00
Fariborz Jahanian 6defd9f31e objective-C: peroform property attribute consistency
checking on property declared in class extension.
// rdar://12214070


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164053 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-17 20:57:19 +00:00
Fariborz Jahanian 15dfcbf9da Test removed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163918 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-14 17:51:34 +00:00
Fariborz Jahanian 6f5a2ec123 objective-C arc: remove -Warc-abi in its entirety.
// rdar://10554025


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163917 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-14 17:48:35 +00:00
Douglas Gregor 6db351abf2 In debugger mode, allow comparisons between pointers and integers
without a cast. Fixes <rdar://problem/11830912>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163873 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-14 04:35:37 +00:00
Fariborz Jahanian 4a29530878 objective-C++ test for my previous patch.
// rdar://12280826


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163741 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-12 21:27:26 +00:00
Fariborz Jahanian 9f55983d96 objective-C: Improving diagnostocs for missing call to
super's annotated methods. // rdar://6386358


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163517 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-10 16:51:09 +00:00
Fariborz Jahanian 841011373b objective-C: introduce __attribute((objc_requires_super)) on method
in classes. Use it to flag those method implementations which don't
contain call to 'super' if they have 'super' class and it has the method
with this attribute set. This is wip. // rdar://6386358


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163434 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-07 23:46:23 +00:00
Fariborz Jahanian 255793d35b objective-c++11: c++11 does not change pod-ness when
type is an unqualified objc pointer in arc. Treat it just
as being treated in c++98. This fixes a bogus vararg warning
with -std=c++11. //rdar://12229679


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163236 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-05 19:51:20 +00:00
Fariborz Jahanian 918546c584 objective-C ARC: under -Wexplicit-ownership-type diagnose those
method parameter types which are reference to an objective-C
pointer to object with no explicit ownership. // rdar://10907090



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162959 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-30 23:56:02 +00:00
Richard Smith 40b2e19cae When disambiguating an expression-statement from a declaraton-statement, if the
statement starts with an identifier for which name lookup will fail either way,
look at later tokens to disambiguate in order to improve error recovery.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162464 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-23 20:19:14 +00:00
Fariborz Jahanian 7f90b53181 objective-C++: issue diagnostic when ivar type is
an abstract c++ class. // rdar://12095239


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162052 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-16 22:38:41 +00:00
Fariborz Jahanian 9e5df31255 objective-C++: dalyed parsing of ctors with member
initializer list defined inside an objc class
implementation. wip


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161699 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-10 21:15:06 +00:00
Fariborz Jahanian dbd6945b7f objective-C++: delay parsing of ctor with try block
with member initializer list defined inside
an objc implementation block. wip.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161692 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-10 20:34:17 +00:00
Fariborz Jahanian 2eb362b50f objective-C++: delayed parsing of member function with
function-try-block occuring in objc's implementation
block. wip.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161675 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-10 18:10:56 +00:00
Fariborz Jahanian be1d4ecb68 objective-C++: Delayed parsing of most common
member functions defined inside an objc class
implementation. wip.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161667 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-10 15:54:40 +00:00
Douglas Gregor b38b491409 Objective-C pointer types don't have C-linkage, even though they are
non-POD. Fixes <rdar://problem/12031870>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161395 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-07 06:14:34 +00:00
Eli Friedman 95aac15936 Fix an assertion failure instantiating a constexpr function from within a -dealloc method. PR13401.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161135 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-01 21:02:59 +00:00
Richard Smith b9c6261d02 Improvements to vexing-parse warnings. Make the no-parameters case more
accurate by asking the parser whether there was an ambiguity rather than trying
to reverse-engineer it from the DeclSpec. Make the with-parameters case have
better diagnostics by using semantic information to drive the warning,
improving the diagnostics and adding a fixit.

Patch by Nikola Smiljanic. Some minor changes by me to suppress diagnostics for
declarations of the form 'T (*x)(...)', which seem to have a very high false
positive rate, and to reduce indentation in 'warnAboutAmbiguousFunction'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160998 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-30 21:30:52 +00:00
Fariborz Jahanian 533b34fa7b objective-c arc: When function calls with known CFCreate naming convention
are cast to retainable types, only suggest CFBridgingRelease/
CFBridgingRetain and not the __bridge casts.
// rdar://11923822


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160900 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-27 22:37:07 +00:00
Fariborz Jahanian 607f587a8c revert r160839 for now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160895 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-27 21:34:23 +00:00
Fariborz Jahanian 304efd5962 objc-arc: When objects with known CF semantics are assigned to
retainable types in arc, only suggest CFBridgingRelease/
CFBridgingRetain and not the confusing __bridge casts.
// rdar://11923822


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160839 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-26 23:17:04 +00:00
Douglas Gregor 3fe52ff7df When we have an Objective-C object with non-trivial lifetime in a
structor class under ARC, that struct/class does not have a trivial
move constructor or move assignment operator. Fixes the rest of
<rdar://problem/11738725>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160615 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-23 04:23:39 +00:00
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