| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
| |
during message sends) over to the new initialization code and away
from the C-only CheckSingleAssignmentConstraints. The enables the use
of C++ types in method parameters and message arguments, as well as
unifying more initialiation code overall.
llvm-svn: 102035
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Objective-C++ have a more complex grammar than in Objective-C
(surprise!), because
(1) The receiver of an instance message can be a qualified name such
as ::I or identity<I>::type.
(2) Expressions in C++ can start with a type.
The receiver grammar isn't actually ambiguous; it just takes a bit of
work to parse past the type before deciding whether we have a type or
expression. We do this in two places within the grammar: once for
message sends and once when we're determining whether a []'d clause in
an initializer list is a message send or a C99 designated initializer.
This implementation of Objective-C++ message sends contains one known
extension beyond GCC's implementation, which is to permit a
typename-specifier as the receiver type for a class message, e.g.,
[typename compute_receiver_type<T>::type method];
Note that the same effect can be achieved in GCC by way of a typedef,
e.g.,
typedef typename computed_receiver_type<T>::type Computed;
[Computed method];
so this is merely a convenience.
Note also that message sends still cannot involve dependent types or
values.
llvm-svn: 102031
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
sends. Major changes include:
- Expanded the interface from two actions (ActOnInstanceMessage,
ActOnClassMessage), where ActOnClassMessage also handled sends to
"super" by checking whether the identifier was "super", to three
actions (ActOnInstanceMessage, ActOnClassMessage,
ActOnSuperMessage). Code completion has the same changes.
- The parser now resolves the type to which we are sending a class
message, so ActOnClassMessage now accepts a TypeTy* (rather than
an IdentifierInfo *). This opens the door to more interesting
types (for Objective-C++ support).
- Split ActOnInstanceMessage and ActOnClassMessage into parser
action functions (with their original names) and semantic
functions (BuildInstanceMessage and BuildClassMessage,
respectively). At present, this split is onyl used by
ActOnSuperMessage, which decides which kind of super message it
has and forwards to the appropriate Build*Message. In the future,
Build*Message will be used by template instantiation.
- Use getObjCMessageKind() within the disambiguation of Objective-C
message sends vs. array designators.
Two notes about substandard bits in this patch:
- There is some redundancy in the code in ParseObjCMessageExpr and
ParseInitializerWithPotentialDesignator; this will be addressed
shortly by centralizing the mapping from identifiers to type names
for the message receiver.
- There is some #if 0'd code that won't likely ever be used---it
handles the use of 'super' in methods whose class does not have a
superclass---but could be used to model GCC's behavior more
closely. This code will die in my next check-in, but I want it in
Subversion.
llvm-svn: 102021
|
|
|
|
|
|
| |
weird; yes, it's what GCC does. Almost.
llvm-svn: 101803
|
|
|
|
|
|
|
| |
correctly diagnose instantiation of a function parameter with Objective-C
class type (since Objective-C classes can't be passed by value).
llvm-svn: 101031
|
|
|
|
|
|
|
| |
full-fledged @interface, be sure that the declaration has the right
lexical context. <rdar://problem/7827709>
llvm-svn: 100903
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
destination type for initialization, assignment, parameter-passing,
etc. The main issue fixed here is that we used rather confusing
wording for diagnostics such as
t.c:2:9: warning: initializing 'char const [2]' discards qualifiers,
expected 'char *' [-pedantic]
char *name = __func__;
^ ~~~~~~~~
We're not initializing a 'char const [2]', we're initializing a 'char
*' with an expression of type 'char const [2]'. Similar problems
existed for other diagnostics in this area, so I've normalized them all
with more precise descriptive text to say what we're
initializing/converting/assigning/etc. from and to. The warning for
the code above is now:
t.c:2:9: warning: initializing 'char *' from an expression of type
'char const [2]' discards qualifiers [-pedantic]
char *name = __func__;
^ ~~~~~~~~
Fixes <rdar://problem/7447179>.
llvm-svn: 100832
|
|
|
|
|
|
| |
considering valid objc pointer converions.
llvm-svn: 98557
|
|
|
|
|
|
|
|
|
|
| |
therefore not creating ElaboratedTypes, which are still pretty-printed
with the written tag).
Most of these testcase changes were done by script, so don't feel too
sorry for my fingers.
llvm-svn: 98149
|
|
|
|
|
|
|
| |
mode. This allows us to detect invalid VLAs in Objective-C++
mode. This should be the last of <rdar://problem/7660386>.
llvm-svn: 96679
|
|
|
|
|
|
|
|
|
|
|
|
| |
from an instance method. Previously, we were following the Objective-C
name lookup rules for ivars, which are of course completely different
from and incompatible with the Objective-C++ rules.
For the record, the Objective-C++ rules are the sane ones.
This is another part of <rdar://problem/7660386>.
llvm-svn: 96677
|
|
|
|
|
|
|
| |
name finds something other than a TypedefDecl or an
ObjCInterfaceDecl. This is a small part of <rdar://problem/7660386>.
llvm-svn: 96676
|
|
|
|
|
|
| |
(partial fix for radar 7591784).
llvm-svn: 95245
|
|
|
|
|
|
|
| |
pointer to an any object. Another variation of
radar 7562285.
llvm-svn: 94052
|
|
|
|
|
|
|
| |
So, casting a generic object pointer ('id' or 'Class') to the
block pointer is allowed. Fixes radar 7562285.
llvm-svn: 94045
|
|
|
|
|
|
| |
a similar pointer. Fixes radar 7552179.
llvm-svn: 93803
|
|
|
|
|
|
|
|
|
|
|
| |
InitializationSequence (when a FunctionDecl is present). This required
a few small fixes to initialization sequences:
- Make sure to use the adjusted parameter type for initialization of
function parameters.
- Implement transparent union calling semantics in C
llvm-svn: 91902
|
|
|
|
|
|
| |
as a g++ extension (fixes radar 7481987).
llvm-svn: 91827
|
|
|
|
|
|
|
|
| |
small bug fixes in SemaInit, switch over SemaDecl to use it more often, and
change a bunch of diagnostics which are different with the new initialization
code.
llvm-svn: 91767
|
|
|
|
|
|
| |
'void *' to mimic gcc's behavior. (fixes radar 7477351).
llvm-svn: 91570
|
|
|
|
|
|
| |
instead of crashing for now.
llvm-svn: 91546
|
|
|
|
|
|
|
|
|
| |
- This is designed to make it obvious that %clang_cc1 is a "test variable"
which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it
can be useful to redefine what gets run as 'clang -cc1' (for example, to set
a default target).
llvm-svn: 91446
|
|
|
|
| |
llvm-svn: 91298
|
|
|
|
|
|
| |
(fixes radar 7465023).
llvm-svn: 91171
|
|
|
|
|
|
| |
valid standard conversion to match g++'s behaviour.
llvm-svn: 91157
|
|
|
|
|
|
| |
constructor; call will abort at runtime" warning a -W flag (non-pod-varargs) and default it being an error by default. There is no good reason to allow users to get bitten by this sort of thing by default.
llvm-svn: 91094
|
|
|
|
|
|
|
| |
objective-c++ mode and also removed dead-code in this area.
(fixes radar 7456710).
llvm-svn: 91081
|
|
|
|
| |
llvm-svn: 91060
|
|
|
|
|
|
| |
in objective-c++ mode.
llvm-svn: 91059
|
|
|
|
|
|
| |
in objective-c++ mode without being too lenient.
llvm-svn: 90895
|
|
|
|
|
|
| |
in objective-c++ mode. Fixes radar 7443165
llvm-svn: 90874
|
|
|
|
|
|
| |
mode as they are pervasive.
llvm-svn: 90867
|
|
|
|
| |
llvm-svn: 85880
|
|
|
|
| |
llvm-svn: 77342
|
|
|
|
| |
llvm-svn: 76709
|
|
|
|
|
|
|
|
|
|
|
| |
- These kinds of "shotgun" tests are very slow, and do not belong in the
regression suite. If these kinds of tests are regarded to have value, they
should be added to the LLVM test-suite.
- I would actually like to remove all of these tests, but I left Sema/carbon.c
and SemaObjC/cocoa.m...
llvm-svn: 75399
|
|
|
|
|
|
|
|
|
|
|
|
| |
The idea is to segregate Objective-C "object" pointers from general C pointers (utilizing the recently added ObjCObjectPointerType). The fun starts in Sema::GetTypeForDeclarator(), where "SomeInterface *" is now represented by a single AST node (rather than a PointerType whose Pointee is an ObjCInterfaceType). Since a significant amount of code assumed ObjC object pointers where based on C pointers/structs, this patch is very tedious. It should also explain why it is hard to accomplish this in smaller, self-contained patches.
This patch does most of the "heavy lifting" related to moving from PointerType->ObjCObjectPointerType. It doesn't include all potential "cleanups". The good news is additional cleanups can be done later (some are noted in the code). This patch is so large that I didn't want to include any changes that are purely aesthetic.
By making the ObjC types truly built-in, they are much easier to work with (and require fewer "hacks"). For example, there is no need for ASTContext::isObjCIdStructType() or ASTContext::isObjCClassStructType()! We believe this change (and the follow-up cleanups) will pay dividends over time.
Given the amount of code change, I do expect some fallout from this change (though it does pass all of the clang tests). If you notice any problems, please let us know asap! Thanks.
llvm-svn: 75314
|
|
|
|
| |
llvm-svn: 72923
|
|
|
|
|
|
| |
type for C++.
llvm-svn: 72747
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- This is a WIP...
- This adds -march= handling to the driver, and fixes the defaulting
of -mcpu on Darwin (which was using the wrong test).
Instead of handling -m{sse, ...} in the driver, pass them to clang-cc as
-target-feature [+-]name
In clang-cc, communicate with the (clang) target to discover the legal
features of a target, and the features which are enabled based on
-mcpu. This is currently hardcoded just enough to not be a feature
regression, we need to get this information from the backend's
TableGen information somehow.
This is used to construct the full list of features which are being
used, which is in turn used to initialize the predefines.
llvm-svn: 71061
|
|
|
|
|
|
|
|
| |
class/protocol and implementation which could be
an imm. implementation or down in the inheritance
hierarchy.
llvm-svn: 70568
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- <rdar://problem/6741594> [pth] don't abuse -x to drive pth
generation
- Simpler, and fixes PR3915.
Cleanup test cases for PTH:
- Update to use -emit-pth
- Removed PTH test of carbon.c and cocoa.mm; these didn't actually
verify anything, and since PTH is token based the extra coverage
(over cocoa.m) isn't particularly helpful.
- Split PTH tests in cocoa.m to cocoa-pth.m, solely to increase
available parallelism when running tests.
Ted, could you update the PTH test cases (include-pth.c and
cocoa-pth.m) to have some sort of positive check that the PTH is
getting used? "# of PTH cache hits" or "tokens read from PTH cache"
statistics would work great. :)
llvm-svn: 68189
|
|
|
|
|
|
| |
Tests and drivers updated, still need to shuffle dirs.
llvm-svn: 67602
|
|
|
|
|
|
|
|
|
| |
interface for ivars before assuming that this is an unresolved
function name.
Fixes <rdar://problem/6590445>.
llvm-svn: 64653
|
|
|
|
| |
llvm-svn: 64175
|
|
|
|
|
|
| |
Objective-C++
llvm-svn: 64019
|
|
|
|
|
|
|
|
| |
Also, put Objective-C protocols into their own identifier
namespace. Otherwise, we find protocols when we don't want to in C++
(but not in C).
llvm-svn: 63877
|
|
|
|
|
|
|
|
|
|
|
|
| |
a.k.a. Koenig lookup) in C++. Most of the pieces are in place, but for
two:
- In an unqualified call g(x), even if the name does not refer to
anything in the current scope, we can still find functions named
"g" based on ADL. We don't yet have this ability.
- ADL will need updating for friend functions and templates.
llvm-svn: 63692
|
|
|
|
|
|
| |
to do the promotion before checking the type - fixes PR3340.
llvm-svn: 62323
|
|
|
|
|
|
| |
function/method/block.
llvm-svn: 62148
|