Douglas Gregor [Wed, 4 Feb 2009 00:32:51 +0000 (00:32 +0000)]
Initial implementation of argument dependent lookup (a.k.a. ADL,
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.
Sebastian Redl [Tue, 3 Feb 2009 20:19:35 +0000 (20:19 +0000)]
Allow taking the address of data members, resulting in a member pointer.
Pointers to functions don't work yet, and pointers to overloaded functions even less. Also, far too much illegal code is accepted.
Daniel Dunbar [Tue, 3 Feb 2009 20:00:13 +0000 (20:00 +0000)]
x86_64 ABI: Initial implementation of ABI compliant parameter passing.
- Now only 27/500 failures on ABITest single argument tests; from
350/500. :)
- As with return types, a large percentage of these are likely to be
gcc bugs, not yet reviewed.
Also, fix bug in handling of Ignore ABI type in argument lists.
Douglas Gregor [Tue, 3 Feb 2009 19:26:08 +0000 (19:26 +0000)]
When looking for a tag name via unqualified name lookup, only look in
scopes where the name would be considered a redeclaration if we know
that we're declaring or defining that tag.
Sanjiv Gupta [Tue, 3 Feb 2009 18:07:49 +0000 (18:07 +0000)]
Targets that don't have stack use global address space for parameters.
Specify external linkage for such globals so that llvm optimizer do
not assume there values initialized as zero.
Chris Lattner [Tue, 3 Feb 2009 07:30:45 +0000 (07:30 +0000)]
switch SourceManager from using an std::map and std::list of
ContentCache objects to using a densemap and list, and allocating
the ContentCache objects from a bump pointer. This does not speed
up or slow down things substantially, but gives us control over
their alignment.
Daniel Dunbar [Tue, 3 Feb 2009 06:17:37 +0000 (06:17 +0000)]
Add ABIArgInfo::Direct kind, which passes arguments using whatever the
native IRgen type is. This is like Default, but without any extra
semantics (like automatic tweaking of structures or void).
Chris Lattner [Tue, 3 Feb 2009 01:28:04 +0000 (01:28 +0000)]
Content Cache only needs to be 4-byte aligned. Since it is stored in
an std::set, we can't make a strong guarantee about what its alignment
will be. Since I don't need the 3rd bit anyway yet, just change the
assertion.
Douglas Gregor [Tue, 3 Feb 2009 00:34:39 +0000 (00:34 +0000)]
Simplify the way in which we inject the names of tag definitions and
elaborated-type-specifier declarations into outer scopes while
retaining their proper lexical scope. This way is simpler and more
consistent with the way DeclContexts work, and also fixes
Douglas Gregor [Mon, 2 Feb 2009 23:39:07 +0000 (23:39 +0000)]
Add a macro-based enumeration of all of the Decl nodes (like we do
with Stmt/Expr nodes), and convert some of the more mundane
switch-on-all-decl-kinds uses over to use this new file.
Douglas Gregor [Mon, 2 Feb 2009 22:11:10 +0000 (22:11 +0000)]
Steve set me straight on this one. GCC was right, EDG was wrong: the
direct-initialization following a user-defined conversion can select
any constructor; it just can't employ any user-defined
conversions. So we ban those conversions and classify the constructor
call based on the relationship between the "from" and "to" types in
the conversion.
Douglas Gregor [Mon, 2 Feb 2009 21:35:47 +0000 (21:35 +0000)]
Add iterators to LookupResult, allowing one to iterate over the
non-ambiguous name lookup results without allocating any memory, e.g.,
for sets of overloaded functions.
Douglas Gregor [Mon, 2 Feb 2009 18:25:48 +0000 (18:25 +0000)]
Split specific_decl_iterator, which had a run-time field for
determining what decls are acceptable, into specific_decl_iterator
(in which all decls matching the SpecificDecl type requirements are
acceptable) and filtered_decl_iterator (which also does a run-time
check via a member pointer non-type template parameter). This saves
some space in the iterators.
Steve Naroff [Mon, 2 Feb 2009 18:24:29 +0000 (18:24 +0000)]
Change the ObjC type encoding for block pointer types to "@?" (for consistency with GCC).
This fixes <rdar://problem/6538564> clang ObjC rewriter: Wrong encoding emitted for methods with Block parameters.
Steve Naroff [Mon, 2 Feb 2009 17:19:26 +0000 (17:19 +0000)]
RewriteObjC::RewriteBlockDeclRefExpr(): Add parens to enforce precedence. This fixes <rdar://problem/6529468> clang ObjC rewriter: Need parenthesis around dereferences in rewritten Blocks.
Also changed RewriteObjC::SynthesizeBlockFunc() to declare a pointer to the block argument even when there are no user-supplied arguments to the block.
Daniel Dunbar [Sat, 31 Jan 2009 00:06:58 +0000 (00:06 +0000)]
x86_64 ABI: Retool classification to compute lo & hi classifications
in terms of where the type resides in the containing object. This is a
more clear embodiement of the spec & fixes a merging issue with
unions. Down to 3/1000 failures.
Douglas Gregor [Fri, 30 Jan 2009 23:27:23 +0000 (23:27 +0000)]
Improve our handling of the second step in a user-defined conversion
sequence. Previously, we weren't permitting the second step to call
copy constructors, which left user-defined conversion sequences
surprisingly broken.
Now, we perform overload resolution among all of the constructors, but
only accept the result if it makes the conversion a standard
conversion. Note that this behavior is different from both GCC and EDG
(which don't agree with each other, either); I've submitted a core
issue on the matter.
Daniel Dunbar [Fri, 30 Jan 2009 22:40:15 +0000 (22:40 +0000)]
x86_64 ABI: Fix more thinkos, straddling computation for complex was
computing in bytes not bits. We are now down to 22/1000 failures on
the return types tests, and 18 of those are gcc bugs I believe.
Douglas Gregor [Fri, 30 Jan 2009 22:26:29 +0000 (22:26 +0000)]
Upgrade the "excess elements in array initializer" warning to an
error, since both C99 and C++ consider it an error. For reference, GCC
makes this a warning while G++ makes it an error.
Douglas Gregor [Fri, 30 Jan 2009 22:09:00 +0000 (22:09 +0000)]
Implement and test aggregate initialization in C++. Major changes:
- Support initialization of reference members; complain if any
reference members are left uninitialized.
- Use C++ copy-initialization for initializing each element (falls
back to constraint checking in C)
- Make sure we diagnose when one tries to provide an initializer
list for a non-aggregate.
- Don't complain about empty initializers in C++ (they are permitted)
- Unrelated but necessary: don't bother trying to convert the
decl-specifier-seq to a type when we're dealing with a C++
constructor, destructor, or conversion operator; it results in
spurious warnings.
Ted Kremenek [Fri, 30 Jan 2009 21:35:30 +0000 (21:35 +0000)]
Fix horrible non-termination bug in LiveVariables. The issue was that
the liveness state of block-level expressions could oscillate because
of two issues:
- The initial value before a merge was not always set to "Top"
- The set of live block-level expressions is a union, not an intersection