Chris Lattner [Mon, 31 May 2010 18:18:22 +0000 (18:18 +0000)]
Minor tweaks on doug's objc recovery patch: the caller
of isSimpleObjCMessageExpression checks the language,
so change a dynamic check into an assert.
isSimpleObjCMessageExpression is expensive, so only do it
in the common case when it is likely to matter: when the [
of the postfix expr starts on a new line. This should avoid
doing lookahead for every array expression.
Douglas Gregor [Mon, 31 May 2010 14:40:22 +0000 (14:40 +0000)]
When we see the a '[' in a postfix expression in Objective-C, perform
a simple, quick check to determine whether the expression starting
with '[' can only be an Objective-C message send. If so, don't parse
it as an array subscript expression. This improves recovery for, e.g.,
[a method1]
[a method2]
so that we now produce
t.m:10:13: error: expected ';' after expression
[a method]
^
Ted Kremenek [Mon, 31 May 2010 01:22:04 +0000 (01:22 +0000)]
After conversations with Zhongxing Xu and Jordy Rose, refine the logic in
RegionStoreManager::RetrieveElement() that handles indexing into a larger scalar
object to only consult the direct binding of a super region if it is a scalar.
This isn't perfect yet, and a big FIXME is attached to the code. This causes
the test case for PR 7218 now to pass.
Sean Hunt [Sun, 30 May 2010 22:44:37 +0000 (22:44 +0000)]
Move .td files from AST to Basic.
Parse will need to see these files because it needs to know how to parse
attributes. The generated files are still placed in the appropriate directory so
as to preserve layering. No functional change.
Douglas Gregor [Sun, 30 May 2010 22:23:08 +0000 (22:23 +0000)]
Improve parser recovery when we try to parse a call expression but the
called function itself is invalid (e.g., because of a semantic error
referring to that declaration). Fixes <rdar://problem/8044142>.
Nick Lewycky [Sun, 30 May 2010 18:05:23 +0000 (18:05 +0000)]
Refactor the Is{Std,Clang,LLVM}Namespace methods and rename 'isClangAttr' to
'IsClangAttr' to match prevailing style in this file. Patch by Jon Mulder!
Sean Hunt [Sun, 30 May 2010 07:21:58 +0000 (07:21 +0000)]
Convert DeclNodes to use TableGen.
The macros required for DeclNodes use have changed to match the use of
StmtNodes. The FooFirst enumerator constants have been named firstFoo
to match usage elsewhere.
Anders Carlsson [Sun, 30 May 2010 06:52:33 +0000 (06:52 +0000)]
Turn on the new empty base subobject tracking code. It's a bit faster than the previous code. However, it still has quadratic performance, something which I intend to fix shortly in a subsequent patch.
Eli Friedman [Sun, 30 May 2010 06:03:20 +0000 (06:03 +0000)]
Fix for PR7040: Don't try to compute the LLVM type for a function where it
isn't possible to compute.
This patch is mostly refactoring; the key change is the addition of the code
starting with the comment, "Check whether the function has a computable LLVM
signature." The solution here is essentially the same as the way the
vtable code handles such functions.
Douglas Gregor [Sun, 30 May 2010 01:49:25 +0000 (01:49 +0000)]
Teach code completion to adjust its completion priorities based on the
type that we expect to see at a given point in the grammar, e.g., when
initializing a variable, returning a result, or calling a function. We
don't prune the candidate set at all, just adjust priorities to favor
things that should type-check, using an ultra-simplified type system.
Anders Carlsson [Sat, 29 May 2010 19:44:50 +0000 (19:44 +0000)]
Rework the way virtual primary bases are added when laying out classes. Instead of doing it as a separate step, we now use the BaseSubobjectInfo and use it when laying out the bases. This fixes a bug where we would either not add a primary virtual base at all, or add it at the wrong offset.
Anders Carlsson [Sat, 29 May 2010 17:35:14 +0000 (17:35 +0000)]
Move computing the base subobject info for a class into the RecordLayoutBuilder because we're going to need it to be able to correctly add offsets for primary virtual bases.
Daniel Dunbar [Fri, 28 May 2010 19:43:33 +0000 (19:43 +0000)]
Sema: Just ignore '#pragma options align=power' for now, this is no worse than
what we used to be doing, and makes sure that paired '#pragma options
align=reset' won't fail.
zero-cost exception API for NeXt runtime.
rethrow inside @catch block must use objc_exception_rethrow
API. Fixes radar 8037512. Test will be added to LLVM
test suite.
John McCall [Fri, 28 May 2010 08:20:36 +0000 (08:20 +0000)]
Add a new attribute on records, __attribute__((adl_invisible)), and define
the x86-64 __va_list_tag with this attribute. The attribute causes the
affected type to behave like a fundamental type when considered by ADL.
(x86-64 is the only target we currently provide with a struct-based
__builtin_va_list)
John McCall [Fri, 28 May 2010 08:11:17 +0000 (08:11 +0000)]
Don't just skip over the entire tag definition if the parser action didn't
give us a decl back. Makes -cc1 -parse-noop handle a substantially larger
amount of the C++ grammar.
Douglas Gregor [Fri, 28 May 2010 04:34:55 +0000 (04:34 +0000)]
When we complain about a member being inaccessible due to a constraint
along an access path, add another note pointing at the member we
actually found.
Nate Begeman [Fri, 28 May 2010 02:20:47 +0000 (02:20 +0000)]
Convert arm_neon.h into arm_neon.td, from which arm_neon.h will be built
Add Makefile support for building arm_neon.h from arm_neon.td
Need to figure out an appropriate cmake rule for this.
Douglas Gregor [Fri, 28 May 2010 00:49:12 +0000 (00:49 +0000)]
Do not produce types as valid code completions when we're in an
expression context in C/Objective-C, or when we're in an
@interface/@implementation/@protocol in Objective-C(++).
Douglas Gregor [Thu, 27 May 2010 23:06:34 +0000 (23:06 +0000)]
Implement a code-completion hook for the receiver of an Objective-C
message. This completion gives better results than just using the
"expression" completion, which is effectively what happened before.
Daniel Dunbar [Thu, 27 May 2010 18:42:17 +0000 (18:42 +0000)]
Parse/Sema: Add support for '#pragma options align=packed', which, it should be
noted, is not the same as __attribute__((packed)). That would be ridiculous!
Ted Kremenek [Thu, 27 May 2010 16:57:42 +0000 (16:57 +0000)]
Remove clang_isFromMainFile(). It doesn't work correctly with CXDiagnostics, and we shouldn't
have an API around that cannot be implemented correctly yet.
Objective-c++ IR gen.
Flag synthesized struct decl. as non-empty so
CXX side of ir gen does not skip its Null initialization.
Fixes radar 8027844 for objc++'s collection statement.
Douglas Gregor [Thu, 27 May 2010 15:25:59 +0000 (15:25 +0000)]
When we've parsed a nested-name-specifier in a member access
expression, "forget" about the object type; only the
nested-name-specifier matters for name lookup purposes. Fixes PR7239.
John McCall [Thu, 27 May 2010 06:19:26 +0000 (06:19 +0000)]
Implement __builtin_init_dwarf_reg_size_table and __builtin_dwarf_sp_column
for 32-bit MIPS processors. Hat-tip to rdivacky for providing gcc dumps
on this.
Daniel Dunbar [Thu, 27 May 2010 05:45:51 +0000 (05:45 +0000)]
Sema: Add initial support for '#pragma options align=mac68k'.
- Docs are fairly sketchy, if someone wants to pore through gcc to look for
holes I'd appreciate any failing test cases!