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!
John McCall [Thu, 27 May 2010 01:45:30 +0000 (01:45 +0000)]
When deciding whether a deferred declaration has already been emitted,
aliases count as definitions regardless of whether their target has been
emitted yet. Fixes PR 7142.
Ted Kremenek [Thu, 27 May 2010 00:29:00 +0000 (00:29 +0000)]
Discard qualifiers for ElementRegions so that a 'const' doesn't change the lookup semantics
in the symbol store. We may wish to push this down into the StoreManager itself.
Douglas Gregor [Wed, 26 May 2010 07:10:06 +0000 (07:10 +0000)]
When transforming a C++ "new" expression's constructor arguments, drop
any arguments that are default-argument expressions. The can show up
when we have a new expression whose constructor arguments are not
type-dependent and whose allocated type is not dependent and has a
constructor with default arguments. Fixes PR7202.
Douglas Gregor [Wed, 26 May 2010 05:35:51 +0000 (05:35 +0000)]
Tell the string literal parser when it's not permitted to emit
diagnostics. That would be while we're parsing string literals for the
sole purpose of producing a diagnostic about them. Fixes
<rdar://problem/8026030>.
Anders Carlsson [Wed, 26 May 2010 04:56:53 +0000 (04:56 +0000)]
Move the relevant ASTContext member functions that deal with ASTRecordLayoutBuilder into RecordLayoutBuilder.cpp. This matches the way we interact with other builder classes (CGRecordLayoutBuilder, VTableBuilder and VTTBuilder) and it also allows for making ASTRecordLayoutBuilder a private class without a header file.
Ted Kremenek [Tue, 25 May 2010 20:43:29 +0000 (20:43 +0000)]
Allocate the contents of TemplateArgumentList using ASTContext's allocator. This fixes
a massive memory leak when using a BumpPtrAllocator in ASTContext.
Added a FIXME, as the Destroy method for TemplateArgumentList isn't getting called.
This means we will instead leak when using the MallocAllocator.
Charles Davis [Tue, 25 May 2010 19:52:27 +0000 (19:52 +0000)]
IRgen: Add a stub class for generating ABI-specific C++ code.
This class only supports name mangling (which is apparently used during C/ObjC
codegen). For now only the Itanium C++ ABI is supported. Patches to add a
second C++ ABI are forthcoming.
Douglas Gregor [Tue, 25 May 2010 17:04:15 +0000 (17:04 +0000)]
Improve name mangling for blocks and support mangling of static local
variables within blocks. We loosely follow GCC's mangling, but since
these are always internal symbols the names don't really matter. I
intend to revisit block mangling later, because GCC's mangling is
rather verbose. <rdar://problem/8015719>.
Douglas Gregor [Tue, 25 May 2010 05:58:43 +0000 (05:58 +0000)]
Improve code completion in failure cases in two ways:
1) Suppress diagnostics as soon as we form the code-completion
token, so we don't get any error/warning spew from the early
end-of-file.
2) If we consume a code-completion token when we weren't expecting
one, go into a code-completion recovery path that produces the best
results it can based on the context that the parser is in.
Zhongxing Xu [Tue, 25 May 2010 04:59:19 +0000 (04:59 +0000)]
CastSizeChecker checks when casting a malloc'ed symbolic region to type T,
whether the size of the symbolic region is a multiple of the size of T.
Fixes PR6123 and PR7217.
John McCall [Tue, 25 May 2010 04:30:21 +0000 (04:30 +0000)]
If a function definition has any sort of weak linkage, its static local
variables should have that linkage. Otherwise, its static local
variables should have internal linkage. To avoid computing this excessively,
set a function's linkage before we emit code for it.
Previously we were assigning weak linkage to the static variables of
static inline functions in C++, with predictably terrible results. This
fixes that and also gives better linkage than 'weak' when merging is required.
Daniel Dunbar [Tue, 25 May 2010 00:33:13 +0000 (00:33 +0000)]
IRgen/C++: When mark vtables used, make sure to still append to the VTableUse array if we promote a vtable from being just used to having its definition required. This ensures that we properly inform the consumer about whether the vtable is required or not, previously we could fail to do so when the vtable was in the VTableUses array before the decl which marked it as required.
- I think this can be cleaned up, since this means we may notify the consumer about the vtable twice, but I didn't see an easy fix for this without more substantial refactoring.
- Doug, please review!
Chris Lattner [Mon, 24 May 2010 22:31:37 +0000 (22:31 +0000)]
improve the fixit for the missing : error when parsing ?:. When
there are already two spaces before the token where the : was expected,
put the : in between the spaces. This means we get it right in both
of these cases:
t.c:2:17: error: expected ':'
return a ? b c;
^
:
t.c:3:16: error: expected ':'
return a ? b c;
^
:
In the later case, the diagnostic says to insert ": ", in the former
case it says to insert ":" between the spaces. This fixes rdar://8007231
Chris Lattner [Mon, 24 May 2010 21:35:18 +0000 (21:35 +0000)]
push categories forward a bit more: document them, add some
major buckets to catch parser and sema issues, add inline asm
category, and make diag groups take precedence over the
sweeping categories just added.