RecordDecl:
- Remove method 'isForwardDecl'; this functionality is already provided by
'isDefinition()'
- Move method definitions to be co-located with other RecordDecl methods.
RecordDecl:
- Added method 'isForwardDeclaration', a predicate method that returns true
if a RecordDecl represents a forward declaration.
- Added method 'getDefinitionDecl', a query method that returns a pointer to
the RecordDecl that provides the actual definition of a struct/union.
CXXRecordDecl and RecordDecl:
- Change constructor and create methods to accept a CXXRecordDecl* (RecordDecl*)
instead of a ScopedDecl* for PrevDecl. This causes the type checking
to be more tight and doesn't break any code.
RecordDecl:
- Don't use the NextDeclarator field in ScopedDecl to represent the previous
declaration. This is a conflated use of the NextDeclarator field, which will
be removed anyway when DeclGroups are fully implemented.
- Instead, represent (a soon to be implemented) chain of RecordDecls using a
NextDecl field. The last RecordDecl in the chain is always the 'defining'
RecordDecl that owns the FieldDecls. The other RecordDecls in the chain
are forward declarations.
Steve Naroff [Tue, 2 Sep 2008 18:50:17 +0000 (18:50 +0000)]
- Implement __block.
- Replace FIXME in Preprocessor::HandleIdentifier() with a check that avoids diagnosing extension tokens that originate from macro definitions.
Eli Friedman [Tue, 2 Sep 2008 05:29:22 +0000 (05:29 +0000)]
Fix for PR2750; don't check for an 'e' in the trash after the token.
Note that this isn't really a complete fix; I think there are other
potential overrun situations. I don't really know what the best
systematic fix is, though.
Eli Friedman [Tue, 2 Sep 2008 05:19:23 +0000 (05:19 +0000)]
An extremely hacky version of transparent_union support; it isn't
anywhere near correct in terms of missing cases and missing
diagnostics, but it's good enough to handle the uses in the
Linux system headers, which are currently a constant pain for compiling
applications on Linux.
Eli Friedman [Tue, 2 Sep 2008 05:09:35 +0000 (05:09 +0000)]
Make sure to take the unqualified versions of the canonical types for
type-checking pointer subtraction; if the canonical types aren't used,
the qualifiers won't always get stripped off correctly.
Tidy up sema processing of attribute "nonull":
- warn about nonnull being applied to functions with no pointer arguments
- continue processing argument list in the attribute when we encounter a non-pointer parameter being marked as nonnull
- when no argument list is specified, only mark pointers as nonnull. This fixes PR 2732 and radar 6188814.
Daniel Dunbar [Sat, 30 Aug 2008 05:35:15 +0000 (05:35 +0000)]
Add Objective-C property setter support.
- Change Obj-C runtime message API, drop the ObjCMessageExpr arg in
favor of just result type and selector. Necessary so it can be
reused in situations where we don't want to cons up an
ObjCMessageExpr.
- Update aggregate binary assignment to know about special property
ref lvalues.
- Add CodeGenFunction::EmitCallArg overload which takes an already
emitted rvalue.
Add CodeGenFunction::StoreComplexIntoAddr.
Disabled logic in Sema for parsing Objective-C dot-syntax that
accesses methods. This code does not search in the correct order and
the AST node has no way of properly representing its results.
Updated StmtDumper to print a bit more information about
ObjCPropertyRefExprs.
Daniel Dunbar [Sat, 30 Aug 2008 03:02:31 +0000 (03:02 +0000)]
Refactor handling of calls:
- Added CodeGenFunction::EmitCall which just takes the callee, return
type, and a list of (Value*,QualType) pairs.
- Added CodeGenFunction::EmitCallArg which handles emitting code for
a call argument and turning it into an appropriate
(Value*,QualType) pair.
- Changed Objective-C runtime interface so that the actual emission
of arguments for message sends is (once again) done in the code to
emit a message send.
No intended functionality change, this is prep work for better ABI
support and for Objective-C property setter support.
Daniel Dunbar [Fri, 29 Aug 2008 21:03:27 +0000 (21:03 +0000)]
Improve ccc:
- Support environment variable CCC_LANGUAGES to control which
languages clang is invoked on. If unset clang is invoked for all
languages, otherwise CCC_LANGUAGES should be a comma separated list
of the languages (as accepted by -x) for which clang should be
invoked. Useful for only building C and Objective-C parts of a
project with clang, for example.
- Add environment variable CCC_FALLBACK. If set and non-empty then
ccc will try and compile using the regular compiler if compilation
with clang fails.
- A few other tweaks to add options, flush stdout, recognize .mm as
objective-c++, and infer languages for compile+link style
invocations.
Daniel Dunbar [Fri, 29 Aug 2008 08:11:39 +0000 (08:11 +0000)]
Add special "property reference" CodeGen::LValue type for emitting
Objective-C property references.
- This handles property references "more correctly" but setters still
don't work.
Ted Kremenek [Fri, 29 Aug 2008 00:47:32 +0000 (00:47 +0000)]
Added "getBindings" and "BindingAsString" to GRStateManager and StoreManager.
Migrated CFRefCount.cpp to use getBindings and BindingsAsString instead of
making assumptions about the Store (removed dependence on GRState::vb_iterator).
Ted Kremenek [Thu, 28 Aug 2008 23:31:31 +0000 (23:31 +0000)]
Make store "Regions" and "Bindings" more abstract instead of concrete variants.
Their precise semantics will be implemented by a specific StoreManager.
Use function pointer to create the StoreManager in GRStateManager. This matches how we create ConstraintsManager.
Steve Naroff [Thu, 28 Aug 2008 19:20:44 +0000 (19:20 +0000)]
Add parser/action support for block literal expressions.
Parser support for blocks is almost complete...just need to add support for the __block() storage class qualifier.
Daniel Dunbar [Wed, 27 Aug 2008 05:40:03 +0000 (05:40 +0000)]
Add synthesized property methods to protocols and categories in Sema.
- It is not clear that this is the right approach, but this is at
least consistent with how interfaces are handled.
- This means NeXT now emits the correct metadata for properties in
protocols.
- This currently introduces a spurious warning involving inherited
properties in protocols or categories; however, it also fixes some
situations where we were failing to emit a warning. I will scrub
this code tomorrow and fix this issue as well as number of other
missed warnings / error situations that appear to exist.
Daniel Dunbar [Tue, 26 Aug 2008 08:29:31 +0000 (08:29 +0000)]
Objective-C @synthesize support.
- Only supports simple assignment and atomic semantics are ignored.
- Not quite usable yet because the methods do not actually get added
to the class metadata.
- Added ObjCPropertyDecl::getSetterKind (one of Assign, Copy, Retain).
- Rearrange CodeGenFunction so synthesis can reuse function prolog /
epilog code.
Daniel Dunbar [Tue, 26 Aug 2008 02:32:45 +0000 (02:32 +0000)]
Synthesize property setter method as we do for getter.
- Also, fix Parser to construct proper SetterName selector (should be
lifted out of parser though).