History log of /external/clang/lib/Sema/SemaLookup.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
ef8225444452a1486bd721f3285301fe84643b00 21-Jul-2014 Stephen Hines <srhines@google.com> Update Clang for rebase to r212749.

This also fixes a small issue with arm_neon.h not being generated always.

Includes a cherry-pick of:
r213450 - fixes mac-specific header issue
r213126 - removes a default -Bsymbolic on Android

Change-Id: I2a790a0f5d3b2aab11de596fc3a74e7cbc99081d
/external/clang/lib/Sema/SemaLookup.cpp
6bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89 29-May-2014 Stephen Hines <srhines@google.com> Update Clang for 3.5 rebase (r209713).

Change-Id: I8c9133b0f8f776dc915f270b60f94962e771bc83
/external/clang/lib/Sema/SemaLookup.cpp
651f13cea278ec967336033dd032faef0e9fc2ec 24-Apr-2014 Stephen Hines <srhines@google.com> Updated to Clang 3.5a.

Change-Id: I8127eb568f674c2e72635b639a3295381fe8af82
/external/clang/lib/Sema/SemaLookup.cpp
e28bdc329ebe990844795018fc8271fbd9d28364 01-Nov-2013 Benjamin Kramer <benny.kra@googlemail.com> Sema: Make helper function static.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193857 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
190d1af17608f05bc9792af21fd0b4e20e438588 30-Oct-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR17731: When determining whether a tag and a non-tag were declared in the same
scope, be careful about function-scope declarations (which are not declared in
their semantic context).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193671 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
b5c7768a74936d4e2c7a484570a638cb74702d8b 19-Oct-2013 Kaelyn Uhrain <rikka@google.com> Allow CorrectTypo to replace CXXScopeSpecifiers that refer to classes.

Now that CorrectTypo knows how to correctly search classes for typo
correction candidates, there is no good reason to only replace an
existing CXXScopeSpecifier if it refers to a namespace. While the actual
enablement was a matter of changing a single comparison, the fallout
from enabling the functionality required a lot more code changes
(including my two previous commits).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193020 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
6e4f6f865010649bc3969e57436b5501544a0c39 19-Oct-2013 Kaelyn Uhrain <rikka@google.com> Be smarter about deciding to add a leading '::' to a
NestedNameSpecifier that replaces an existing specifier.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193019 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
a831f17b233fb2f3c8422a45c58b7d0bc67db959 19-Oct-2013 Kaelyn Uhrain <rikka@google.com> Merge NamespaceSpecifierSet's AddNamespace and AddRecord as they are
essentially the same.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193018 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
49ef481bc1b0b0f757ba6ac1ad6d0425390e7654 16-Oct-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR17592: Ensure we diagnose shadowing a template parameter with a local extern
declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192846 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
0ccadb2835d169e834ab9bb44bdb299fbf7de660 15-Oct-2013 Serge Pavlov <sepavloff@gmail.com> Fixed code style of my change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192708 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
81e34b1c137ffaa9b9c7d488744bdaa0cee8e845 14-Oct-2013 Serge Pavlov <sepavloff@gmail.com> Do not use typo correction that is unaccessible.
This patch fixes PR17019. When doing typo correction, Sema::CorrectTypo uses
correction already seen for the same typo. This causes problems if that
correction is from another scope and cannot be accessed in the current.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192594 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
f0d5861d2db5e3075bd722ff7874e88c4bfedaae 08-Oct-2013 Ted Kremenek <kremenek@apple.com> Convert anachronistic use of 'void *' to 'DeclContext *' in Scope that was a holdover from the long-dead Action interface.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192203 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
b328e29173d15baf3f44ccdc9c310ee741caaaf7 07-Oct-2013 Richard Smith <richard-llvm@metafoo.co.uk> Add support for WG21 N3599 (literal operator template for strings) as a GNU
extension. The GCC folks have decided to support this even though the standard
committee have not yet approved this feature.

Patch by Hristo Venev!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192128 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
6dfc04b4cc5db5f631243d0d8543d1dbc9cd58ed 05-Oct-2013 Aaron Ballman <aaron@aaronballman.com> Silencing an MSVC warning; SmallSet::count returns a bool instead of a size_t.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192043 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
fb61e462277751f519c14515b05799e62e2dcdfa 02-Oct-2013 Kaelyn Uhrain <rikka@google.com> Speed up CorrectTypo by avoiding lookups on unreasonable candidates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191846 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
91d3f338e446e654392184e68f940c77b5c98f39 01-Oct-2013 Eli Friedman <eli.friedman@gmail.com> Fix typo correction usage of SemaAccess.cpp.

When we check access for lookup results, make sure we propagate the
result's access to the access control APIs; this can be different from
the natural access of the declaration depending on the path used by the lookup.

PR17394.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191726 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
2b17b472d2f503ee61c460ca23f226c2aebcdd62 27-Sep-2013 Kaelyn Uhrain <rikka@google.com> Cache the location of failed typo corrections so that typo correction
isn't repeatedly attempted for the same identifier at the same location.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191543 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
3d9559b91c00757b296354cc6ca93e899266c7d2 26-Sep-2013 Kaelyn Uhrain <rikka@google.com> Teach typo correction to look inside of classes like it does namespaces.

Unlike with namespaces, searching inside of classes requires also
checking the access to correction candidates (i.e. don't suggest a
correction to a private class member for a correction occurring outside
that class and its methods or friends).

Included is a small (one line) fix for a bug, that was uncovered while
cleaning up the unit tests, where the decls from a TypoCorrection candidate
were preserved in new TypoCorrection candidates that are derived (copied)
from the old TypoCorrection--notably when creating a new candidate by
changing the NestedNameSpecifier associated with the base idenitifer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191449 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
a41c97a5d1912ffd184381d269fd8e5a25ee5e59 20-Sep-2013 Richard Smith <richard-llvm@metafoo.co.uk> Switch the semantic DeclContext for a block-scope declaration of a function or
variable from being the function to being the enclosing namespace scope (in
C++) or the TU (in C). This allows us to fix a selection of related issues
where we would build incorrect redeclaration chains for such declarations, and
fail to notice type mismatches.

Such declarations are put into a new IdentifierNamespace, IDNS_LocalExtern,
which is only found when searching scopes, and not found when searching
DeclContexts. Such a declaration is only made visible in its DeclContext if
there are no non-LocalExtern declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191064 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
9bd3cdc3b78653275a36f15df81e1def3b2db8db 13-Sep-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR13657 (and duplicates):

When a comma occurs in a default argument or default initializer within a
class, disambiguate whether it is part of the initializer or whether it ends
the initializer.

The way this works (which I will be proposing for standardization) is to treat
the comma as ending the default argument or default initializer if the
following token sequence matches the syntactic constraints of a
parameter-declaration-clause or init-declarator-list (respectively).

This is both consistent with the disambiguation rules elsewhere (where entities
are treated as declarations if they can be), and should have no regressions
over our old behavior. I think it might also disambiguate all cases correctly,
but I don't have a proof of that.

There is an annoyance here: because we're performing a tentative parse in a
situation where we may not have seen declarations of all relevant entities (if
the comma is part of the initializer, lookup may find entites declared later in
the class), we need to turn off typo-correction and diagnostics during the
tentative parse, and in the rare case that we decide the comma is part of the
initializer, we need to revert all token annotations we performed while
disambiguating.

Any diagnostics that occur outside of the immediate context of the tentative
parse (for instance, if we trigger the implicit instantiation of a class
template) are *not* suppressed, mirroring the usual rules for a SFINAE context.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190639 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
b60fae50d38a0291e1c5731b2fb22849d26ca342 09-Sep-2013 Richard Smith <richard-llvm@metafoo.co.uk> C++ modules: if a class is defined in multiple modules (for instance, because
it is an implicit instantiation of a class template specialization), pick the
first-loaded definition to be the canonical definition, and merge all other
definitions into it.

This is still rather incomplete -- we need to extend every form of declaration
that can appear within a CXXRecordDecl to be redeclarable if it came from an
AST file (this includes fields, enumerators, ...).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190315 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
023b22045e6407052a5c456e19573b5cd4866dc1 29-Aug-2013 Serge Pavlov <sepavloff@gmail.com> Removed useless default branch of switch statement.
The problem was caught by sanitizer build.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189575 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
8ed2f3ad9505962d8dec4630caeaad607edbbb7d 29-Aug-2013 Serge Pavlov <sepavloff@gmail.com> Change return type of Sema::DiagnoseAmbiguousLookup from bool to void.
The function always returned true value, which was never used.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189571 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
ef072033876e295ec5d3402f8730a3ae358ad815 28-Aug-2013 Reid Kleckner <reid@kleckner.net> Delete CC_Default and use the target default CC everywhere

Summary:
Makes functions with implicit calling convention compatible with
function types with a matching explicit calling convention. This fixes
things like calls to qsort(), which has an explicit __cdecl attribute on
the comparator in Windows headers.

Clang will now infer the calling convention from the declarator. There
are two cases when the CC must be adjusted during redeclaration:
1. When defining a non-inline static method.
2. When redeclaring a function with an implicit or mismatched
convention.

Fixes PR13457, and allows clang to compile CommandLine.cpp for the
Microsoft C++ ABI.

Excellent test cases provided by Alexander Zinenko!

Reviewers: rsmith

Differential Revision: http://llvm-reviews.chandlerc.com/D1231

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189412 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
344472ebeded2fca2ed5013b9e87f81d09bfa908 23-Aug-2013 Robert Wilhelm <robert.wilhelm@gmx.net> Use pop_back_val() instead of both back() and pop_back().
No functionality change intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189112 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
d67679d7439bd17b06574781b908630f4640c662 20-Aug-2013 Richard Smith <richard-llvm@metafoo.co.uk> During typo correction, check for an exact match in an unimported module. If we
find one, then report the error as a missing import instead of as a typo.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188821 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
ab4e0c0ad9cbb744e159f6ff6022a9b7f889147c 18-Aug-2013 Chandler Carruth <chandlerc@gmail.com> Fix a use-after-free found in libclang when doing code completion. The
loop processing the candidates can cause new declerations to be added to
the context, invalidating lookup_result. To avoid that, make a copy of
the list of declarations to iterate over.

I don't have a way to check in a test case for this as it involves
a giant pile of source code and a generated PCH file used to accelerate
code completion, all of this running under ASan.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188623 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
2d67097ad41f4c2fe82ebce3f587e06498f1bd71 17-Aug-2013 Richard Smith <richard-llvm@metafoo.co.uk> Refactor all diagnosing of TypoCorrections through a common function, in
preparation for teaching this function how to diagnose a correction that
includes importing a module.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188602 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
dd9459f8869f66409f7ea429053b453e33f6499c 13-Aug-2013 Richard Smith <richard-llvm@metafoo.co.uk> Fix implementation of C11 6.2.7/4 and C++11 [dcl.array]p3:

When a local extern declaration redeclares some other entity, the type of that
entity is merged with the prior type if the prior declaration is visible (in C)
or is declared in the same scope (in C++).

- Make LookupRedeclarationWithLinkage actually work in C++, use it in the right
set of cases, and make it track whether it found a shadowed declaration.
- Track whether we found a declaration in the same scope (for C++) including
across serialization and template instantiation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188307 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
70571f43ab9ae399cd005eaee02f4ca1ecbc3a81 12-Aug-2013 Kaelyn Uhrain <rikka@google.com> Add hooks for typo correction to ExternalSemaSource, courtesy of Luke Zarko.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188196 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
834c058cb6b57465e60a4590afdab86c4ea6921d 09-Aug-2013 Robert Wilhelm <robert.wilhelm@gmx.net> Omit llvm:: before ArrayRef, as we have using llvm::ArrayRef in include/clang/Basic/LLVM.h.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188089 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
4e9686b1f9947f1747b4f4316deb2087a7f56282 09-Aug-2013 Richard Smith <richard-llvm@metafoo.co.uk> Implement [class.friend]p11's special name lookup rules for friend declarations
of local classes. We were previously handling this by performing qualified
lookup within a function declaration(!!); replace it with the proper scope
lookup.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188050 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
b775100fea6d8955149897dae1adca50ca471d17 26-Jul-2013 Richard Smith <richard-llvm@metafoo.co.uk> When we perform dependent name lookup during template instantiation, it's not
sufficient to only consider names visible at the point of instantiation,
because that may not include names that were visible when the template was
defined. More generally, if the instantiation backtrace goes through a module
M, then every declaration visible within M should be available to the
instantiation. Any of those declarations might be part of the interface that M
intended to export to a template that it instantiates.

The fix here has two parts:

1) If we find a non-visible declaration during name lookup during template
instantiation, check whether the declaration was visible from the defining
module of all entities on the active template instantiation stack. The defining
module is not the owning module in all cases: we look at the module in which a
template was defined, not the module in which it was first instantiated.

2) Perform pending instantiations at the end of a module, not at the end of the
translation unit. This is general goodness, since it significantly cuts down
the amount of redundant work that is performed in every TU importing a module,
and also implicitly adds the module containing the point of instantiation to
the set of modules checked for declarations in a lookup within a template
instantiation.

There's a known issue here with template instantiations performed while
building a module, if additional imports are added later on. I'll fix that
in a subsequent commit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187167 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
22050f25e34ba0cd21ee2dc3d765951c48e27cde 18-Jul-2013 Richard Smith <richard-llvm@metafoo.co.uk> Reinstate r186040, with additional fixes and more test coverage (reverted in
r186331).

Original commit log:
If we friend a declaration twice, that should not make it visible to
name lookup in the surrounding context. Slightly rework how we handle
friend declarations to inherit the visibility of the prior
declaration, rather than setting a friend declaration to be visible
whenever there was a prior declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186546 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
52c2575fc77a51f36129be89d1a0a90e31617a57 15-Jul-2013 Chandler Carruth <chandlerc@gmail.com> Re-revert r86040, which was un-reverted in r186199.

This breaks the build of basic patterns with repeated friend
declarations. See the added test case in SemaCXX/friend.cpp or the test
case reported to the original commit log.

Original commit log:
If we friend a declaration twice, that should not make it visible to
name lookup in the surrounding context. Slightly rework how we handle
friend declarations to inherit the visibility of the prior
declaration, rather than setting a friend declaration to be visible
whenever there was a prior declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186331 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
3aa29df37b140f9c6786b6863a0cac195071b598 15-Jul-2013 Craig Topper <craig.topper@gmail.com> Add 'static' and 'const' qualifiers to some arrays of strings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186314 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
b960232518a1cd79c5f64ab5ef54c88e34660191 15-Jul-2013 Craig Topper <craig.topper@gmail.com> Use llvm::array_lengthof to replace sizeof(array)/sizeof(array[0]).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186300 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
f9e65a274d4e5c5a45503efc81da43be76503983 12-Jul-2013 Richard Smith <richard-llvm@metafoo.co.uk> Unrevert r186040, reverted in r186185, with fix for PR16597.

Original commit log:
If we friend a declaration twice, that should not make it visible to
name lookup in the surrounding context. Slightly rework how we handle
friend declarations to inherit the visibility of the prior
declaration, rather than setting a friend declaration to be visible
whenever there was a prior declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186199 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
1afa611e36e0ab23dd3cde4bbe5aa74ceb7d77c5 12-Jul-2013 Chandler Carruth <chandlerc@gmail.com> Revert r186040 to fix PR16597 while Richard investigates what the best
fix is.

Original commit log:
If we friend a declaration twice, that should not make it visible to
name lookup in the surrounding context. Slightly rework how we handle
friend declarations to inherit the visibility of the prior
declaration, rather than setting a friend declaration to be visible
whenever there was a prior declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186185 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
433a13d0cdb1c48b828fe5bfb6a835c58e1e758b 11-Jul-2013 Richard Smith <richard-llvm@metafoo.co.uk> If we friend a declaration twice, that should not make it visible to name
lookup in the surrounding context. Slightly rework how we handle friend
declarations to inherit the visibility of the prior declaration, rather
than setting a friend declaration to be visible whenever there was a prior
declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186040 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
761695fec3e4fe5aaae1544d489389bcf6cd9be4 09-Jul-2013 Kaelyn Uhrain <rikka@google.com> Make a couple of useful typo correction callbacks more widely available.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185880 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
09d19efaa147762f84aed55efa7930bb3616a4e5 04-Jul-2013 Craig Topper <craig.topper@gmail.com> Use SmallVectorImpl instead of SmallVector for iterators and references to avoid specifying the vector size unnecessarily.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185610 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
b2567ddad9a1142d7224e5363029d640e8f4f59d 03-Jul-2013 Kaelyn Uhrain <rikka@google.com> Allow typo correction to try removing nested name specifiers.

The removal is tried by retrying the failed lookup of a correction
candidate with either the MemberContext or SS (CXXScopeSpecifier) or
both set to NULL if they weren't already. If the candidate identifier
is then looked up successfully, make a note in the candidate that the
SourceRange should include any existing nested name specifier even if
the candidate isn't adding a different one (i.e. the candidate has a
NULL NestedNameSpecifier).

Also tweak the diagnostic messages to differentiate between a suggestion
that just replaces the identifer but leaves the existing nested name
specifier intact and one that replaces the entire qualified identifier,
in cases where the suggested replacement is unqualified.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185487 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
caa16dd469b6f7bfb5bce05afd8772f5d4196322 03-Jul-2013 Kaelyn Uhrain <rikka@google.com> Look for corrections in enclosing namespaces that require a global NestedNameSpecifier.

CorrectTypo will now see and consider those corrections that are effectively
shadowed by other declarations in a closer context when resolved via an
unqualified lookup. This involves adding any parent namespaces to the set of
namespaces as fully-qualified name specifiers, and also adding potential
corrections that passed name lookup but were rejected by the given
CorrectionCandidateCallback into the set of failed corrections that should be
tried with the set of namespace specifiers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185486 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
8d90b4ab994c48c4b6d53122282dc93ac722bfc7 24-Jun-2013 Kaelyn Uhrain <rikka@google.com> Add the global namespace (the "::" namespace specifier) to the list of
namespaces to try for potential typo corrections.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184762 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
cac18add73d095eaab600aefe27ea7174aec4922 20-Jun-2013 Nico Weber <nicolasweber@gmx.de> Lazily provide a __float128 dummy type in -std=gnu++11 mode.

This is needed to parse libstdc++ 4.7's type_traits, see PR13530.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184476 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
17828ca5857d5d9cadfffd339f888de58182c8f1 14-May-2013 David Blaikie <dblaikie@gmail.com> Provide operator<< for stream output of DeclarationNames

ASTDumper was already trying to do this & instead got an implicit bool
conversion by surprise (thus printing out 0 or 1 instead of the name of
the declaration). To avoid that issue & simplify call sites, simply make
it the normal/expected operator<<(raw_ostream&, ...) overload & simplify
all the existing call sites. (bonus: this function doesn't need to be a
member or friend, it's just using public API in DeclarationName)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181832 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
5543169296beeb183b9c9392debc774fcf493eeb 05-May-2013 Dmitri Gribenko <gribozavr@gmail.com> Replace ArrayRef<T>() with None, now that we have an implicit ArrayRef constructor from None

Patch by Robert Wilhelm.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181139 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
d99990df0b4aca43a0315b2928ff1b8baf704052 04-May-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> Revert r177218.

Per discussion in cfe-commits, asserting may be a better way than introducing a special test flag.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181073 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
dc7a4f5d7a7e3b60d4dc4a80338d7a2728540998 30-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> Don't treat a non-deduced 'auto' type as being type-dependent. Instead, there
are now two distinct canonical 'AutoType's: one is the undeduced 'auto'
placeholder type, and the other is a deduced-but-dependent type. All
deduced-to-a-non-dependent-type cases are still non-canonical.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180789 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
7e0c22714e4750a2f730035957f9bb678ae681c0 10-Apr-2013 Douglas Gregor <dgregor@apple.com> <rdar://problem/13605348> Don't consider invalid user-defined literal operators during overload resolution.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179150 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
34366208e3ec6876ef501e85978466d2ddecb3d2 09-Apr-2013 Douglas Gregor <dgregor@apple.com> Skip transparent contexts when looking for using directives in name lookup.

Fixes the bootstrap regression I introduced in r179067.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179079 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
44b2ea97957b553e76e757c1926c3ad1fadbe1b2 09-Apr-2013 Douglas Gregor <dgregor@apple.com> <rdar://problem/13540899> Collect using directives from all of the semantic contexts not represented by scopes.

This fixes a regression I introduced in r178136, where we would not
consider the using directives from the semantic declaration contexts
that aren't represented by the lexical scopes (Scope) when performing
unqualified name lookup. This lead to horribly funny diagnostics like
"no identifier named 'foo'; did you mean 'foo'?".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179067 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
0db9d2066318f3721a45954e23b26ac8ef0723bb 08-Apr-2013 Nick Lewycky <nicholas@mxc.ca> Fix typo in assertion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179061 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
96df3562752e13237df051469271f8999ad60fe6 04-Apr-2013 Douglas Gregor <dgregor@apple.com> <rdar://problem/13560075> Teach name lookup for builtin names to find hidden declarations.

Normal name lookup ignores any hidden declarations. When name lookup
for builtin declarations fails, we just synthesize a new
declaration at the point of use. With modules, this could lead to
multiple declarations of the same builtin, if one came from a (hidden)
submodule that was later made visible. Teach name lookup to always
find builtin names, so we don't create these redundant declarations in
the first place.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178711 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
20a7cf4d782e32b2752e651a11ed3712d2debd65 03-Apr-2013 Kaelyn Uhrain <rikka@google.com> Give the default CorrectionCandidateCallback::ValidateCandidate some
smarts so that it doesn't approve of keywords and/or type names when it
knows (based on its flags) that those kinds of corrections are not
wanted.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178668 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
6bed88e9d25fd7e16edf3d95447ba414d9d73d72 27-Mar-2013 Douglas Gregor <dgregor@apple.com> <rdar://problem/13317030> Consider using directives when performing unqualified name lookup into declarations contexts represented by the qualified-id but not in the actual scope hierarchy.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178136 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
6aa240c03dd68ab413106d6af7a18af1c9b4e872 16-Mar-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove -Wspellcheck and replace it with a diagnostic option.

Thanks to Richard S. for pointing out that the warning would show up
with -Weverything.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177218 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
57f8da506a0db208a936e26a8cb77267f638b26b 14-Mar-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't try to typo-correct 'super' in an objc method.

This created 2 issues:

1) Performance issue, since typo-correction with PCH/modules is rather expensive.
2) Correctness issue, since if it managed to "correct" 'super' then bogus compiler errors would
be emitted, like this:

3.m:8:3: error: unknown type name 'super'; did you mean 'super1'?
super.x = 0;
^~~~~
super1
t3.m:5:13: note: 'super1' declared here
typedef int super1;
^
t3.m:8:8: error: expected identifier or '('
super.x = 0;
^

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177126 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
bea522ff43a3f11c7a2bc7949119dbb9fce19e39 08-Mar-2013 Jordan Rose <jordan_rose@apple.com> ArrayRef-ize ASTContext::getFunctionType and Sema::BuildFunctionType.

No (intended) functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176726 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
745af1c348191bf31cfcd3ae61443a0321ec2d75 22-Feb-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> In LookupResult::resolveKind(), when handling multiple found declarations, ignore invalid declarations.

This reduces the "ambiguous reference" errors (which are rather strange in C/ObjC) and fixes an assertion hit
with an invalid code test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175869 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
01a41140cd8ec9475ed0c33384310fbdd3b6de11 26-Jan-2013 Nick Lewycky <nicholas@mxc.ca> Preserve Sema::UndefinedInternals across PCH boundaries. Fixes
-Wundefined-internal warnings with PCH.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173538 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
d329724745b49f894b768d47275b7c2713106e89 17-Jan-2013 Douglas Gregor <dgregor@apple.com> Rework the traversal of Objective-C categories and extensions to
consider (sub)module visibility.

The bulk of this change replaces myriad hand-rolled loops over the
linked list of Objective-C categories/extensions attached to an
interface declaration with loops using one of the four new category
iterator kinds:

visible_categories_iterator: Iterates over all visible categories
and extensions, hiding any that have their "hidden" bit set. This is
by far the most commonly used iterator.

known_categories_iterator: Iterates over all categories and
extensions, ignoring the "hidden" bit. This tends to be used for
redeclaration-like traversals.

visible_extensions_iterator: Iterates over all visible extensions,
hiding any that have their "hidden" bit set.

known_extensions_iterator: Iterates over all extensions, whether
they are visible to normal name lookup or not.

The effect of this change is that any uses of the visible_ iterators
will respect module-import visibility. See the new tests for examples.

Note that the old accessors for categories and extensions are gone;
there are *Raw() forms for some of them, for those (few) areas of the
compiler that have to manipulate the linked list of categories
directly. This is generally discouraged.

Part two of <rdar://problem/10634711>.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172665 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
a121eb3af061a9402aa88630a0eb535d92962e2c 15-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR14950: Fix out-of-bounds function parameter access in literal operator lookup.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172514 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
cfa88f893915ceb8ae4ce2f17c46c24a4d67502f 12-Jan-2013 Dmitri Gribenko <gribozavr@gmail.com> Remove useless 'llvm::' qualifier from names like StringRef and others that are
brought into 'clang' namespace by clang/Basic/LLVM.h


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172323 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
80ad52f327b532bded5c5b0ee38779d841c6cd35 02-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> s/CPlusPlus0x/CPlusPlus11/g


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171367 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
3bc93e3124ad5e7191c4a12dc981c8ee53578193 19-Dec-2012 David Blaikie <dblaikie@gmail.com> Change DeclContextLookup(Const)Result to (Mutable)ArrayRef<NamedDecl*>, as per review discussion in r170365

This does limit these typedefs to being sequences, but no current usage
requires them to be contiguous (we could expand this to a more general
iterator pair range concept at some point).

Also, it'd be nice if SmallVector were constructible directly from an ArrayRef
but this is a bit tricky since ArrayRef depends on SmallVectorBaseImpl for the
inverse conversion. (& generalizing over all range-like things, while nice,
would require some nontrivial SFINAE I haven't thought about yet)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170482 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
55fc873017f10f6f566b182b70f6fc22aefa3464 04-Dec-2012 Chandler Carruth <chandlerc@gmail.com> Sort all of Clang's files under 'lib', and fix up the broken headers
uncovered.

This required manually correcting all of the incorrect main-module
headers I could find, and running the new llvm/utils/sort_includes.py
script over the files.

I also manually added quite a few missing headers that were uncovered by
shuffling the order or moving headers up to be main-module-headers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169237 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
e5411b7c9af683dab6b035825b71c284bfec364d 01-Dec-2012 Richard Smith <richard-llvm@metafoo.co.uk> Consistently use 'needsImplicit<special member>' to determine whether we need
an implicit special member, rather than sometimes using '!hasDeclared<special
member>'. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169075 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
9d29543284e75648ac89c6e9586fc7cf786cf66f 28-Nov-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't return a pointer to an UnresolvedSetImpl in the CXXRecordDecl interface,
expose only the iterators instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168770 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
d0adeb65c743e01ca3436db1d47a97cdcc78df89 27-Nov-2012 Richard Smith <richard-llvm@metafoo.co.uk> Simplify checking for whether we should implicitly declare special members and
add some assertions. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168725 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
728948fba8ce2249db0a6fd228d883f38434289a 19-Nov-2012 Kaelyn Uhrain <rikka@google.com> When adding a NamedDecl to a correction, add the underlying Decl (via
getUnderlyingDecl()) so that derivatives of
CorrectionCandidateCallback::ValidateCandidate(...) don't have to worry
about being thrown by UsingDecls and such.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168317 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
b1502bcd67fb593a95cbf73ec3814f4015666da0 18-Oct-2012 Richard Smith <richard-llvm@metafoo.co.uk> DR1442: In a range-based for statement, namespace 'std' is not an associated
namespace.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166194 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
6952c018318a8ce57e336d7ed2a4819a98182fa2 12-Oct-2012 David Blaikie <dblaikie@gmail.com> Fix typo correction of one qualified name to another.

When suggesting "foo::bar" as a correction for "fob::bar" we mistakenly
replaced only "bar" with "foo::bar" producing "fob::foo::bar" which was broken.

This corrects that replacement in as many places as I could find & provides
test cases for all those cases I could find a test case for. There are a couple
that don't seem to be reachable (one looks entirely dead, the other just
doesn't seem to ever get called with a namespace to namespace change).

Review by Richard Smith ( http://llvm-reviews.chandlerc.com/D57 ).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165817 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
d7a6b1640e565487d163023a6a2e83f55476ae96 26-Sep-2012 Eli Friedman <eli.friedman@gmail.com> Fix the AST representation for non-type template arguments to encode
enough information so we can mangle them correctly in cases involving
dependent parameter types. (This specifically impacts cases involving
null pointers and cases involving parameters of reference type.)
Fix the mangler to use this information instead of trying to scavenge
it out of the parameter declaration.

<rdar://problem/12296776>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164656 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
93e4599196654907dad3bd476013ad05d36ce604 19-Sep-2012 Craig Topper <craig.topper@gmail.com> Remove Context argument from TemplateDeductionInfo constructor. It was no longer needed after the unused Context member was removed in r164104.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164196 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
e91a4978d31f2c94c815b09e2abf2e53879b0412 25-Aug-2012 Richard Smith <richard-llvm@metafoo.co.uk> Remove RequireCompleteType call which was made redundant by r162586.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162630 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
42f48fbdf31a7e8c516ba5eed486ff53966459fc 24-Aug-2012 John McCall <rjmccall@apple.com> Instantiate class template specializations during ADL.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162586 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
b399696572b5c610e8b88574084f7982c715dc94 27-Jul-2012 Benjamin Kramer <benny.kra@googlemail.com> Fix PR13394: Erasing from a vector changes the end of the vector, so make sure we always have the right end.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160855 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
bed28ac1d1463adca3ecf24fca5c30646fa9dbb2 23-Jul-2012 Sylvestre Ledru <sylvestre@debian.org> Fix a typo (the the => the)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160622 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
6a06e5ff3b680dcf7234d200309fd2400c478095 18-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR13381: consider cv-qualifiers on a class member's type when determining which
constructor will be used for moving that object, in the computation of its
exception specification.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160417 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
f70a88612a4bc2de2872a518267b9b4891ab6431 30-Jun-2012 Jordan Rose <jordan_rose@apple.com> Add support for the C11 _Alignof keyword.

This behaves like the existing GNU __alignof and C++11 alignof keywords;
most of the patch is simply adding the third token spelling to various places.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159494 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
8da16874f48d2c5c8f1275c7fd77caf8a8af3f81 22-Jun-2012 James Dennett <jdennett@google.com> Documentation cleanup: making \param and \returns docs match the code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158985 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
16ae9de07730832945204877d752db7f1c070962 22-Jun-2012 James Dennett <jdennett@google.com> Documentation cleanup: making \param docs match the code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158982 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
7ba759237afee52f4d53ed1fe07dbfdcfdbabdc6 19-Jun-2012 James Dennett <jdennett@google.com> Documentation cleanup: escape "::", and other minor reformatting

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158741 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
0f4b5be4a3b3e1c18e611e5a5c262ef028e8320a 08-Jun-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR13051: Only suggest the 'template' and 'operator' keywords when performing
typo-correction after a scope specifier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158231 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
8d3607bf22a6a70acce3722a758f02d4ea84fc3a 06-Jun-2012 Kaelyn Uhrain <rikka@google.com> Allow CorrectTypo to add/modify nested name qualifiers to typos that
are otherwise too short to try to correct.

The TODOs added to two of the tests are for existing deficiencies in the
typo correction code that could be exposed by using longer identifiers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158109 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
581deb3da481053c4993c7600f97acf7768caac5 06-Jun-2012 David Blaikie <dblaikie@gmail.com> Revert Decl's iterators back to pointer value_type rather than reference value_type

In addition, I've made the pointer and reference typedef 'void' rather than T*
just so they can't get misused. I would've omitted them entirely but
std::distance likes them to be there even if it doesn't use them.

This rolls back r155808 and r155869.

Review by Doug Gregor incorporating feedback from Chandler Carruth.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158104 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
48d798ce32447607144db70a484cdb99c1180663 02-Jun-2012 Benjamin Kramer <benny.kra@googlemail.com> Fix typos found by http://github.com/lyda/misspell-check

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157886 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
784ae8e5c6b557e2395991c6008293660f5afe66 01-Jun-2012 Kaelyn Uhrain <rikka@google.com> Don't allow multiple correction candidates that have the same identifier
but different nested name specifiers to quietly clobber each other so
only one remains if they do not refer to the same NamedDecl. Fixes
PR12951.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157823 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
396e0a8cfa3fbdd5fde83a19cc87b7af62cc1ddd 01-Jun-2012 Kaelyn Uhrain <rikka@google.com> In TypoCorrectionConsumer, BestResults to CorrectionResults to lessen
the confusion among all of the uses of Best* in relation to the set of
possible typo correction results. Also add a method to return the set of
typo corrections that have the single best edit distance--it returns the
second half of the first pair in TypoEditDistanceMap (with
getBestEditDistance already returning the first half).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157781 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
8165605dfb926561bcbc64310bec4106a70dd1e1 01-May-2012 David Blaikie <dblaikie@gmail.com> Implement simplify_type traits for redecl_iterator.

Based on Chandler Carruth's feedback on r155869.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155929 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
bd4fa45e7cf6a2f0adcb0ab66d5b3d338ec56c3c 01-May-2012 David Blaikie <dblaikie@gmail.com> Remove ref/value inconsistency in redecl_iterator.

Similar to r155808 - this mistake has been made in a few iterators.

Based on Chandler Carruth's feedback to r155808 I added an implicit conversion
to Decl* to ease adoption/usage. Useful for the pointer comparison, but not the
dyn_cast (due to template argument deduction causing the conversion not to be
used) - there for future convenience, though. This idiom (op T* for iterators)
seems to be fairly idiomatic within the LLVM codebase & I'll likely add it as I
fix up the other iterators here.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155869 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
704c8f76bbe2de68375f7f146e75bd74de6dd518 20-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix bug where a class's (deleted) copy constructor would be implicitly given a
non-const reference parameter type if the class had any subobjects with deleted
copy constructors. This causes a rejects-valid if the class's copy constructor
is explicitly defaulted (as happens for some implementations of std::pair etc).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155218 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
34f9dc46d3207f3d6e649082e61f7ec0226632da 14-Apr-2012 Benjamin Kramer <benny.kra@googlemail.com> Directly store TypoResultsMaps in the TypoEditDistanceMap, getting rid of manual deletion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154736 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
9cdd1e3450a07c1bafc32c96f1db88084497f282 14-Apr-2012 Benjamin Kramer <benny.kra@googlemail.com> Delete the TypoResultsMap when erasing the pointer to it.

This manual deleting is error-prone, but we can't just put an OwningPtr in a
std::map :(

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154707 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
173a37a57b79bd8f94b85c2273039e760b159922 03-Apr-2012 Nick Lewycky <nicholas@mxc.ca> Remove more redundant lookups. Add a new "all_lookups_iterator" which provides
a view over the contents of a DeclContext without exposing the implementation
details of the StoredDeclsMap. Use this in LookupVisibleDecls to find the
visible declarations. Fixes PR12339!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153970 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
893a6eaf52930701950b7fc01a2478bb86899b77 03-Apr-2012 Nick Lewycky <nicholas@mxc.ca> Don't treat synthesized ivars as being in the base class for the purpose of
looking up visible decls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153967 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
6d858d96ea294baecdf3e7ad3f3c5395c00dec8e 03-Apr-2012 Kaelyn Uhrain <rikka@google.com> Replace the workaround from r153445 with a proper fix.

Infinite recursion was happening when DiagnoseInvalidRedeclaration
called ActOnFunctionDeclarator to check if a typo correction works when
the correction was just to the nested-name-specifier because the wrong
DeclContext was being passed in. Unlike a number of functions
surrounding typo correction, the DeclContext passed in for a function is
the context of the function name after applying any nested name
specifiers, not the lexical DeclContext where the
function+nested-name-specifier appears.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153962 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
6c4c36c4ed1007143f5b8655eb68b313a7e12e76 30-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR10217: Provide diagnostics explaining why an implicitly-deleted special
member function is deleted.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153773 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
0179868cce096101236261ff64eca30224b1f233 26-Mar-2012 Douglas Gregor <dgregor@apple.com> When diagnosing an invalid out-of-line redeclaration, don't permit
typo correction to introduce a nested-name-specifier; we aren't
prepared to handle it here. Fixes PR12297 / <rdar://problem/11075219>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153445 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
1af83c444e5a2f6f50a6e1c15e6ebc618ae18a5f 23-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Support for definitions of member enumerations of class templates outside the
class template's definition, and for explicit specializations of such enum
members.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153304 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
65daef179790a02eab1b5a989f53984375a06483 13-Mar-2012 Nick Lewycky <nicholas@mxc.ca> It never makes sense to do a lookup into a LinkageSpecDecl, so assert that we
don't, and clean up the places that do it.

The change to ASTWriter is surprising, but the deleted code is a no-op as of
r152608.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152609 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
1b7f9cbed1b96b58a6e5f7808ebc9345a76a0936 13-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix PR10447: lazily building name lookup tables for DeclContexts was broken.
The deferred lookup table building step couldn't accurately tell which Decls
should be included in the lookup table, and consequently built different tables
in some cases.

Fix this by removing lazy building of DeclContext name lookup tables. In
practice, the laziness was frequently not worthwhile in C++, because we
performed lookup into most DeclContexts. In C, it had a bit more value,
since there is no qualified lookup.

In the place of lazy lookup table building, we simply don't build lookup tables
for function DeclContexts at all. Such name lookup tables are not useful, since
they don't capture the scoping information required to correctly perform name
lookup in a function scope.

The resulting performance delta is within the noise on my testing, but appears
to be a very slight win for C++ and a very slight loss for C. The C performance
can probably be recovered (if it is a measurable problem) by avoiding building
the lookup table for the translation unit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152608 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
4e4d08403ca5cfd4d558fa2936215d3a4e5a528d 11-Mar-2012 David Blaikie <dblaikie@gmail.com> Unify naming of LangOptions variable/get function across the Clang stack (Lex to AST).

The member variable is always "LangOpts" and the member function is always "getLangOpts".

Reviewed by Chris Lattner

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152536 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
216f78b7333dbc89f58fa69066396ae3237da6da 09-Mar-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Improve our semantic error recovery.

When an error made a record member invalid, the record would stay as "isBeingDefined" and
not "completeDefinition". Even easily recoverable errors ended up propagating records in
such "beingDefined" state, for example:

struct A {
~A() const; // expected-error {{'const' qualifier is not allowed on a destructor}}
};
struct B : A {}; // A & B would stay as "not complete definition" and "being defined".

This weird state was impending lookups in the records and hitting assertion in the ASTWriter.

Part of rdar://11007039

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152432 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
36f5cfe4df32af6c5fe01228102512996f566f9d 09-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Support for raw and template forms of numeric user-defined literals,
and lots of tidying up.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152392 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
c2bd73bba5316aa294187995e8c37b4f0f224179 08-Mar-2012 Daniel Dunbar <daniel@zuster.org> Sema: Don't emit a gajillion calls to sanity() -- an empty function -- in NDEBUG
builds. Sheesh.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152279 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
13a140caba448a66ffcc5ff0d32a87d6e4f4ad3f 25-Feb-2012 Ahmed Charles <ace2001ac@gmail.com> ArrayRef'ize various functions in the AST/Parser/Sema.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151447 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
f5cd5cc9a7ec114ef1a4c08491a37d2327697c4a 25-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix a regression from r151117: ADL requires that we attempt to complete any
associated classes, since it can find friend functions declared within them,
but overload resolution does not otherwise require argument types to be
complete.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151434 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
8c43dccdae3083e73061cb1b2f517b77d35876a0 23-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Replace some DenseSets with SmallPtrSets. Apart from the "small" optimization, the current implementation is also a denser.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151257 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
7d5088aa52d6e32b309ad0af32ea520ddbc5f953 18-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Initial refactoring of 'ShouldDeleteSpecialMember', in preparation for providing
decent diagnostics. Finish the work of combining all the 'ShouldDelete'
functions into one. In unifying the code, fix a minor bug where an anonymous
union with a deleted default constructor as a member of a union wasn't being
considered as making the outer union's default constructor deleted.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150862 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
3ad02aa90105a9fcfd3d4328e800aa1362a90234 15-Feb-2012 Kaelyn Uhrain <rikka@google.com> Silence a valgrind warning, and remove an unused var.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150629 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
2d4d7fd0ca37b61406dfe58acbefa8cf20ee050a 15-Feb-2012 Kaelyn Uhrain <rikka@google.com> Improve typo correction involving nested name specifiers.

Snooping in other namespaces when the identifier being corrected is
already qualified (i.e. a valid CXXScopeSpec is passed to CorrectTypo)
and ranking synthesized namespace qualifiers relative to the existing
qualifier is now performed. Support for disambiguating the string
representation of synthesized namespace qualifers has also been added
(the change to test/Parser/cxx-using-directive.cpp is an example of an
ambiguous relative qualifier).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150622 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
63aae82bb12bbbe9028e597fb77e40fa8d348c12 14-Feb-2012 Kaelyn Uhrain <rikka@google.com> Use several weighted factors to determine typo candidate viablity.

Replace the simple Levenshtein edit distance for typo correction
candidates--and the hacky way adding namespace qualifiers would affect
the edit distance--with a synthetic "edit distance" comprised of several
factors and their relative weights. This also allows the typo correction
callback object to convey more information about the viability of a
correction candidate than simply viable or not viable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150495 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
bb3d9976fd0e037ec9864baeaf23dc138bcb6df0 07-Feb-2012 Kaelyn Uhrain <rikka@google.com> Remove the unused TypoCorrectionConsumer::MaxEditDistance.

MaxEditDistance was effectively unused as it being initialized to the max
unsigned valued but never updated. Removing it avoids conversion
headaches once the "edit distance" of a typo correction is a weighted
composite of several values instead of roughly the number of characters
changed; comparing the weighted composite value to the number of
characters in a typo would require some form of normalization to make it
comparable to the old, character-based notion of edit distance.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149953 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
6f42b62b6194f53bcbc349f5d17388e1936535d7 05-Feb-2012 Dylan Noblesmith <nobled@dreamwidth.org> Basic: import OwningPtr<> into clang namespace

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149798 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
a1f2114d9e81923c750f6b439302ac03552c37db 01-Feb-2012 Douglas Gregor <dgregor@apple.com> Introduce the lambda scope before determining explicit captures, which
cleans up and improves a few things:
- We get rid of the ugly dance of computing all of the captures in
data structures that clone those of CapturingScopeInfo, centralizing
the logic for accessing/updating these data structures
- We re-use the existing capture logic for 'this', which actually
works now.

Cleaned up some diagnostic wording in minor ways as well.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149516 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
16e46dd0c284296cea819dfbf67942ecef02894d 01-Feb-2012 Kaelyn Uhrain <rikka@google.com> Make the callback object to Sema::CorrectTypo mandatory.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149451 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
438ee1fc5e5baaa204faede83cb999e45bb6b57e 23-Jan-2012 Kaelyn Uhrain <rikka@google.com> In CorrectTypo, use the cached correction as a starting point instead.

Previously, for unqualified lookups, a positive cache hit is used as the
only non-keyword correction and a negative cache hit immediately returns
an empty TypoCorrection. With the new callback objects, this behavior
causes false negatives by not accounting for the fact that callback
objects alter the set of potential/allowed corrections. The new behavior
is to seed the set of corrections with the cached correction (for
positive hits) to estabilishing a baseline edit distance. Negative cache
hits are only stored or used when either no callback object is provided
or when it returns true for a call to ValidateCandidate with an empty
TypoCorrection (i.e. when ValidateCandidate does not seem to be doing
any checking of the TypoCorrection, such as when an instance of the base
callback class is used solely to specify the set of keywords to be accepted).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148720 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
3026348bd4c13a0f83b59839f64065e0fcbea253 20-Jan-2012 David Blaikie <dblaikie@gmail.com> More dead code removal (using -Wunreachable-code)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148577 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
bcdd7d92883d771106e54357245733358eac9672 19-Jan-2012 Kaelyn Uhrain <rikka@google.com> Remove the now-unused CorrectTypoContext enum.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148441 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
ef96ee0be5f100789f451641542a69cd719144d2 14-Jan-2012 Douglas Gregor <dgregor@apple.com> De-virtualize getPreviousDecl() and getMostRecentDecl() when we know
we have a redeclarable type, and only use the new virtual versions
(getPreviousDeclImpl() and getMostRecentDeclImpl()) when we don't have
that type information. This keeps us from penalizing users with strict
type information (and is the moral equivalent of a "final" method).

Plus, settle on the names getPreviousDecl() and getMostRecentDecl()
throughout.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148187 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
117c45666c99f1797c708767d7c0ccaa7902ec42 14-Jan-2012 Douglas Gregor <dgregor@apple.com> Make sure to consider non-DeclContext scopes properly when finding
multiple name lookup results in C/Objective-C. Fixes a regression a
caused in r147533, found by Enea Zaffanella!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148154 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
dc98cd0cdd2eee8290b624ef69c6d91ce626d85e 11-Jan-2012 Kaelyn Uhrain <rikka@google.com> Fix the caching in CorrectTypo so that other non-keyword identifiers
are still added if the cached correction fails validation.

Also fix a copy-and-paste error in a comment from my previous commit.
Finally, add an example of the benefit the typo correction callback adds
to TryNamespaceTypoCorrection--which happens to also tickle the above
caching problem, as the only way a non-namespace Decl would be added to
the possible corrections is if it was cached as the correction for a
previous instance of the same typo where the typo was corrected to a
non-namespace via a different code path.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147968 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
7d5e6948e6a4e04ee67b607f931d90d3063579f2 11-Jan-2012 Kaelyn Uhrain <rikka@google.com> Add initial callback object support to Sema::CorrectTypo.

Also includes two examples of the callback: a wrapper/replacement for
the CorrectTypoContext enum, and a conversion of the two calls to
CorrectTypo in SemaDeclCXX.cpp (one of which provides verifiable
improvement to the typo correction, as demonstrated in the added test).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147962 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
f5c9f9fd6f5e2850b9b0f19283430245b696c6e5 07-Jan-2012 Douglas Gregor <dgregor@apple.com> Switch NamespaceDecl from its own hand-rolled redeclaration chain over
to Redeclarable<NamespaceDecl>, so that we benefit from the improveed
redeclaration deserialization and merging logic provided by
Redeclarable<T>. Otherwise, no functionality change.

As a drive-by fix, collapse the "inline" bit into the low bit of the
original namespace/anonymous namespace, saving 8 bytes per
NamespaceDecl on x86_64.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147729 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
0782ef2bd0ef5025ac6512cfa445a80a464c3b7f 06-Jan-2012 Douglas Gregor <dgregor@apple.com> During name lookup, use redecl_iterator to walk over the redeclaration
chain to determine whether any declaration of the given entity is
visible, eliminating the redundant (and less efficient)
getPreviousDeclaration() implementation.

This tweak uncovered an omission in the handling of
RedeclarableTemplateDecl, where we weren't making sure to search for
additional redeclarations of a template in other module files. Things
would be cleaner if RedeclarableTemplateDecl actually used Redeclarable.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147687 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
447af24a003aa8d0dc7317a56f06f5b8361f8808 05-Jan-2012 Douglas Gregor <dgregor@apple.com> When we're performing name lookup for a tag, we still allow ourselves
to see hidden declarations because every tag lookup is effectively a
redeclaration lookup. For example, image that

struct foo;

is declared in a submodule that is known but hasn't been imported. If
someone later writes

struct foo *foo_p;

then "struct foo" is either a reference or a redeclaration. To keep
the redeclaration chains sound, we treat it like a redeclaration for
name-lookup purposes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147588 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
da795b45f47df61a1b5a491e8d4ea078cf2a217b 04-Jan-2012 Douglas Gregor <dgregor@apple.com> Implement declaration merging for typedefs loaded from disjoint
modules, so long as the typedefs refer to the same underlying
type. This ensures that the typedefs end up in the same redeclaration
chain.

To test this, fix name lookup for C/Objective-C to properly deal with
multiple declarations with the same name in the same scope.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147533 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
3f26e0fdcdb58742b7d7871cb42b6a28e7847262 04-Jan-2012 Douglas Gregor <dgregor@apple.com> Minor tweak to name lookup for C/Objective-C: after the first name, still consider whether this is a redeclaration lookup when determining whether to look for the visible declaration

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147499 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
7a537404f039d4b7d063bbdc3c8c924be977dff2 04-Jan-2012 Douglas Gregor <dgregor@apple.com> Test "merging" of typedef types across distinct modules. At present,
the AST reader doesn't actually perform a merge, because name lookup
knows how to merge identical typedefs together.

As part of this, teach C/Objective-C name lookup to return multiple
results in all cases, rather than first digging through the attributes
to see if the value is overloadable. This way, we'll catch ambiguous
lookups in C/Objective-C.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147498 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
bd9482d859a74bf2c45ef8b8aedec61c0e1c8374 01-Jan-2012 Douglas Gregor <dgregor@apple.com> Eliminate ObjCForwardProtocolDecl, which is redundant now that
ObjCProtocolDecl modules forward declarations properly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147415 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
27c6da284f90e32cda0ec8f52a2b6ba5a2613252 01-Jan-2012 Douglas Gregor <dgregor@apple.com> Wire up redeclaration chains for Objective-C protocols, so that both
forward declarations and definitions of an Objective-C protocol are
represented within a single chain of ObjCProtocolDecls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147412 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
1d784b277cdfd4eba03680715d2a082b3f28d295 01-Jan-2012 Douglas Gregor <dgregor@apple.com> Introduce the core infrastructure needed to model redeclaration chains
for Objective-C protocols, including:
- Using the first declaration as the canonical declaration
- Using the definition as the primary DeclContext
- Making sure that all declarations have a pointer to the definition
data, and that we know which declaration is the definition
- Serialization support for redeclaration chains and for adding
definitions to already-serialized declarations.

However, note that we're not taking advantage of much of this code
yet, because we're still re-using ObjCProtocolDecls.





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147410 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
375bb1413c041055262c8a416f20d10474a5eda9 27-Dec-2011 Douglas Gregor <dgregor@apple.com> Eliminate ObjCClassDecl, which is redundant now that ObjCInterfaceDecl
covers both declarations (@class) and definitions (@interface) of an
Objective-C class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147299 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
2ccd89cff3f1c18b48f649240302446a7dae28b9 20-Dec-2011 Douglas Gregor <dgregor@apple.com> When performing name lookup for a redeclaration, ignore module
visibility restrictions. This ensures that all declarations of the
same entity end up in the same redeclaration chain, even if some of
those declarations aren't visible. While this may seem unfortunate to
some---why can't two C modules have different functions named
'f'?---it's an acknowedgment that a module does not introduce a new
"namespace" of names.

As part of this, stop merging the 'module-private' bit from previous
declarations to later declarations, because we want each declaration
in a module to stand on its own because this can effect, for example,
submodule visibility.

Note that this notion of names that are invisible to normal name
lookup but are available for redeclaration lookups is how we should
implement friend declarations and extern declarations within local
function scopes. I'm not tackling that problem now.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146980 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
a1be278c4f3a234ff61f04018d26c6beecde1654 18-Dec-2011 Douglas Gregor <dgregor@apple.com> Completely re-implement (de-)serialization of declaration
chains. The previous implementation relied heavily on the declaration
chain being stored as a (circular) linked list on disk, as it is in
memory. However, when deserializing from multiple modules, the
different chains could get mixed up, leading to broken declaration chains.

The new solution keeps track of the first and last declarations in the
chain for each module file. When we load a declaration, we search all
of the module files for redeclarations of that declaration, then
splice together all of the lists into a coherent whole (along with any
redeclarations that were actually parsed).

As a drive-by fix, (de-)serialize the redeclaration chains of
TypedefNameDecls, which had somehow gotten missed previously. Add a
test of this serialization.

This new scheme creates a redeclaration table that is fairly large in
the PCH file (on the order of 400k for Cocoa.h's 12MB PCH file). The
table is mmap'd in and searched via a binary search, but it's still
quite large. A future tweak will eliminate entries for declarations
that have no redeclarations anywhere, and should
drastically reduce the size of this table.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146841 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
d63348c3382965a9e1719c8eaa63e2891dd5e234 15-Dec-2011 Douglas Gregor <dgregor@apple.com> When name lookup finds a module-private Objective-C class declaration,
check whether any previous declarations of the class were visible.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146680 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
553689148f546783e127749438bf6d7806e6bb1d 14-Dec-2011 Douglas Gregor <dgregor@apple.com> When name lookup comes across a declaration that is in a module that
is not visible, look for any previous declarations of that entity that
might be visible.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146563 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
4d604d6f1d413864e7dad8e368ba9a69a3f478c7 03-Dec-2011 Francois Pichet <pichet2000@gmail.com> In Microsoft mode, don't perform typo correction in a template member function dependent context because it interferes with the "lookup into dependent bases of class templates" feature.

Basically typo correction will try to offer a correction instead of looking into type dependent base classes.

I found this problem while parsing Microsoft ATL code with clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145772 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
10ce9321551efffa6ed2cff39084400e1dfcf307 02-Dec-2011 Douglas Gregor <dgregor@apple.com> Make sure that name lookup in C checks whether a name is hidden.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145700 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
3eafbb85d1d9d108f089fd2451ddb6932eaafef2 25-Oct-2011 Douglas Gregor <dgregor@apple.com> When we perform a lookup for a dependent name that is a member of an
unknown specialization, treat this the same way as if the name were
not found in the current instantiation. No actual functionality
change, since apparently nothing depends on this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142862 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
5e1cdac63c3d9c9b32fa41fa0b2d242a58a20d49 07-Oct-2011 John McCall <rjmccall@apple.com> Rename TagDecl::isDefinition -> isCompleteDefinition
for better self-documenting code, since the semantics
are subtly different from getDefinition().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141355 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
b001de7458d17c17e6d8b8034c7cfcefd3b70c00 07-Oct-2011 Eli Friedman <eli.friedman@gmail.com> Support for C1x _Atomic specifier (see testcase). This is primarily being committed at the moment to help support C++0x <atomic>, but it should be a solid base for implementing the full specification of C1x _Atomic.

Thanks to Jeffrey Yasskin for the thorough review!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141330 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
d12059673dcef32bc2b6bae5321654d33863afe6 06-Oct-2011 Erik Verbruggen <erikjv@me.com> Added CXAvailability_NotAccessible to indicate that a declaration is available, but not accessible from the current code completion context.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141278 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
82340e8cbd353ae4ddb545f61ba9816c8d69ba8e 07-Sep-2011 Kaelyn Uhrain <rikka@google.com> Fix Sema::CorrectTypo to ignore found but unresolved symbols

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139252 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
8697d308c1bdd50e5c45757ac11be701c26e9e97 01-Sep-2011 Fariborz Jahanian <fjahanian@apple.com> objective-c: this patch (re)introduces objective-c's default property
synthesis. This new feature is currently placed under
-fobjc-default-synthesize-properties option
and is off by default pending further testing.
It will become the default feature soon.
// rdar://8843851


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138913 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
85ea7aa961deac1d754f610af8062ae3f8b4e2a5 30-Aug-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Declare and define implicit move constructor and assignment operator.

This makes the code duplication of implicit special member handling even worse,
but the cleanup will have to come later. For now, this works.
Follow-up with tests for explicit defaulting and enabling the __has_feature
flag to come.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138821 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
95ed7784a335aca53b0c6e952cf31a4cfb633360 27-Aug-2011 Fariborz Jahanian <fjahanian@apple.com> objective-c: Treat top-level objective-c declarations
, such as list of forward @class decls, in a DeclGroup
node. Deal with its consequence throught clang. This
is in preparation for more Sema work ahead. // rdar://8843851.
Feel free to reverse if it breaks something important
and I am unavailable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138709 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
f0c1d8f804e7854bedf3f241409185951ee67866 03-Aug-2011 Kaelyn Uhrain <rikka@google.com> Improve overloaded function handling in the typo correction code.

Change TypoCorrection to store a set of NamedDecls instead of a single
NamedDecl. Also add initial support for performing function overload
resolution to Sema::DiagnoseEmptyLookup.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136807 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
5f9e272e632e951b1efe824cd16acb4d96077930 23-Jul-2011 Chris Lattner <sabre@nondot.org> remove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports
them into the clang namespace.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135852 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
b5f65475d25b67f87e368daa1583b762af7e2e45 18-Jul-2011 Chris Lattner <sabre@nondot.org> Use the new llvm::TinyPtrVector class, which implements exactly what
ShadowMapEntry was.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135368 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
98a5403ecf1d2b60ae8cbf43e54194bd762cacaa 12-Jul-2011 Fariborz Jahanian <fjahanian@apple.com> Fix a bug where a local variable named 'self' is causing
implicit ivar accesses to go through the 'self' variable
rather than the real 'self' for the method. // rdar://9730771


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134992 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
701d1e77aca7e86348386fdeadcd56ca650f95ad 12-Jul-2011 Hans Wennborg <hans@hanshq.net> Fix typo correction crash on overloaded functions, pr10283.

It would be cool if we could do overload resolution to suggest
the right function, but at least this fixes the crashing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134976 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
c5bb9d4b661ce5b13ba1dec2bce7a25fb45f95a0 05-Jul-2011 Benjamin Kramer <benny.kra@googlemail.com> Initialize member.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134403 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
07f4a06c402a2ccdd9eae7a3d710990b22040001 01-Jul-2011 Douglas Gregor <dgregor@apple.com> When adding boolean keywords for typo correction, add either "bool" or
"_Bool" (depending on dialect), but not both, since they have the same
edit distance from "Bool".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134263 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
55620531ebdc775788a49f63fc1344242b6aa0db 29-Jun-2011 Chandler Carruth <chandlerc@gmail.com> Fix non-determinism in selecting between equal-length names which refer
to the same declaration when correcting typos. This is done by
essentially sorting the corrections as they're added.

Original patch by Kaelyn Uhrain, but modified for style and correctness
by accounting for more than just the textual spelling.

This still is a bit of a WIP hack to make this deterministic. Kaelyn
(and myself) are working on a more principled solution going forward.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134038 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
9af7e8e0cb15b41da930e481bbc3b927ad95f78f 28-Jun-2011 Chandler Carruth <chandlerc@gmail.com> Fix an invalid use of ::back() on an newly emptied vector. Also tighten
up several places where we never expect to have NULL pointers to assert
early.

This fixes a valgrind error within CorrectTypo, but not the
non-determinism.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134032 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
2ecc28a77207a5d24422956b3bc38d386209ab73 28-Jun-2011 Douglas Gregor <dgregor@apple.com> Dynamically allocate the StringMaps used in typo correction so that we
don't rely on the existence of a copy constructor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134009 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
d8bba9c15230d2b1b3893e272106aa79efc50251 28-Jun-2011 Douglas Gregor <dgregor@apple.com> Add support for C++ namespace-aware typo correction, e.g., correcting

vector<int>

to

std::vector<int>

Patch by Kaelyn Uhrain, with minor tweaks + PCH support from me. Fixes
PR5776/<rdar://problem/8652971>.

Thanks Kaelyn!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134007 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
e458fdab69ecec734726ad0089b1a4d7131aa5c0 24-Jun-2011 Jay Foad <jay.foad@gmail.com> Fix unused label warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133790 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
c39b6bc958982171b45c658389840a6241739a5e 24-Jun-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> This patch started as an attempt to fix up the horrid naming
conventions. I then discovered a typo in the using declaration bit in
LookupSpecialMember. This led to discovering [namespace.udecl]p15, which
clang implements incorrectly. Thus I've added a comment and implemented
the code consistently with the rest of clang - that is incorrectly.

And because I don't want to include tests of something incorrect, I've
ripped the test out.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133784 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
4cc12c6e47a200cf166ac21efc09dd033f34c9b2 23-Jun-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Clean up the heart of the caching code and miss fewer edge cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133671 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
ab183dff7ed681f7140a8e32510c4f619b791d2e 23-Jun-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Fix a think-o that amazingly didn't show up until I started writing
implicit move tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133655 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
431a1cbd3dc5267247b0d66a4e65d51ef307fdcf 22-Jun-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Actually, you know, fix the problem.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133604 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
4dba7b56d4551b7e03e20eeb7f45e5c962baa20c 22-Jun-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Avoid making assumption that this is either a CXXMethodDecl or a
FunctionTemplateDecl. I'm not quite sure what else it could be, though,
and would appreciate some insight.

This ought to fix the broken builds

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133600 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
661c67a9227708056850403847a10395308705e5 22-Jun-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Attempt to reapply this patch for caching copy assignment operator
lookup. Previously, it was breaking self-host, but it's been a week and
a half and I can't reproduce, so I need to see if it's still failing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133581 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
3bde0ce7a18d2513ebe286df67baa32700fd3d6b 10-Jun-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> This change is breaking selfhost. Revert it until I have more time
to study it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132843 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
53e669f4bd617dc4df1b1850bcd3998d7680bdc5 10-Jun-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement caching of copy assignment operator lookup.

I believe, upon, careful review, that this code causes us to incorrectly
handle exception specifications of copy assignment operators in C++03
mode. However, we currently do not seem to properly implement the subtle
distinction between copying of members and bases made by implicit copy
constructors and assignment operators in C++03 - namely that they are
limited in their overload selection - in all cases. As such, I feel that
committing this code is correct pending a careful review of our
implementation of these semantics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132841 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
c530d1758cef1acc596f2ec905665da534e66d29 10-Jun-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement caching for copy constructors in similar situations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132835 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
b320e0c322fb71d6235ebca9ec22940a97bdcdc7 10-Jun-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement caching of default constructors on the resolution table. This
isn't yet used for the less controlled environments of initialization.

Also a few random text fixups.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132833 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
305435867ccb14db1c3937a7f91945c42739b980 07-Jun-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Catch the memory leak in a bucket

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132700 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
308742c87e2311c3f349092e5b823c3821e61b10 04-Jun-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Reimplement r132572 on top of a FoldingSet, thus hopefully solving both
the self-host failures and Chandler's concerns.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132622 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
c5c9b538de70124a57bee0adbfdd7853a582176e 03-Jun-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Revert r132572 to figure out why it broke selfhost and clean it up as
suggested by Chandler.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132593 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
8fd7722fce4e4f9549897699ec3a4c752613b214 03-Jun-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Begin implementing a cache of special member lookups. Currently only
destructors are implemented but other special members are on the way,
which is where the real benefits of this will be visible.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132572 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
cdee3fee8ca4df7fb9179f29cc3ba96ac4fd0f95 12-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement implicit deletion of default constructors.

Yes, I'm aware that the diagnostics are awful.

Tests to follow.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131203 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
37b8c9ee7cf2b4d5ce3ccd3be1fcadd18a783a57 09-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Clean up trivial default constructors now.

hasTrivialDefaultConstructor() really really means it now.

Also implement a fun standards bug regarding aggregates. Doug, if you'd
like, I can un-implement that bug if you think it is truly a defect.

The bug is that non-special-member constructors are never considered
user-provided, so the following is an aggregate:

struct foo {
foo(int);
};

It's kind of bad, but the solution isn't obvious - should

struct foo {
foo (int) = delete;
};

be an aggregate or not?

Lastly, add a missing initialization to FunctionDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131101 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
7193b3ee1abf4997c3c46486c43e70f3221d3ef3 02-May-2011 Chandler Carruth <chandlerc@gmail.com> Don't abuse reinterpret cast to do something the API of PointerUnion
provides proper support for. This was caught by
-Wundefined-reinterpret-cast, and I think a reasonable case for it to
warn on.

Also use is<...> instead of dyn_cast<...> when the result isn't needed.

This whole thing should probably switch to using UsuallyTinyPtrVector.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130707 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
f1cc1d0efddc40a76ab70b074792dcd7e5ca4315 23-Apr-2011 Jay Foad <jay.foad@gmail.com> Like the coding standards say, do not use "using namespace std".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130054 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
ad762fcdc16b9e4705b12b09d92b8c026212b906 15-Apr-2011 Richard Smith <richard-llvm@metafoo.co.uk> Add support for C++0x's range-based for loops, as specified by the C++11 draft standard (N3291).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129541 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
42151d5ba957841a15ffda0fac71cd7cb653d45e 13-Apr-2011 Axel Naumann <Axel.Naumann@cern.ch> From Vassil Vassilev: Give external source's last resort lookup a chance, even if an identifier could resolve to a builtin.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129438 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
f25760e17af1167c6fcf24e1ea8e3fcbd0386702 12-Apr-2011 Douglas Gregor <dgregor@apple.com> Objective-C++: The global namespace is an associated namespace of an
Objective-C pointer type. Fixes <rdar://problem/9142559>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129339 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
8b5b4099c61a136e9a1714c4d8a593febe942268 06-Mar-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Reinstate r127112, "Propagate new-style exception spec information to ExtProtoInfo.", this time with the missing header.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127118 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
708a86690469474f0a8149abca71aa4c62bf9710 06-Mar-2011 NAKAMURA Takumi <geek4civic@gmail.com> Revert r127112, "Propagate new-style exception spec information to ExtProtoInfo."

It seems missing "clang/Basic/ExceptionSpecificationType.h".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127115 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
06bfa84588658d721094f383d6950e75100c4c4c 05-Mar-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Propagate new-style exception spec information to ExtProtoInfo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127112 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
6784304db526cde59046d613c4175ce2caf93e44 05-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed LabelDecl source range and cleaned creation code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127094 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
203548ba4b72e7e59320d352afc1eb0b5ab131de 03-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed source range for LabelDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126952 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
f8291a190cc6765630312911f441d9e23564eda2 24-Feb-2011 Axel Naumann <Axel.Naumann@cern.ch> From Vassil Vassilev:
Add an interface for last resort, unqualified lookup. It can provide results for unqualified lookup when Sema fails to find anything itself.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126387 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
aef05d71bcceb6f913b1749500863bcd3fed43b6 19-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Use PointerUnion::getAddrOf instead of messing with PointerUnion & reinterpret_cast.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126021 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
febb5b884b1bb946b83800cb77cbea0119570d84 18-Feb-2011 Chris Lattner <sabre@nondot.org> fix rdar://9024687, a crash on invalid that we used to silently ignore.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125962 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
4ae493cccbfbf122ec6ebac0e330232c22fa8489 18-Feb-2011 Chris Lattner <sabre@nondot.org> implement basic support for __label__. I wouldn't be shocked if there are
bugs from other clients that don't expect to see a LabelDecl in a DeclStmt,
but if so they should be easy to fix.

This implements most of PR3429 and rdar://8287027



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125817 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
337e550218128e7d922c09bb354fbc71de90c568 18-Feb-2011 Chris Lattner <sabre@nondot.org> Switch labels over to using normal name lookup, instead of their
own weird little DenseMap. Hey look, we now emit unused label
warnings deterministically, amazing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125813 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
d98abd8c68bd96e111a0bebdb90f38cf2a5632a2 16-Feb-2011 Douglas Gregor <dgregor@apple.com> When searching for visible declarations (e.g., for code completion),
be sure to look at all of the Objective-C class declarations within a
@class. Fixes <rdar://problem/8876207>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125635 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
dfbb02a16ac8c764b5ba1742450513d6212d2f9f 27-Jan-2011 NAKAMURA Takumi <geek4civic@gmail.com> Fix whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124364 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
0099530a2288df7c2140dd8992b7310b9f6930a9 27-Jan-2011 NAKAMURA Takumi <geek4civic@gmail.com> 7bit-ize.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124363 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
a7fc901a2e39bfe55bfcff5934b2d9fdf9656491 05-Jan-2011 Douglas Gregor <dgregor@apple.com> Replace the representation of template template argument pack
expansions with something that is easier to use correctly: a new
template argment kind, rather than a bit on an existing kind. Update
all of the switch statements that deal with template arguments, fixing
a few latent bugs in the process. I"m happy with this representation,
now.

And, oh look! Template instantiation and deduction work for template
template argument pack expansions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122896 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
6b9109e9d5446f213b12d2a6b76495bffb06b794 03-Jan-2011 Douglas Gregor <dgregor@apple.com> When we attempt to create a built-in that involves a library type we
don't have access to (e.g., fprintf, which needs the library type
FILE), fail with a warning and forget about the builtin
entirely. Previously, we would actually provide an error, which breaks
autoconf's super-lame checks for fprintf, longjmp, etc. Fixes PR8316.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122744 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
8595a0ced701415d5194d9bdd6b47b5de6fce504 02-Jan-2011 Francois Pichet <pichet2000@gmail.com> Remove obsolete comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122686 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
e23cf437fe76b1ed02d63c3f61b456fd48a915f5 14-Dec-2010 John McCall <rjmccall@apple.com> Restore r121752 without modification.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121763 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
5bfe232d1f07a6fd160fcf82c277c055a412a1c0 14-Dec-2010 John McCall <rjmccall@apple.com> Pull out r121752 in case it's causing the selfhost breakage.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121759 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
0e88aa7100da32acc63bc8a4dcb946ed517868f1 14-Dec-2010 John McCall <rjmccall@apple.com> Factor out most of the extra state in a FunctionProtoType into a separate
class to be passed around. The line between argument and return types and
everything else is kindof vague, but I think it's justifiable.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121752 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
70c233591ad2f77a01c8a318283ae03010c64c8f 09-Dec-2010 Douglas Gregor <dgregor@apple.com> Don't walk the translation unit context to produce protocol names when
global code completions are disabled (e.g., because they are
cached). Also, make sure that forward-declared protocols are visited
when we look for all visible names within a declaration context.

Previously, we would end up with duplicate completions for protocols.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121416 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
fce5656f752199bb99a80fdff9184f9ddb470fc3 02-Dec-2010 Douglas Gregor <dgregor@apple.com> Do not change the size of LookupResult::Filter based on the NDEBUG
macri; the extra bool fits into padding anyway.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120708 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
67aba816901503d9cf7ba699525fa62cc7f8e5e4 30-Nov-2010 Fariborz Jahanian <fjahanian@apple.com> Such function decls,as objc's objc_msgSend, builtins in
a specific language. We are adding such language info. by
extensing Builtins.def and via a language flag added
to LIBBUILTIN/BUILTIN and check for that when deciding
a name is builtin or not. Implements //rdar://8689273.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120429 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
ba8bda05fefd3bb2f1ef201784b685f715bdde29 09-Nov-2010 Fariborz Jahanian <fjahanian@apple.com> Restore patch reversed in r118475. Fixes
// rdar://8632525


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118634 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
7a054b1a2ebd265bbc8c640d176af92ad0965701 07-Nov-2010 Ted Kremenek <kremenek@apple.com> Fix memory leak of IdentifierIterator object.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118371 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
ca45da0c6da20d9c0c903370f99af5e9a186e0da 02-Nov-2010 Douglas Gregor <dgregor@apple.com> Teach code completion to provide property results when the property
can be used to automatically synthesize an ivar.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118052 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
78f5911a4ef8742c51a7f7643957e1aaa0098324 29-Oct-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> When doing name lookup for members don't look into global/namespace scope.
Better performance and fixes rdar://8603569.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117656 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
157a3ff14d2dfe21c63fec34f07bf917d0ccf789 27-Oct-2010 Douglas Gregor <dgregor@apple.com> Remove redundant test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117446 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
53e4b55d2c534cfd59021ff18349ac58979ce43f 26-Oct-2010 Douglas Gregor <dgregor@apple.com> Teach typo correction not to return the same keyword that matches a
typo. This can happen with context-sensitive keywords like "super",
when typo correction didn't know that "super" wasn't permitted in this
context.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117372 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
77a1a8868e03bb74412f001f32d66ce0c26afae6 23-Oct-2010 Douglas Gregor <dgregor@apple.com> C++ [basic.scope.hiding] allows an ordinary name to hide a non-tag
name *in the same scope*, but not across scopes. Implement the
highlighted condition.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117212 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
f17b58c98b57537e9abfaaa8b5f19ea7e6de01ee 23-Oct-2010 Douglas Gregor <dgregor@apple.com> In the presence of using declarations, we can find the same class
members in class subobjects of different types. So long as the
underlying declaration sets are the same, and the declaration sets
involve non-instance members, this is not an ambiguity.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117163 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
9a632eaa0ee73e4db701a8df74e92909d1fa350e 20-Oct-2010 Douglas Gregor <dgregor@apple.com> Fix handling of property and ivar lookup in typo correction; the two
kinds of lookup into Objective-C classes were tangled together, a
situation that was compounded by automatically synthesized ivars.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116907 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
3eedbb06dd35b021bb614250585d4a6a5b7936e7 20-Oct-2010 Douglas Gregor <dgregor@apple.com> Introduce a simple cache for unqualified typo corrections, so that we
don't repeatedly loop through identifiers, correcting the same typo'd
identifier over and over again.

We still bail out after 20 typo corrections, but this should help
improve performance in the common case where we're typo-correcting
because the user forgot to include a header.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116901 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
f98402d9e6ccef7052eb01de418fd740f5f5e02f 20-Oct-2010 Douglas Gregor <dgregor@apple.com> Eliminate another ordering dependency in typo correction. Re-enable typo.m, which seems to be working properly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116894 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
a1194775dc3bc3c9471e089797ca08fdbe773794 20-Oct-2010 Douglas Gregor <dgregor@apple.com> Provide an upper bound to the edit-distance algorithm when performing
typo correction, to allow early exits.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116868 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
362a8f21a6438bb0b1901e0b7ae44b5c33fb48ca 19-Oct-2010 Douglas Gregor <dgregor@apple.com> Improve the performance of typo correction, by using a simple
computation to compute the lower bound of the edit distance, so that
we can avoid computing the edit distance for names that will clearly
be rejected later. Since edit distance is such an expensive algorithm
(M x N), this leads to a 7.5x speedup when correcting NSstring ->
NSString in the presence of a Cocoa PCH.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116849 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
6eaac8b3e68177f56090ddb0fcfc8fbfd49150a6 15-Oct-2010 Douglas Gregor <dgregor@apple.com> When performing typo correction, keep track of whether the last lookup
we did was an acceptable lookup. If it is, then we can re-use that
lookup result. If it isn't, we have to perform the lookup again. This
is almost surely the cause behind the mysterious typo.m failures on
some builders; we were getting the wrong lookup results returned.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116586 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
7b824e854b8ffc0d46337d95425825015528f35c 15-Oct-2010 Douglas Gregor <dgregor@apple.com> When we're in the context of an Objective-C message send's receiver,
typo correction prefers "super" over other, equivalent completions. I
believe this will fix the regression on the buildbot.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116574 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
95f4292cc526c629fead321c7fcfd4fe0f3bc66e 15-Oct-2010 Douglas Gregor <dgregor@apple.com> When performing typo correction, look through the set of known
identifiers to determine good typo-correction candidates. Once we've
identified those candidates, we perform name lookup on each of them
and the consider the results.

This optimization makes typo correction > 2x faster on a benchmark
example using a single typo (NSstring) in a tiny file that includes
Cocoa.h from a precompiled header, since we are deserializing far less
information now during typo correction.

There is a semantic change here, which is interesting. The presence of
a similarly-named entity that is not visible can now affect typo
correction. This is both good (you won't get weird corrections if the
thing you wanted isn't in scope) and bad (you won't get good
corrections if there is a similarly-named-but-completely-unrelated
thing). Time will tell whether it was a good choice or not.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116528 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
e24b575f06985336973bb721e198bd184bf7bdd3 14-Oct-2010 Douglas Gregor <dgregor@apple.com> Tweak the typo-correction implementation to determine corrections
solely based on the names it sees, rather than actual declarations it
gets. In essence, we determine the set of names that are "close
enough" to the typo'd name. Then, we perform name lookup for each of
those names, filtering out those that aren't actually visible, and
typo-correct from the remaining results.

Overall, there isn't much of a change in the behavior of typo
correction here. The only test-suite change comes from the fact that
we make good on our promise to require that the user type 3 characters
for each 1 character corrected.

The real intent behind this change is to set the stage for an
optimization to typo correction (so that we don't need to deserialize
all declarations in a translation unit) and future work in finding
missing qualification ("'vector' isn't in scope; did you mean
'std::vector'?). Plus, the code is cleaner this way.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116511 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
24dce6ef2f39d939eb8f01ef70eaa7dcdb8c6a62 04-Sep-2010 Chris Lattner <sabre@nondot.org> zap more dead code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113076 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
53b9441b5a81a24fa1f66f3f6416f1e36baa9c2f 01-Sep-2010 Ted Kremenek <kremenek@apple.com> Split ObjCInterfaceDecl::ReferencedProtocols into two lists: ReferencedProtocols and AllReferencedProtocols. ReferencedProtocols
(and thus protocol_begin(), protocol_end()) now only contains the list of protocols that were directly referenced in
an @interface declaration. 'all_referenced_protocol_[begin,end]()' now returns the set of protocols that were referenced
in both the @interface and class extensions. The latter is needed for semantic analysis/codegen, while the former is
needed to maintain the lexical information of the original source.

Fixes <rdar://problem/8380046>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112691 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
410c4f2eb5e6a8c2318cacb9a6751f1b4fcff166 31-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Make inline namespace not be transparent after all. The concept simply doesn't fit. Instead, special-case the few places where transparent contexts have the desired behavior for inline namespaces. Fixes a redeclaration issue in inline namespaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112637 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
2d88708cbe4e4ec5e04e4acb6bd7f5be68557379 26-Aug-2010 John McCall <rjmccall@apple.com> Split out a header to hold APIs meant for the Sema implementation from Sema.h.
Clients of Sema don't need to know (for example) the list of diagnostics we
support.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112093 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
2de56d1d0c3a504ad1529de2677628bdfbb95cd4 25-Aug-2010 John McCall <rjmccall@apple.com> GCC didn't care for my attempt at API compatibility, so brute-force everything
to the new constants.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112047 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
781472fe99a120098c631b0cbe33c89f8cef5e70 25-Aug-2010 John McCall <rjmccall@apple.com> Split FunctionScopeInfo and BlockScopeInfo into their own header.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112038 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
50df6ae41f232612e5e88b19e0db9900d08d2f6c 25-Aug-2010 John McCall <rjmccall@apple.com> Remove the DenseSet dependency from Sema.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112030 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
2a7fb27913999d132cf9e10e03dc5271faa2e9d3 25-Aug-2010 John McCall <rjmccall@apple.com> Move more stuff out of Sema.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112026 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
5f1e0942a32657b625702aa52f82430d0120f424 24-Aug-2010 John McCall <rjmccall@apple.com> More header elimination. The goal of all this is to allow Parser to
#include Sema.h while keeping all the AST declarations opaque. That may
not be reasonably attainable, though.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111907 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
d226f65006733ed7f709c3174f22ce33391cb58f 21-Aug-2010 John McCall <rjmccall@apple.com> DeclPtrTy -> Decl *



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111733 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
19510856727e0e14a3696b2a72c35163bff2a71f 20-Aug-2010 John McCall <rjmccall@apple.com> Another step in the process of making the parser depend on Sema:
- move DeclSpec &c into the Sema library
- move ParseAST into the Parse library
Reflect this change in a thousand different includes.
Reflect this change in the link orders.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111667 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
8071e4212ae08f8014e0c3ae6d18b7388003a5cc 15-Aug-2010 Douglas Gregor <dgregor@apple.com> Extend the code-completion caching infrastructure to include global
declarations (in addition to macros). Each kind of declaration maps to
a certain set of completion contexts, and the ASTUnit completion logic
introduces the completion strings for those declarations if the actual
code-completion occurs in one of the contexts where it matters.

There are a few new code-completion-context kinds. Without these,
certain completions (e.g., after "using namespace") would need to
suppress all global completions, which would be unfortunate.

Note that we don't get the priorities right for global completions,
because we don't have enough type information. We'll need a way to
compare types in an ASTContext-agnostic way before this can be
implemented.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111093 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
e737f5041a36d0befb39ffeed8d50ba15916d3da 12-Aug-2010 Douglas Gregor <dgregor@apple.com> Move Sema's headers into include/clang/Sema, renaming a few along the way.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110945 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
b3b50a8b2c91d21afda75c458ca7d210abf6ffbf 12-Aug-2010 John McCall <rjmccall@apple.com> Don't try to implicitly declare special members of an invalid class.
Fixes a crash in a rather large and difficult-to-reduce test case.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110882 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
2577743c5650c646fb705df01403707e94f2df04 12-Aug-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added locations and type source info for DeclarationName.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110860 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
7f1c547ee6cd413845f7df9713c701f99866f91d 11-Aug-2010 Douglas Gregor <dgregor@apple.com> If name lookup finds different type declarations in different scopes
that actually refer to the same underlying type, it is not an
ambiguity; add uniquing support based on the canonical type of type
declarations. Fixes <rdar://problem/8296180>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110806 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
a0068fc64351db9c47916566e3b85ab733cd8d6d 09-Jul-2010 Douglas Gregor <dgregor@apple.com> Introduce -f{no-}spell-checking options to enable/disable
spell-checking. By default, spell-checking is enabled for Clang
(obviously) but disabled in CIndex for performance reasons.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107992 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
1827403a7138946305c0058f262e02b595cf882f 03-Jul-2010 Douglas Gregor <dgregor@apple.com> Lazily declare default constructors. We now delay the construction of
declarations for implicit default constructors, copy constructors,
copy assignment operators, and destructors. On a "simple" translation
unit that includes a bunch of C++ standard library headers, we
generate relatively few of these implicit declarations now:

4/159 implicit default constructors created
18/236 implicit copy constructors created
70/241 implicit copy assignment operators created
0/173 implicit destructors created

And, on this translation unit, this optimization doesn't really
provide any benefit. I'll do some more performance measurements soon,
but this completes the implementation work for <rdar://problem/8151045>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107551 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
225843186e3972ce798d3de00f86da9008b15a0e 03-Jul-2010 Douglas Gregor <dgregor@apple.com> Lazily declare implicit copy constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107543 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
e5eee5a52d98021de862b7965c88577598d52ccb 03-Jul-2010 Douglas Gregor <dgregor@apple.com> Introduce a new routine, LookupConstructors(), and use it for all
constructor-name lookup.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107536 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
a376d10acfacf19d6dfa41069f7929739a18dd7a 02-Jul-2010 Douglas Gregor <dgregor@apple.com> Lazily declare copy-assignment operators.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107521 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
4923aa25eb39d64106a5817c02d560a3aecf8b2c 02-Jul-2010 Douglas Gregor <dgregor@apple.com> Lazily declare the implicitly-declared destructor in a C++ class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107510 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
db89f289a22897f1031c92f3e49f7a9ba7bae61e 02-Jul-2010 Douglas Gregor <dgregor@apple.com> Add a new routine Sema::LookupDestructor and make all destructor-lookup calls use that routine

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107444 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
025291b591a528d8a3f303991f65e19fa1e90a9d 01-Jul-2010 Douglas Gregor <dgregor@apple.com> Be a bit more careful with undefined CXXRecordDecls. Fixes
rdar://problem/8124080 and PR7118.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107358 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
c7e04dad588a30c94648b9bd70cdbe25688d7629 28-May-2010 John McCall <rjmccall@apple.com> A more minimal fix for PR6762.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104991 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
2b7baf0816a40af3fde3a3e174192a549b785a50 28-May-2010 John McCall <rjmccall@apple.com> Roll back r104941.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104990 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
1d0a5856d066f9030efbe3e0d9bbbb50ea597b99 28-May-2010 John McCall <rjmccall@apple.com> 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)

Fixes PR6762.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104941 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
fa4edcf2639415bd3430a61e6d5bfc71d5b8981e 28-May-2010 John McCall <rjmccall@apple.com> Optimize and complete associated-class-and-namespace collection from
a type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104938 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
d2235f60e7bbd9e690c05fced371df9da76adc2b 20-May-2010 Douglas Gregor <dgregor@apple.com> Reinstate r104117, Chandler Carruth's change that "[provides] a naming
class for UnresolvedLookupExprs, even when occuring on template
names" along with a fix for an Objective-C++ crasher it introduced.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104277 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
4e58c25aa579d30cd1e4b0bfb36321c14652be12 20-May-2010 Douglas Gregor <dgregor@apple.com> Remove accidental commit

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104207 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
68dd3ee3b5ae5b7694b4a21e34b4355431ed0457 20-May-2010 Douglas Gregor <dgregor@apple.com> Various small fixes for construction/destruction of Objective-C++
instance variables:
- Use isRecordType() rather than isa<RecordType>(), so that we see
through typedefs in ivar types.
- Mark the destructor as referenced
- Perform C++ access control on the destructor


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104206 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
bf1cbaf1b0ac9d967ff6abf27788cc98f0f5e7da 19-May-2010 Daniel Dunbar <daniel@zuster.org> Revert r104117, "Provide a naming class for UnresolvedLookupExprs, even when
occuring on..." which breaks some Objective-C code. Working on getting a test
case...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104150 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
c3f984fa13364520f4a2c447d1d213db77db3309 19-May-2010 Chandler Carruth <chandlerc@gmail.com> Provide a naming class for UnresolvedLookupExprs, even when occuring on
template names. We were completely missing naming classes for many unqualified
lookups, but this didn't trigger code paths that need it. This removes part of
an optimization that re-uses the template name lookup done by the parser to
determine if explicit template arguments actually form a template-id.
Unfortunately the technique for avoiding the duplicate lookup lost needed data
such as the class context in which the lookup succeeded.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104117 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
d0785ea6c4c37a7fa4fcd4840e6e036ffb44e13e 18-May-2010 Douglas Gregor <dgregor@apple.com> Give a slight edge to the context-sensitive keyword 'super' over
non-function-local declarations with names similar to what the user
typed. For example, this allows us to correct 'supper' to 'super' in
an Objective-C message send, even though the C function 'isupper' has
the same edit distance.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104023 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
91f7ac7e20ba03b8cd711974e2611231077bbe81 18-May-2010 Douglas Gregor <dgregor@apple.com> Tweak typo-correction logic a bit regarding "super", so that we
consider "super" as a candidate whenever we're parsing an expression
within an Objective-C method in an interface that has a superclass. At
some point, we'd like to give "super" a little edge over non-local
names; that will come later.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104022 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
00b4b039f02d338ae4774797053235a7e65abbde 14-May-2010 Douglas Gregor <dgregor@apple.com> Make sure to search semantic scopes and appropriate template-parameter
scopes during unqualified name lookup that has fallen out to namespace
scope. Fixes PR7133.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103766 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
77bb1aa78bcd26e42c0382043e65a2b03242be4d 01-May-2010 John McCall <rjmccall@apple.com> It turns out that basically every caller to RequireCompleteDeclContext
already knows what context it's looking in. Just pass that context in
instead of (questionably) recalculating it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102818 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
54022952450beff428a30ef5adfb82874063603d 30-Apr-2010 Douglas Gregor <dgregor@apple.com> Fix ADL for types declared in transparent decls, from Alp Toker!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102695 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
2b147f072b118607aafafd2f05843243abfe4488 25-Apr-2010 Douglas Gregor <dgregor@apple.com> When name lookup finds a single declaration that was imported via a
using declaration, look at its underlying declaration to determine the
lookup result kind (e.g., overloaded, unresolved). Fixes at least one
issue in Boost.Bimap.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102317 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
6bf356fb8f769575d5e6e54a3bf81436ddec106a 25-Apr-2010 Douglas Gregor <dgregor@apple.com> When performing name lookup for an operator name, be sure to look
through using declarations. Fixes ~18 tests in Boost.Fusion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102311 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
76d326448d7e4c10b2896edc2ee855d1e68d1b88 24-Apr-2010 John McCall <rjmccall@apple.com> Recommit r102215, this time being more careful to only set the "principal
declaration" (i.e. the only which will actually be looked up) to have the
non-member-operator bit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102231 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
f0bf4d554f2513cbb4bec952c81ced59279ad91e 24-Apr-2010 Devang Patel <dpatel@apple.com> Revert r102215. This causes clang crash while compiling a test case from gdb testsuite.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102224 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
f88b0d6c99e6473e78331271935986535dc4603c 23-Apr-2010 John McCall <rjmccall@apple.com> Transition the last acceptable-result filter kind in LookupResult over to use
a simple IDNS mask by introducing a namespace for non-member operators.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102215 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
0d6b1640eb4d1a4a0203235cfdfcdaf3335af36d 23-Apr-2010 John McCall <rjmccall@apple.com> Recommit my change to how C++ does elaborated type lookups, now with
two bugfixes which fix selfhost and (hopefully) the nightly tests.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102198 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
00b40d3f2fb8b2f9043daf3dd4558bff98346b3c 23-Apr-2010 Daniel Dunbar <daniel@zuster.org> Revert "C++ doesn't really use "namespaces" for different kinds of names the same", which seems to break most C++ nightly test apps.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102174 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
d04efc98d08731e31bd73f430803acc5ffa9040a 23-Apr-2010 John McCall <rjmccall@apple.com> C++ doesn't really use "namespaces" for different kinds of names the same
way that C does. Among other differences, elaborated type specifiers
are defined to skip "non-types", which, as you might imagine, does not
include typedefs. Rework our use of IDNS masks to capture the semantics
of different kinds of declarations better, and remove most current lookup
filters. Removing the last remaining filter is more complicated and will
happen in a separate patch.

Fixes PR 6885 as well some spectrum of unfiled bugs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102164 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
bd4187bb6f4a0cfe7d6d2c8e8856b16bca2f0748 23-Apr-2010 Douglas Gregor <dgregor@apple.com> Kill off IDNS_ObjCImplementation and IDNS_ObjCCategoryName; they
aren't and never were used. There's a gap in the bit pattern for IDNS
now, but I'm sure *someone* will fill it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102143 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
c220a18ecdfa42ebb3ce267974cf24e343e2aa6d 19-Apr-2010 Douglas Gregor <dgregor@apple.com> When searching for code-completion and typo-correction candidates,
look from an Objective-C class or category to its implementation, to
pick up synthesized ivars. Fixes a problem reported by David
Chisnall.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101792 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
c83c6874e3bf1432d3df5e8d3530f8561ff5441f 16-Apr-2010 Douglas Gregor <dgregor@apple.com> Feed proper source-location information into Sema::LookupSingleResult,
in case it ends up doing something that might trigger diagnostics
(template instantiation, ambiguity reporting, access
reporting). Noticed while working on PR6831.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101412 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
aaf87162c5fbfbf320072da3a8e83392e1bbf041 14-Apr-2010 Douglas Gregor <dgregor@apple.com> Teach typo correction about various language keywords. We can't
generally recover from typos in keywords (since we would effectively
have to mangle the token stream). However, there are still benefits to
typo-correcting with keywords:
- We don't make stupid suggestions when the user typed something
that is similar to a keyword.
- We can suggest the keyword in a diagnostic (did you mean
"static_cast"?), even if we can't recover and therefore don't have
a fix-it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101274 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
931f98ab919203b8e0f14768b275a7fdf77b392a 14-Apr-2010 Douglas Gregor <dgregor@apple.com> Return the corrected DeclarationName from Sema::CorrectTypo rather
than just a bool indicating that correction occurred. No actual
functionality change (it's still always used like a bool), but this
refactoring will be used to support typo correction to keywords.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101259 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
9ab14541716928894821cf5d53d6b4c95ffdf3a3 08-Apr-2010 Jeffrey Yasskin <jyasskin@google.com> Make CXXScopeSpec invalid when incomplete, and propagate that into any
Declarator that depends on it. This fixes several redundant errors and bad
recoveries.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100779 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
264ba48dc98f3f843935a485d5b086f7e0fdc4f1 30-Mar-2010 Rafael Espindola <rafael.espindola@gmail.com> the big refactoring bits of PR3782.

This introduces FunctionType::ExtInfo to hold the calling convention and the
noreturn attribute. The next patch will extend it to include the regparm
attribute and fix the bug.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99920 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
b5b2ccbbb69f49146d937e1dc6d7dc11d631908c 24-Mar-2010 Douglas Gregor <dgregor@apple.com> When performing name lookup for the allocation or deallocation
operators, make sure that the implicitly-declared global new and
delete operators are always available. Fixes PR5904.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99382 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
7aceaf8cee77c98478e8934dc283910292711a7e 19-Mar-2010 John McCall <rjmccall@apple.com> When elevating access along an inheritance path, initialize the computed
access to the (elevated) access of the accessed declaration, if applicable,
rather than plunking that access onto the end after we've calculated the
inheritance access.

Also, being a friend of a derived class gives you public access to its
members (subject to later modification by further inheritance); it does
not simply ignore a single location of restricted inheritance.

Also, when computing the best unprivileged path to a subobject, preserve
the information that the worst path might be AS_none (forbidden) rather
than a minimum of AS_private.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98899 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
dbdf5e7d0b6f1f8d8c496c1a0ada6f706cddf100 15-Mar-2010 Douglas Gregor <dgregor@apple.com> During C++ name lookup, use DeclContext::Equals() rather than
comparing DeclContext pointers, to avoid having to remember to call
getPrimaryContext() everywhere. This is the last part PR6594.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98546 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
711be1e89a56cdf679143ad18afaa58ed59f0584 15-Mar-2010 Douglas Gregor <dgregor@apple.com> Implement C++ [temp.local]p8, which specifies that a template
parameter hides a namespace-scope declararion with the same name in an
out-of-line definition of a template. The lookup requires a strange
interleaving of lexical and semantic scopes (go C++), which I have not
yet handled in the typo correction/code completion path.

Fixes PR6594.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98544 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
ce056bcaa1c97b89a4b2de2112c62d060863be2b 21-Feb-2010 Douglas Gregor <dgregor@apple.com> Eliminate the default arguments to ASTContext::getFunctionType(),
fixing up a few callers that thought they were propagating NoReturn
information but were in fact saying something about exception
specifications.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96766 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
36262b81559cfce4f67256d052e4fed343a02861 19-Feb-2010 Douglas Gregor <dgregor@apple.com> Implement C++ name lookup for instance variables of Objective-C classes
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>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96677 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
85910986c4ab01927c192aea86b2234fec568259 12-Feb-2010 Douglas Gregor <dgregor@apple.com> In C++, allow builtins to be referred to via qualified name lookup, e.g.,

::__builtin_va_copy

Fixes one of the Firefox issues in PR5511.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95966 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
6b2accb4793e16b2e93a8c2589f5df702231f17a 10-Feb-2010 John McCall <rjmccall@apple.com> Improve access control diagnostics. Perform access control on member-pointer
conversions. Fix an access-control bug where privileges were not considered
at intermediate points along the inheritance path. Prepare for friends.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95775 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
5769d6195087229770d7ac90449443e026c47103 09-Feb-2010 John McCall <rjmccall@apple.com> Thread a source location into the template-argument deduction routines. There
may be some other places that could take advantage of this new information,
but I haven't really looked yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95600 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
1df0ee91a9d55b5c2eb0d96e7590f1c8b8fe8734 05-Feb-2010 Douglas Gregor <dgregor@apple.com> Teach C++ name lookup that it's okay to look in a scope without a
context. This happens fairly rarely (which is why we got away with
this bug). Fixes PR6184, where we skipped over the template parameter
scope while tentatively parsing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95376 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
6202119003aba91e5ff4e579cb9c26a8d1b9514f 05-Feb-2010 Douglas Gregor <dgregor@apple.com> Fix a crash with ill-formed code within a method in an ill-formed
category implementation, which showed up during (attempted) typo
correction. Fixes <rdar://problem/7605289>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95334 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
86ff308724171494395a840fd2efbe25e62f352e 04-Feb-2010 John McCall <rjmccall@apple.com> Extract a common structure for holding information about the definition
of a C++ record. Exposed a lot of problems where various routines were
silently doing The Wrong Thing (or The Acceptable Thing in The Wrong Order)
when presented with a non-definition. Also cuts down on memory usage.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95330 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
d0ed44812057f1adf0ebe38f3fab55973c4efaeb 02-Feb-2010 Ted Kremenek <kremenek@apple.com> Add a stop gap to Sema::CorrectTypo() to correct only up to 20 typos.
This is to address a serious performance problem observed when running
'clang -fsyntax-only' on really broken source files. In one case,
repeatedly calling CorrectTypo() caused one source file to be rejected
after 2 minutes instead of 1 second.

This patch causes typo correction to take neglible time on that file
while still providing correction results for the first 20 cases. I
felt this was a reasonable number for moderately broken source files.

I don't claim this is the best solution. Comments welcome. It is
necessary for us to address this issue because it is a serious
performance problem.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95049 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
aaa1a895725f3977c005304be9ca36747d9e3c97 31-Jan-2010 Chandler Carruth <chandlerc@gmail.com> Return early, reduce indentation, and simplify line breaks. No functionality
change.

PS: I'm under the impression formatting-only patches don't need pre-commit
review, but feel free to yell at me if I should post these first! =D


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94956 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
7edb5fdf9703e1abd780417db691b77d5fcbc610 26-Jan-2010 John McCall <rjmccall@apple.com> Handle redeclarations found by ADL deterministically and reasonably.

This solution relies on an O(n) scan of redeclarations, which means it might
scale poorly in crazy cases with tons of redeclarations brought in by a ton
of distinct associated namespaces. I believe that avoiding this
is not worth the common-case cost.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94530 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
a113e7263c5337731c65fada9de7ff72af25423b 26-Jan-2010 John McCall <rjmccall@apple.com> Allow ADL to find functions imported by using decls. Leave wordy comment
about interaction between ADL and default arguments. Shrug shoulders, commit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94524 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
6e26689f5d513e24ad7783a4493201930fdeccc0 26-Jan-2010 John McCall <rjmccall@apple.com> Preserve access bits through overload resolution much better. Some
general refactoring in operator resolution.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94498 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
92f883177b162928a8e632e4e3b93fafd2b26072 23-Jan-2010 John McCall <rjmccall@apple.com> Implement elementary access control.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94268 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
46460a68f6508775e98c19b4bb8454bb471aac24 20-Jan-2010 John McCall <rjmccall@apple.com> First pass at collecting access-specifier information along inheritance paths.
Triggers lots of assertions about missing access information; fix them.

Will actually consume this information soon.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94038 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
eec51cf1ba5f0e62c9cdb81b5c63babdd6e649ab 20-Jan-2010 John McCall <rjmccall@apple.com> Give UnresolvedSet the ability to store access specifiers for each declaration.
Change LookupResult to use UnresolvedSet. Also extract UnresolvedSet into its
own header and make it templated over an inline capacity.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93959 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
dc5c78639f4e64d790c08e7b6494ae86ceea4ff1 15-Jan-2010 John McCall <rjmccall@apple.com> Make LookupResult::resolveKind() robust against NotFoundInCurrentInstantiation.
Fixes PR 6049.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93557 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
7d3f576dc9ea6e866757abcd1736eb7e7433c325 15-Jan-2010 Douglas Gregor <dgregor@apple.com> When performing qualified name lookup into the current instantiation,
do not look into base classes if there are any dependent base
classes. Instead, note in the lookup result that we couldn't look into
any dependent bases. Use that new result kind to detect when this case
occurs, so that we can fall back to treating the type/value/etc. as a
member of an unknown specialization.

Fixes an issue where we were resolving lookup at template definition
time and then missing an ambiguity at template instantiation time.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93497 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
0cc8404f8cf320da140e560899e1560bce80fe8c 14-Jan-2010 Douglas Gregor <dgregor@apple.com> Switch the remaining code completions over to LookupVisibleDecls,
after adding the ability to determine whether our lookup is a
base-class lookup. Eliminate CollectMemberLookupResults, since it is
no longer used (yay).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93428 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
def9107059d460ada5f0eb3d58189c59122e3c3f 14-Jan-2010 Douglas Gregor <dgregor@apple.com> Move code completion for qualified name lookup (foo::) to
LookupVisibleDecls. Also, a function does not hide another function.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93421 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
efcf16d87d7964015e05e917041beef9947c32cd 14-Jan-2010 Douglas Gregor <dgregor@apple.com> Look through using declarations when determining whether one decl hides another

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93378 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
3f477a1a804ead812781168bd354af2adefddde8 12-Jan-2010 Douglas Gregor <dgregor@apple.com> Name lookup should know better than to look into a class before it's defined

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93217 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
277d280c20d4414d61e307789949bef8ee3063fd 11-Jan-2010 Douglas Gregor <dgregor@apple.com> When performing name lookup into a scope, check that its entity is
non-NULL before looking at the entity itself.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93199 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
48026d26fb58e413544874eead5491b1452e2ebf 11-Jan-2010 Douglas Gregor <dgregor@apple.com> Implement name lookup for conversion function template specializations
(C++ [temp.mem]p5-6), which involves template argument deduction based
on the type named, e.g., given

struct X { template<typename T> operator T*(); } x;

when we call

x.operator int*();

we perform template argument deduction to determine that T=int. This
template argument deduction is needed for template specialization and
explicit instantiation, e.g.,

template<> X::operator float*() { /* ... */ }

and when calling or otherwise naming a conversion function (as in the
first example).

This fixes PR5742 and PR5762, although there's some remaining ugliness
that's causing out-of-line definitions of conversion function
templates to fail. I'll look into that separately.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93162 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
539c5c34063066753f27bb0f39fdcde1acc06328 07-Jan-2010 Douglas Gregor <dgregor@apple.com> Fix the search for visible declarations within a Scope to ensure that
we look into a Scope that corresponds to a compound statement whose
scope was combined with the scope of the function that owns it. This
improves typo correction in many common cases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92879 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
1dac3418f43c132df0b836a2f514f82a44189ef9 06-Jan-2010 Ted Kremenek <kremenek@apple.com> Per offline discussion with Doug, don't perform typo correction when we have encountered a fatal error. On some files that are woefully wrong (missing headers) this can cause a 3x slowdown in some cases when parsing the file. It makes sense not to perform typo correction in this case because after a fatal error diagnostics will either be suppressed or not really make any sense.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92809 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
f06cdae9c68dfc4191fbf6b9e5ea0fd748488d88 03-Jan-2010 Douglas Gregor <dgregor@apple.com> Implement typo correction for a variety of Objective-C-specific
constructs:

- Instance variable lookup ("foo->ivar" and, in instance methods, "ivar")
- Property name lookup ("foo.prop")
- Superclasses
- Various places where a class name is required
- Protocol names (e.g., id<proto>)

This seems to cover many of the common places where typos could occur.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92449 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
e3582011a63a78cdfa0917077ed87ccb9b3a87b5 01-Jan-2010 Douglas Gregor <dgregor@apple.com> Make sure that the search for visible declarations looks into the semantic parents of out-of-line function contexts

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92397 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
2dcc01195b7850692b9e25c65f77978e6a5a69a5 31-Dec-2009 Douglas Gregor <dgregor@apple.com> Typo correction for member access into classes/structs/unions, e.g.,

s.fnd("hello")




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92345 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
bb092bafa984e9fa05136b5cef40fd4374dea0f6 31-Dec-2009 Douglas Gregor <dgregor@apple.com> Implement typo correction for id-expressions, e.g.,

typo.cpp:22:10: error: use of undeclared identifier 'radious'; did
you mean 'radius'?
return radious * pi;
^~~~~~~
radius

This was super-easy, since we already had decent recovery by looking
for names in dependent base classes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92341 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
546be3c5c000626c8cdf65e32e8ed9b90c424edd 30-Dec-2009 Douglas Gregor <dgregor@apple.com> Typo correction for type names when they appear in declarations, e.g., given

tring str2;

we produce the following diagnostic + fix-it:

typo.cpp:15:1: error: unknown type name 'tring'; did you mean 'string'?
tring str2;
^~~~~
string


To make this really useful, we'll need to introduce typo correction in
many more places (wherever we do name lookup), and implement
declaration-vs-expression heuristics that cope with typos
better. However, for now this will handle the simple cases where we
already get good "unknown type name" diagnostics.

The LookupVisibleDecls functions are intended to be used by code
completion as well as typo correction; that refactoring will happen
later.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92308 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
bd64729ac6de8fed320e7a722597cc5444709c63 29-Dec-2009 Chandler Carruth <chandlerc@gmail.com> Handle using declarations in overloaded and template functions during ADL and
address resolution. This fixes PR5751.

Also, while we're here, remove logic from ADL which mistakenly included the
definition namespaces of overloaded and/or templated functions whose name or
address is used as an argument.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92245 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
4e0d81f7088276ecf0c76824a28a9469482b067b 18-Dec-2009 John McCall <rjmccall@apple.com> Look through using decls when checking whether a name is an acceptable
nested-name specifier name.

I accidentally checked in the test case for this in the last commit ---
fortunately, that refactor was inspired by having debugged this problem already,
so I can fix the bug quick (though probably not fast enough for the buildbots).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91677 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
1d7c52803e49d651a66cee782e264f62078c1da5 18-Dec-2009 John McCall <rjmccall@apple.com> Pull Sema::isAcceptableLookupResult into SemaLookup. Extract the criteria into
different functions and pick the function at lookup initialization time.
In theory we could actually divide the criteria functions into N different
functions for the N cases, but it's so not worth it.

Among other things, lets us invoke LookupQualifiedName without recomputing
IDNS info every time.

Do some refactoring in SemaDecl to avoid an awkward special case in LQN
that was only necessary for redeclaration testing for anonymous structs/unions ---
which could be done more efficiently with a scoped lookup anyway.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91676 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
9f61aa9e280adea9fbf3365f0e4f6ed568c9885a 12-Dec-2009 Jeffrey Yasskin <jyasskin@google.com> Un-namespace-qualify llvm_unreachable. It's a macro, so the qualification gave
no extra safety anyway.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91207 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
737061fc2948776f941e1854a9bc6ebd070d9151 11-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to fix a crash trying to access a category name in
objective-c++ mode and also removed dead-code in this area.
(fixes radar 7456710).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91081 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
9f54ad4381370c6b771424b53d219e661d6d6706 10-Dec-2009 John McCall <rjmccall@apple.com> Implement redeclaration checking and hiding semantics for using declarations. There
are a couple of O(n^2) operations in this, some analogous to the usual O(n^2)
redeclaration problem and some not. In particular, retroactively removing
shadow declarations when they're hidden by later decls is pretty unfortunate.
I'm not yet convinced it's worse than the alternative, though.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91045 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
1237259bda343504cc0bd3cfe2198bdeea2b2fdf 08-Dec-2009 Douglas Gregor <dgregor@apple.com> When performing unqualified name lookup in C++, don't look directly
into transparent contexts; instead, we'll look into their nearest
enclosing non-transparent contexts further up the stack. Fixes PR5479.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90859 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
fda8e12774921e3cac3ebcba1148bcf4479ddd7a 03-Dec-2009 John McCall <rjmccall@apple.com> Stop stripping UnresolvedUsingDecls out of LookupResults that have other
results in them (which we were doing intentionally as a stopgap). Fix
an DeclContext lookup-table ordering problem which was causing UsingDecls to
show up incorrectly when looking for ordinary results. And oh hey
Clang-Code-Syntax passes now.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90367 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
1bcee0a5a29981f8c78a8620d1c78841dbc5c348 02-Dec-2009 John McCall <rjmccall@apple.com> Rip out the last remaining implicit use of OverloadedFunctionDecl in Sema:
LookupResult::getAsSingleDecl() is no more. Shift Sema::LookupSingleName to
return null on overloaded results.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90309 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
f7a1a744eba4b29ceb0f20af8f34515d892fdd64 24-Nov-2009 John McCall <rjmccall@apple.com> Rip out TemplateIdRefExpr and make UnresolvedLookupExpr and
DependentScopeDeclRefExpr support storing templateids. Unite the common
code paths between ActOnDeclarationNameExpr and ActOnTemplateIdExpr.

This gets us to a point where we don't need to store function templates in
the AST using TemplateNames, which is critical to ripping out OverloadedFunction.

Also resolves a few FIXMEs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89785 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
7453ed4cb2cab113de3378df371b1c6f1243d832 22-Nov-2009 John McCall <rjmccall@apple.com> Consider a FunctionTemplate to be an overload all on its lonesome. Track
this information through lookup rather than rederiving it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89570 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
ba13543329afac4a0d01304ec2ec4924d99306a6 21-Nov-2009 John McCall <rjmccall@apple.com> "Incremental" progress on using expressions, by which I mean totally ripping
into pretty much everything about overload resolution in order to wean
BuildDeclarationNameExpr off LookupResult::getAsSingleDecl(). Replace
UnresolvedFunctionNameExpr with UnresolvedLookupExpr, which generalizes the
idea of a non-member lookup that we haven't totally resolved yet, whether by
overloading, argument-dependent lookup, or (eventually) the presence of
a function template in the lookup results.

Incidentally fixes a problem with argument-dependent lookup where we were
still performing ADL even when the lookup results contained something from
a block scope.

Incidentally improves a diagnostic when using an ObjC ivar from a class method.
This just fell out from rewriting BuildDeclarationNameExpr's interaction with
lookup, and I'm too apathetic to break it out.

The only remaining uses of OverloadedFunctionDecl that I know of are in
TemplateName and MemberExpr.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89544 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
6826314938f8510cd1a6b03b5d032592456ae27b 18-Nov-2009 John McCall <rjmccall@apple.com> Overhaul previous-declaration and overload checking to work on lookup results
rather than NamedDecl*. This is a major step towards eliminating
OverloadedFunctionDecl.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89263 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
7d384dd5ace9ae9a22a69e700d2cacb256bc6c69 18-Nov-2009 John McCall <rjmccall@apple.com> Split LookupResult into its own header.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89199 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
7ba107a1863ddfa1664555854f0d7bdb3c491c92 18-Nov-2009 John McCall <rjmccall@apple.com> Incremental progress on using declarations. Split UnresolvedUsingDecl into
two classes, one for typenames and one for values; this seems to have some
support from Doug if not necessarily from the extremely-vague-on-this-point
standard. Track the location of the 'typename' keyword in a using-typename
decl. Make a new lookup result for unresolved values and deal with it in
most places.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89184 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
5b47faf3543ac4435297e37877372d34d440a9fd 17-Nov-2009 John McCall <rjmccall@apple.com> Temporarily unbreak the clang-on-llvm tests. :) Not going to fix unresolved
lookup all in a night.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89089 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
314be4e7d8ef86202b0ec8e9ff0dcef853db3320 17-Nov-2009 John McCall <rjmccall@apple.com> Store "sugared" decls in LookupResults (i.e. decl aliases like using declarations);
strip the sugar off in getFoundDecl() and getAsSingleDecl(), but leave it on for
clients like overload resolution who want to use the iterators.

Refactor a few pieces of overload resolution to strip off using declarations in
a single place. Don't do anything useful with the extra context knowledge yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89061 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
9488ea120e093068021f944176c3d610dd540914 17-Nov-2009 John McCall <rjmccall@apple.com> Instead of hanging a using declaration's target decls directly off the using
decl, create shadow declarations and put them in scope like normal.
Work in progress.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89048 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
a24dc2e38c7fb0f7f138b3d14b5f0f241fd0eccf 17-Nov-2009 John McCall <rjmccall@apple.com> Carry lookup configuration throughout lookup on the LookupResult. Give
LookupResult RAII powers to diagnose ambiguity in the results. Other diagnostics
(e.g. access control and deprecation) will be moved to automatically trigger
during lookup as part of this same mechanism.

This abstraction makes it much easier to encapsulate aliasing declarations
(e.g. using declarations) inside the lookup system: eventually, lookup will
just produce the aliases in the LookupResult, and the standard access methods
will naturally strip the aliases off.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89027 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
a4923eb7c4b04d360cb2747641a5e92818edf804 16-Nov-2009 Douglas Gregor <dgregor@apple.com> First part of changes to eliminate problems with cv-qualifiers and
sugared types. The basic problem is that our qualifier accessors
(getQualifiers, getCVRQualifiers, isConstQualified, etc.) only look at
the current QualType and not at any qualifiers that come from sugared
types, meaning that we won't see these qualifiers through, e.g.,
typedefs:

typedef const int CInt;
typedef CInt Self;

Self.isConstQualified() currently returns false!

Various bugs (e.g., PR5383) have cropped up all over the front end due
to such problems. I'm addressing this problem by splitting each
qualifier accessor into two versions:

- the "local" version only returns qualifiers on this particular
QualType instance
- the "normal" version that will eventually combine qualifiers from this
QualType instance with the qualifiers on the canonical type to
produce the full set of qualifiers.

This commit adds the local versions and switches a few callers from
the "normal" version (e.g., isConstQualified) over to the "local"
version (e.g., isLocalConstQualified) when that is the right thing to
do, e.g., because we're printing or serializing the qualifiers. Also,
switch a bunch of

Context.getCanonicalType(T1).getUnqualifiedType() == Context.getCanonicalType(T2).getQualifiedType()

expressions over to

Context.hasSameUnqualifiedType(T1, T2)




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88969 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
788cd06cf8e868a67158aafec5de3a1f408d14f3 11-Nov-2009 Douglas Gregor <dgregor@apple.com> Introduce a new representation for template template
parameters. Rather than storing them as either declarations (for the
non-dependent case) or expressions (for the dependent case), we now
(always) store them as TemplateNames.

The primary change here is to add a new kind of TemplateArgument,
which stores a TemplateName. However, making that change ripples to
every switch on a TemplateArgument's kind, also affecting
TemplateArgumentLocInfo/TemplateArgumentLoc, default template
arguments for template template parameters, type-checking of template
template arguments, etc.

This change is light on testing. It should fix several pre-existing
problems with template template parameters, such as:
- the inability to use dependent template names as template template
arguments
- template template parameter default arguments cannot be
instantiation

However, there are enough pieces missing that more implementation is
required before we can adequately test template template parameters.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86777 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
f7f3d0db754db0500b56d49ac19f795f13965912 11-Nov-2009 John McCall <rjmccall@apple.com> Create a new Scope when parsing a declaration with a C++ scope specifier.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86764 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
d9f01d47dbede88fe557c8955ba2a855be859bc9 10-Nov-2009 John McCall <rjmccall@apple.com> Fix a similar problem with qualified lookup through using directives,
although in this case we probably just run a risk of duplicating work;
I can't think of how this could cause a bug.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86680 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
12ea5780e7729de3fee009525e49468fd8d0b713 10-Nov-2009 John McCall <rjmccall@apple.com> Make a somewhat more convincing test case for unqualified lookup through
using directives, and fix a bug thereby exposed: since we're playing
tricks with pointers, we need to make certain we're always using the same
pointers for things.
Also tweak an existing error message.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86679 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
d7be78a0524251c30329359c9d92485c6d7ac424 10-Nov-2009 John McCall <rjmccall@apple.com> Fix unqualified lookup through using directives.

This is a pretty minimal test case; I'll make a better one later.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86669 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
bbc1cc5757d0ef068bef583ee4eda108dece806c 25-Oct-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Ignore dependent bases in ADL. Fixes PR5271.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85054 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
644be853b87cae94fcabaf309a5e482a8c291fb9 23-Oct-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Apply the special enum restrictions from [over.match.oper]p3b2 in argument-dependent lookup too. This fixes PR5244.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84963 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
6e24726524c2b51b31bb4b622aa678a46b024f42 10-Oct-2009 John McCall <rjmccall@apple.com> Qualified lookup through using declarations. Diagnose a new type of ambiguity.
Split the various ambiguous result enumerators into their own enum. Tests
for most of C++ [namespace.qual].



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83700 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
3135df59cbe140923d9e81c09e3e324c01418bb6 10-Oct-2009 Douglas Gregor <dgregor@apple.com> Dead Code Elimination

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83686 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
f36e02d4aff98bf2e52e342e0038d4172fbb5e64 09-Oct-2009 John McCall <rjmccall@apple.com> Refactor the LookupResult API to simplify most common operations. Require users to
pass a LookupResult reference to lookup routines. Call out uses which assume a single
result.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83674 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
71fdaf4c5e33bed9b9133a5c3bbdbd930a702a6c 08-Oct-2009 John McCall <rjmccall@apple.com> Dead code elimination.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83492 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
a8f32e0965ee19ecc53cd796e34268377a20357c 06-Oct-2009 Douglas Gregor <dgregor@apple.com> Refactor the code that walks a C++ inheritance hierarchy, searching
for bases, members, overridden virtual methods, etc. The operations
isDerivedFrom and lookupInBases are now provided by CXXRecordDecl,
rather than by Sema, so that CodeGen and other clients can use them
directly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83396 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
183700f494ec9b6701b6efe82bcb25f4c79ba561 22-Sep-2009 John McCall <rjmccall@apple.com> Change all the Type::getAsFoo() methods to specializations of Type::getAs().
Several of the existing methods were identical to their respective
specializations, and so have been removed entirely. Several more 'leaf'
optimizations were introduced.

The getAsFoo() methods which imposed extra conditions, like
getAsObjCInterfacePointerType(), have been left in place.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82501 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
4719f4e86a84dec6f5a45771ae51d4ec72e4617a 12-Sep-2009 Douglas Gregor <dgregor@apple.com> When performing name lookup within a class template or class template
partial specialization, make sure we look into non-dependent base
classes (but not dependent base classes). Fixes PR4951.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81584 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
e942bbe02b6fb332d1f13d38c6e1980b416cf89a 10-Sep-2009 Douglas Gregor <dgregor@apple.com> When performing unqualified name lookup into a DeclContext, also look into
all of the parent DeclContexts that aren't represented within the
Scope chain. This fixes some name-lookup problems in out-of-line
definitions of members of nested classes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81451 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
1eb4433ac451dc16f4133a88af2d002ac26c58ef 09-Sep-2009 Mike Stump <mrs@apple.com> Remove tabs, and whitespace cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
2dd078ae50ff7be1fb25ebeedde45e9ab691a4f0 03-Sep-2009 Douglas Gregor <dgregor@apple.com> Rewrite of our handling of name lookup in C++ member access expressions, e.g.,

x->Base::f

We no longer try to "enter" the context of the type that "x" points
to. Instead, we drag that object type through the parser and pass it
into the Sema routines that need to know how to perform lookup within
member access expressions.

We now implement most of the crazy name lookup rules in C++
[basic.lookup.classref] for non-templated code, including performing
lookup both in the context of the type referred to by the member
access and in the scope of the member access itself and then detecting
ambiguities when the two lookups collide (p1 and p4; p3 and p7 are
still TODO). This change also corrects our handling of name lookup
within template arguments of template-ids inside the
nested-name-specifier (p6; we used to look into the scope of the
object expression for them) and fixes PR4703.

I have disabled some tests that involve member access expressions
where the object expression has dependent type, because we don't yet
have the ability to describe dependent nested-name-specifiers starting
with an identifier.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80843 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
02cace78cf48cc26686bd5b07c78606abca13bcd 28-Aug-2009 John McCall <rjmccall@apple.com> Omnibus friend decl refactoring. Instead of cloning AST classes for friend
declarations of same, introduce a single AST class and add appropriate bits
(encoded in the namespace) for whether a decl is "real" or not. Much hackery
about previously-declared / not-previously-declared, but it's essentially
mandated by the standard that friends alter lookup, and this is at least
fairly non-intrusive.

Refactor the Sema methods specific to friends for cleaner flow and less nesting.

Incidentally solve a few bugs, but I remain confident that we can put them back.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80353 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
495c35d291da48c4f5655bbb54d15128ddde0d4d 26-Aug-2009 Douglas Gregor <dgregor@apple.com> Improve support for out-of-line definitions of nested templates and
their members, including member class template, member function
templates, and member classes and functions of member templates.

To actually parse the nested-name-specifiers that qualify the name of
an out-of-line definition of a member template, e.g.,

template<typename X> template<typename Y>
X Outer<X>::Inner1<Y>::foo(Y) {
return X();
}

we need to look for the template names (e.g., "Inner1") as a member of
the current instantiation (Outer<X>), even before we have entered the
scope of the current instantiation. Since we can't do this in general
(i.e., we should not be looking into all dependent
nested-name-specifiers as if they were the current instantiation), we
rely on the parser to tell us when it is parsing a declaration
specifier sequence, and, therefore, when we should consider the
current scope specifier to be a current instantiation.

Printing of complicated, dependent nested-name-specifiers may be
somewhat broken by this commit; I'll add tests for this issue and fix
the problem (if it still exists) in a subsequent commit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80044 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
a24eb4ef63d5860a5a02f7532e56e84283782984 24-Aug-2009 Douglas Gregor <dgregor@apple.com> Skip transparent contexts when performing C++ name lookup

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79931 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
3f9a8a60614b763785d54ad08821745d03a4af70 11-Aug-2009 John McCall <rjmccall@apple.com> Argument-dependent lookup for friend declarations. Add a new decl type,
FriendFunctionDecl, and create instances as appropriate.

The design of FriendFunctionDecl is still somewhat up in the air; you can
befriend arbitrary types of functions --- methods, constructors, etc. ---
and it's not clear that this representation captures that very well.
We'll have a better picture when we start consuming this data in access
control.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78653 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
6ff0785f1e58fb2cfb702d2995d076c6648a9a13 08-Aug-2009 John McCall <rjmccall@apple.com> Just add global scope to the associated namespaces set instead of tracking it
separately. Add the framework (currently unfed) for finding friend declarations
during argument-dependent lookup.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78414 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
67d1a67f3db2f1aa69083c5c94164d6e0ee05b32 06-Aug-2009 John McCall <rjmccall@apple.com> First pass at friend semantics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78274 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
33a3138a0862cafdd9ff1332b834454a79cd2cdc 05-Aug-2009 Eli Friedman <eli.friedman@gmail.com> Get rid of "smart" quotes. Per report on cfe-dev.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78230 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
6217b80b7a1379b74cced1c076338262c3c980b3 29-Jul-2009 Ted Kremenek <kremenek@apple.com> Change uses of:
Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
Type::getAsRecordType() -> Type::getAs<RecordType>()
Type::getAsPointerType() -> Type::getAs<PointerType>()
Type::getAsBlockPointerType() -> Type::getAs<BlockPointerType>()
Type::getAsLValueReferenceType() -> Type::getAs<LValueReferenceType>()
Type::getAsRValueReferenceType() -> Type::getAs<RValueReferenceType>()
Type::getAsMemberPointerType() -> Type::getAs<MemberPointerType>()
Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
Type::getAsTagType() -> Type::getAs<TagType>()

And remove Type::getAsReferenceType(), etc.

This change is similar to one I made a couple weeks ago, but that was partly
reverted pending some additional design discussion. With Doug's pending smart
pointer changes for Types, it seemed natural to take this approach.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77510 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
d99cbe66403ee39c2ee58024b9582b95649a4fc5 29-Jul-2009 Douglas Gregor <dgregor@apple.com> [llvm up]

A template name can refer to a set of overloaded function
templates. Model this in TemplateName, which can now refer to an
OverloadedFunctionDecl that contains function templates. This removes
an unspeakable hack in Sema::isTemplateName.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77488 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
87018775ed689d0a67357cf767747166044b3a27 21-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove Sema::LookupObjCImplementation and replace it with just calling ObjCInterfaceDecl::getImplementation().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76509 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
97fbaa2a38804268a024f1a104b43fcf8b4411b0 18-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove ASTContext::getCanonicalDecl() and use Decl::getCanonicalDecl in its place.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76274 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
35366a67baa970c287c714c957cf78a4131cf60d 17-Jul-2009 Ted Kremenek <kremenek@apple.com> Per offline discussion with Steve Naroff, add back Type::getAsXXXType() methods
until Doug Gregor's Type smart pointer code lands (or more discussion occurs).
These methods just call the new Type::getAs<XXX> methods, so we still have
reduced implementation redundancy. Having explicit getAsXXXType() methods makes
it easier to set breakpoints in the debugger.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76193 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
5cad1f74469d4d8b4fc51fe53a7837778aeb6107 17-Jul-2009 Ted Kremenek <kremenek@apple.com> Replaced Type::getAsLValueReferenceType(), Type::getAsRValueReferenceType(), Type::getAsMemberPointerType(), Type::getAsTagType(), and Type::getAsRecordType() with their Type::getAs<XXX> equivalents.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76139 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
1a1a6e2bd4c5aefd7fd643cf25915f9623a02e59 16-Jul-2009 Ted Kremenek <kremenek@apple.com> Add member template 'Type::getAs<T>', which converts a Type* to a respective T*.
This method is intended to eventually replace the individual
Type::getAsXXXType<> methods.

The motivation behind this change is twofold:

1) Reduce redundant implementations of Type::getAsXXXType() methods. Most of
them are basically copy-and-paste.

2) By centralizing the implementation of the getAs<Type> logic we can more
smoothly move over to Doug Gregor's proposed canonical type smart pointer
scheme.

Along with this patch:

a) Removed 'Type::getAsPointerType()'; now clients use getAs<PointerType>.
b) Removed 'Type::getAsBlockPointerTypE()'; now clients use getAs<BlockPointerType>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76098 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
daa439a6c47d3299157b94a496bf22389bbc77a3 08-Jul-2009 Douglas Gregor <dgregor@apple.com> Fix a corner case with argument-dependent lookup and overloaded function sets.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74999 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
69be8d60ded8bbfbd30facf0590c97920a074f46 08-Jul-2009 Douglas Gregor <dgregor@apple.com> Improve argument-dependent lookup to find associated classes and
namespaces based on the template arguments of a class template
specialization type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74993 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
17945a0f64fe03ff6ec0c2146005a87636e3ac12 30-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> De-ASTContext-ify DeclContext.

Remove ASTContext parameter from DeclContext's methods. This change cascaded down to other Decl's methods and changes to call sites started "escalating".
Timings using pre-tokenized "cocoa.h" showed only a ~1% increase in time run between and after this commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74506 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
40b598eea1310ec9ed554d56ce3e25b34c585458 30-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove the ASTContext parameter from the attribute-related methods of Decl.
The implementations of these methods can Use Decl::getASTContext() to get the ASTContext.

This commit touches a lot of files since call sites for these methods are everywhere.
I used pre-tokenized "carbon.h" and "cocoa.h" headers to do some timings, and there was no real time difference between before the commit and after it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74501 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
364e021e8cbbeebd4d2544053268a008cf9ee5a9 27-Jun-2009 Douglas Gregor <dgregor@apple.com> Improve support for overloaded operator templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74390 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
e136e0e1b74760d7ec3ede38e0e739d5c52a3c0a 26-Jun-2009 Anders Carlsson <andersca@mac.com> Add NamedDecl::getUnderlyingDecl that can see through UsingDecl and ObjCCompatibleAliasDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74279 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
58badb7a655d021fc67bb7ed0af95d6ea0c63eb1 26-Jun-2009 Anders Carlsson <andersca@mac.com> See through UsingDecls in more places.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74269 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
5e50569d45d7c8545fecd17685a3a613b1cb0158 26-Jun-2009 Anders Carlsson <andersca@mac.com> Fix failing test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74268 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
bc13ab2bc75bd997a2a40e371f50a4c456d8ee69 26-Jun-2009 Anders Carlsson <andersca@mac.com> Fix another assert related to using decls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74262 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
8b50d01949c649fbe89ea83f76e5f445170c7d26 26-Jun-2009 Anders Carlsson <andersca@mac.com> When creating LookupResults, see through UsingDecls. Fixes PR4450.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74258 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
e53060fa78ad7e98352049f72787bdb7543e2a48 26-Jun-2009 Douglas Gregor <dgregor@apple.com> Improved semantic analysis and AST respresentation for function
templates.

For example, this now type-checks (but does not instantiate the body
of deref<int>):

template<typename T> T& deref(T* t) { return *t; }

void test(int *ip) {
int &ir = deref(ip);
}

Specific changes/additions:
* Template argument deduction from a call to a function template.
* Instantiation of a function template specializations (just the
declarations) from the template arguments deduced from a call.
* FunctionTemplateDecls are stored directly in declaration contexts
and found via name lookup (all forms), rather than finding the
FunctionDecl and then realizing it is a template. This is
responsible for most of the churn, since some of the core
declaration matching and lookup code assumes that all functions are
FunctionDecls.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74213 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
44bc2d53ebf1b7ad7439a0f73aba3d00a462d63a 23-Jun-2009 Douglas Gregor <dgregor@apple.com> Make sure that argument-dependent lookup looks into the global scope
when it should.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73992 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
9cfbe48a7a20a217fdb2920b29b67ae7941cb116 20-Jun-2009 Douglas Gregor <dgregor@apple.com> Parsing and AST support for using declarations, from John Thompson!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73812 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
68584ed35ad819a1668e3f527ba7f5dd4ae6a333 18-Jun-2009 Douglas Gregor <dgregor@apple.com> Move the static DeclAttrs map into ASTContext. Fixes <rdar://problem/6983177>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73702 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
c19ee3eb08ce1d77504d5fc27f7c44b94543221b 18-Jun-2009 Douglas Gregor <dgregor@apple.com> Diagnose class members that shadow a template parameter. Fixes
<rdar://problem/6952203>.

To do this, we actually remove a not-quite-correct optimization in the
C++ name lookup routines. We'll revisit this optimization for the
general case once more C++ is working.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73659 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
1b63e4f732dbc73d90abf886b4d21f8e3a165f6d 14-Jun-2009 Chris Lattner <sabre@nondot.org> Sink the BuiltinInfo object from ASTContext into the
preprocessor and initialize it early in clang-cc. This
ensures that __has_builtin works in all modes, not just
when ASTContext is around.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73319 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
2bba76b0ec4c2f2134eebb1a2bbfe102f36c2f6e 27-May-2009 Douglas Gregor <dgregor@apple.com> Improve name lookup for and template instantiation of declaration
references. There are several smallish fixes here:

- Make sure we look through template parameter scope when
determining whether we're parsing a nested class (or nested class
*template*). This makes sure that we delay parsing the bodies of
inline member functions until after we're out of the outermost
class (template) scope.
- Since the bodies of member functions are always parsed
"out-of-line", even when they were declared in-line, teach
unqualified name lookup to look into the (semantic) parents.
- Use the new InstantiateDeclRef to handle the instantiation of a
reference to a declaration (in DeclRefExpr), which drastically
simplifies template instantiation for DeclRefExprs.
- When we're instantiating a ParmVarDecl, it must be in the current
instantiation scope, so only look there.

Also, remove the #if 0's and FIXME's from the dynarray example, which
now compiles and executes thanks to Anders and Eli.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72481 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
b738e08cad7c9362e82a1384cf81fdce07d1b6ba 19-May-2009 Douglas Gregor <dgregor@apple.com> Fix sorting of using directives, from Jay Foad

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72048 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
390b4cc8b45a05612349269ef08faab3e4688f06 16-May-2009 Mike Stump <mrs@apple.com> Reflow some comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71936 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
42af25f865a82022a04bedeb483ac251c4412e29 11-May-2009 Douglas Gregor <dgregor@apple.com> Implement the notions of the "current instantiation" and "unknown
specialization" within a C++ template, and permit name lookup into the
current instantiation. For example, given:

template<typename T, typename U>
struct X {
typedef T type;

X* x1; // current instantiation
X<T, U> *x2; // current instantiation
X<U, T> *x3; // not current instantiation
::X<type, U> *x4; // current instantiation
X<typename X<type, U>::type, U>: *x5; // current instantiation
};



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71471 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
516ff43cc4e20b637335d3dfa5b197ca8faa09cb 24-Apr-2009 Douglas Gregor <dgregor@apple.com> Eliminate Sema::ObjCAliasDecls. This is based on Steve's fix, but also
updates name lookup so that we see through @compatibility_alias
declarations to their underlying interfaces.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69950 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
8b9fb3082bc54cf7ffe6c3772500a73388f53072 24-Apr-2009 Douglas Gregor <dgregor@apple.com> Eliminate Sema::ObjCInterfaceDecls


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69942 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
8fc463adf0116fdcbff86e9cca11955aad1649fe 24-Apr-2009 Douglas Gregor <dgregor@apple.com> Eliminate Sema::ObjCImplementations, relying instead on name lookup. What's good for uniformity is good for PCH (or is it the other way around?).

As part of this, make ObjCImplDecl inherit from NamedDecl (since
ObjCImplementationDecls now need to have names so that they can be
found). This brings ObjCImplDecl very, very close to
ObjCContainerDecl; we may be able to merge them soon.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69941 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
6e378de1aebdfeb44f2a7677ed207b32b3a41fbf 24-Apr-2009 Douglas Gregor <dgregor@apple.com> Eliminate Sema::ObjCProtocols. Instead, we place ObjCProtocolDecls in
their own namespace (IDNS_Protocol) and use the normal name-lookup
routines to find them. Aside from the simplification this provides
(one less DenseMap!), it means that protocols will be lazily
deserialized from PCH files.

Make the code size of the selector table block match the code size of
the type and decl blocks.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69939 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
668c1a4fdcc56bdd050256b1688e116fe84b72db 22-Apr-2009 Douglas Gregor <dgregor@apple.com> Lazy deserialization of the declaration chains associated with
identifiers from a precompiled header.

This patch changes the primary name lookup method for entities within
a precompiled header. Previously, we would load all of the names of
declarations at translation unit scope into a large DenseMap (inside
the TranslationUnitDecl's DeclContext), and then perform a special
"last resort" lookup into this DeclContext when we knew there was a
PCH file (see Sema::LookupName). Now, when we see an identifier named
for the first time, we load all of the declarations with that name
that are visible from the translation unit into the IdentifierInfo's
chain of declarations. Thus, the explicit "look into the translation
unit's DeclContext" code is gone, and Sema effectively uses the same
IdentifierInfo-based name lookup mechanism whether we are using a PCH
file or not.

This approach should help PCH scale with the size of the input program
rather than the size of the PCH file. The "Hello, World!" application
with Carbon.h as a PCH file now loads 20% of the identifiers in the
PCH file rather than 85% of the identifiers.

90% of the 20% of identifiers loaded are actually loaded when we
deserialize the preprocessor state. The next step is to make the
preprocessor load macros lazily, which should drastically reduce the
number of types, declarations, and identifiers loaded for "Hello,
World".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69737 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
2cf2634ffdb4f7c8d46cef3f8e60a55993f1c57a 10-Apr-2009 Douglas Gregor <dgregor@apple.com> Implementation of pre-compiled headers (PCH) based on lazy
de-serialization of abstract syntax trees.

PCH support serializes the contents of the abstract syntax tree (AST)
to a bitstream. When the PCH file is read, declarations are serialized
as-needed. For example, a declaration of a variable "x" will be
deserialized only when its VarDecl can be found by a client, e.g.,
based on name lookup for "x" or traversing the entire contents of the
owner of "x".

This commit provides the framework for serialization and (lazy)
deserialization, along with support for variable and typedef
declarations (along with several kinds of types). More
declarations/types, along with important auxiliary structures (source
manager, preprocessor, etc.), will follow.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68732 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
6ab3524f72a6e64aa04973fa9433b5559abb3525 09-Apr-2009 Douglas Gregor <dgregor@apple.com> Propagate the ASTContext to various AST traversal and lookup functions.
No functionality change (really).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68726 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
31a19b6989bbf326d2de5ae12e712e2a65ca9c34 01-Apr-2009 Douglas Gregor <dgregor@apple.com> Make parsing a semantic analysis a little more robust following Sema
failures that involve malformed types, e.g., "typename X::foo" where
"foo" isn't a type, or "std::vector<void>" that doens't instantiate
properly.

Similarly, be a bit smarter in our handling of ambiguities that occur
in Sema::getTypeName, to eliminate duplicate error messages about
ambiguous name lookup.

This eliminates two XFAILs in test/SemaCXX, one of which was crying
out to us, trying to tell us that we were producing repeated error
messages.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68251 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
b28317a8e5e0e2953d1e5406d753d6c3c7f1e7d2 28-Mar-2009 Chris Lattner <sabre@nondot.org> Introduce a new OpaquePtr<N> struct type, which is a simple POD wrapper for a
pointer. Its purpose in life is to be a glorified void*, but which does not
implicitly convert to void* or other OpaquePtr's with a different UID.

Introduce Action::DeclPtrTy which is a typedef for OpaquePtr<0>. Change the
entire parser/sema interface to use DeclPtrTy instead of DeclTy*. This
makes the C++ compiler enforce that these aren't convertible to other opaque
types.

We should also convert ExprTy, StmtTy, TypeTy, AttrTy, BaseTy, etc,
but I don't plan to do that in the short term.

The one outstanding known problem with this patch is that we lose the
bitmangling optimization where ActionResult<DeclPtrTy> doesn't know how to
bitmangle the success bit into the low bit of DeclPtrTy. I will rectify
this with a subsequent patch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67952 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
551f48c2d96c8a519feb195d34a691c8b97b3994 27-Mar-2009 Douglas Gregor <dgregor@apple.com> Tests and fixes for templates declared within (non-template)
classes. Test case from Anders Carlsson, fix from Piotr Rak!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67817 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
e4e5b054b4917f0ee493bb2fda5b1ec749bfb9a1 19-Mar-2009 Douglas Gregor <dgregor@apple.com> Introduce a representation for types that we referred to via a
qualified name, e.g.,

foo::x

so that we retain the nested-name-specifier as written in the source
code and can reproduce that qualified name when printing the types
back (e.g., in diagnostics). This is PR3493, which won't be complete
until finished the other tasks mentioned near the end of this commit.

The parser's representation of nested-name-specifiers, CXXScopeSpec,
is now a bit fatter, because it needs to contain the scopes that
precede each '::' and keep track of whether the global scoping
operator '::' was at the beginning. For example, we need to keep track
of the leading '::', 'foo', and 'bar' in

::foo::bar::x

The Action's CXXScopeTy * is no longer a DeclContext *. It's now the
opaque version of the new NestedNameSpecifier, which contains a single
component of a nested-name-specifier (either a DeclContext * or a Type
*, bitmangled).

The new sugar type QualifiedNameType composes a sequence of
NestedNameSpecifiers with a representation of the type we're actually
referring to. At present, we only build QualifiedNameType nodes within
Sema::getTypeName. This will be extended to other type-constructing
actions (e.g., ActOnClassTemplateId).

Also on the way: QualifiedDeclRefExprs will also store a sequence of
NestedNameSpecifiers, so that we can print out the property
nested-name-specifier. I expect to also use this for handling
dependent names like Fibonacci<I - 1>::value.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67265 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
ca5e77fefc4ac06aa787d7e777957ba6b7a03c60 18-Mar-2009 Douglas Gregor <dgregor@apple.com> The scope representation can now be either a DeclContext pointer or a
Type pointer. This allows our nested-name-specifiers to retain more
information about the actual spelling (e.g., which typedef did the
user name, or what exact template arguments were used in the
template-id?). It will also allow us to have dependent
nested-name-specifiers that don't map to any DeclContext.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67140 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
ba49817c5b9f502602672861cf369fd0e53966e8 13-Mar-2009 Douglas Gregor <dgregor@apple.com> Implement template instantiation for several more kinds of expressions:
- C++ function casts, e.g., T(foo)
- sizeof(), alignof()

More importantly, this allows us to verify that we're performing
overload resolution during template instantiation, with
argument-dependent lookup and the "cached" results of name lookup from
the template definition.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66947 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
3fd95ce225393fe4a3623e429766a8c3f487ff9d 13-Mar-2009 Douglas Gregor <dgregor@apple.com> Improve the representation of operator expressions like "x + y" within
C++ templates. In particular, keep track of the overloaded operators
that are visible from the template definition, so that they can be
merged with those operators visible via argument-dependent lookup at
instantiation time.

Refactored the lookup routines for argument-dependent lookup and for
operator name lookup, so they can be called without immediately adding
the results to an overload set.

Instantiation of these expressions is completely wrong. I'll work on
that next.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66851 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
4fdf1faedbca40787fd277a6fbd5061fd69b2708 11-Mar-2009 Douglas Gregor <dgregor@apple.com> Add basic, hackish support for instantiation of typedefs in a class
template. More importantly, start to sort out the issues regarding
complete types and nested-name-specifiers, especially the question of:
when do we instantiate a class template specialization that occurs to
the left of a '::' in a nested-name-specifier?




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66662 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
c1efaecf0373f1a55c5ef4c234357cf726fc0600 28-Feb-2009 Douglas Gregor <dgregor@apple.com> Eliminate CXXRecordType

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65671 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
72564e73277e29f6db3305d1f27ba408abb7ed88 27-Feb-2009 Douglas Gregor <dgregor@apple.com> Create a new TypeNodes.def file that enumerates all of the types,
giving them rough classifications (normal types, never-canonical
types, always-dependent types, abstract type representations) and
making it far easier to make sure that we've hit all of the cases when
decoding types.

Switched some switch() statements on the type class over to using this
mechanism, and filtering out those things we don't care about. For
example, CodeGen should never see always-dependent or non-canonical
types, while debug info generation should never see always-dependent
types. More switch() statements on the type class need to be moved
over to using this approach, so that we'll get warnings when we add a
new type then fail to account for it somewhere in the compiler.

As part of this, some types have been renamed:

TypeOfExpr -> TypeOfExprType
FunctionTypeProto -> FunctionProtoType
FunctionTypeNoProto -> FunctionNoProtoType

There shouldn't be any functionality change...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65591 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
d6f7e9dccd0fa8a5a15d7478324c0ae229fc5e1e 24-Feb-2009 Douglas Gregor <dgregor@apple.com> When we're declaring an object or function with linkage, teach name
lookup to skip over names without linkage. This finishes
<rdar://problem/6127293>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65386 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
3e41d60eb627dc227c770f1c1c87d06909cf05fd 14-Feb-2009 Douglas Gregor <dgregor@apple.com> Implicitly declare certain C library functions (malloc, strcpy, memmove,
etc.) when we perform name lookup on them. This ensures that we
produce the correct signature for these functions, which has two
practical impacts:

1) When we're supporting the "implicit function declaration" feature
of C99, these functions will be implicitly declared with the right
signature rather than as a function returning "int" with no
prototype. See PR3541 for the reason why this is important (hint:
GCC always predeclares these functions).

2) If users attempt to redeclare one of these library functions with
an incompatible signature, we produce a hard error.

This patch does a little bit of work to give reasonable error
messages. For example, when we hit case #1 we complain that we're
implicitly declaring this function with a specific signature, and then
we give a note that asks the user to include the appropriate header
(e.g., "please include <stdlib.h> or explicitly declare 'malloc'"). In
case #2, we show the type of the implicit builtin that was incorrectly
declared, so the user can see the problem. We could do better here:
for example, when displaying this latter error message we say
something like:

'strcpy' was implicitly declared here with type 'char *(char *, char
const *)'

but we should really print out a fake code line showing the
declaration, like this:

'strcpy' was implicitly declared here as:

char *strcpy(char *, char const *)

This would also be good for printing built-in candidates with C++
operator overloading.

The set of C library functions supported by this patch includes all
functions from the C99 specification's <stdlib.h> and <string.h> that
(a) are predefined by GCC and (b) have signatures that could cause
codegen issues if they are treated as functions with no prototype
returning and int. Future work could extend this set of functions to
other C library functions that we know about.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64504 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
f9201e0ff1779567150b70856753d9f2c6a91467 12-Feb-2009 Douglas Gregor <dgregor@apple.com> Initial implementation of function overloading in C.

This commit adds a new attribute, "overloadable", that enables C++
function overloading in C. The attribute can only be added to function
declarations, e.g.,

int *f(int) __attribute__((overloadable));

If the "overloadable" attribute exists on a function with a given
name, *all* functions with that name (and in that scope) must have the
"overloadable" attribute. Sets of overloaded functions with the
"overloadable" attribute then follow the normal C++ rules for
overloaded functions, e.g., overloads must have different
parameter-type-lists from each other.

When calling an overloaded function in C, we follow the same
overloading rules as C++, with three extensions to the set of standard
conversions:

- A value of a given struct or union type T can be converted to the
type T. This is just the identity conversion. (In C++, this would
go through a copy constructor).
- A value of pointer type T* can be converted to a value of type U*
if T and U are compatible types. This conversion has Conversion
rank (it's considered a pointer conversion in C).
- A value of type T can be converted to a value of type U if T and U
are compatible (and are not both pointer types). This conversion
has Conversion rank (it's considered to be a new kind of
conversion unique to C, a "compatible" conversion).

Known defects (and, therefore, next steps):
1) The standard-conversion handling does not understand conversions
involving _Complex or vector extensions, so it is likely to get
these wrong. We need to add these conversions.
2) All overloadable functions with the same name will have the same
linkage name, which means we'll get a collision in the linker (if
not sooner). We'll need to mangle the names of these functions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64336 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
224605064a4ef87d1c3d35ad1cb363f8b534012b 07-Feb-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Implement dereferencing of pointers-to-member.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63983 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
7dda67d8decef1b3621a151488c4b83bd8372d6a 05-Feb-2009 Douglas Gregor <dgregor@apple.com> Improvements and fixes for name lookup with using directives, from Piotr Rak!

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).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63877 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
aaba5e346dffdbad5d1c42765a89e4a7afb0da67 04-Feb-2009 Douglas Gregor <dgregor@apple.com> Basic representation of C++ class templates, from Andrew Sutton.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63750 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
47b9a1ca55e61e37f5a368740e29de190345acc6 04-Feb-2009 Douglas Gregor <dgregor@apple.com> Some name-lookup-related fixes, from Piotr Rak!

- Changes Lookup*Name functions to return NamedDecls, instead of
Decls. Unfortunately my recent statement that it will simplify lot of
code, was not quite right, but it simplifies some...
- Makes MergeLookupResult SmallPtrSet instead of vector, following
Douglas suggestions.
- Adds %qN format for printing qualified names to Diagnostic.
- Avoids searching for using-directives in Scopes, which are not
DeclScope, during unqualified name lookup.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63739 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
f680a0fe2dcab32b59fe6fdf71145b5313c40950 04-Feb-2009 Douglas Gregor <dgregor@apple.com> Bring operator name lookup (as required for C++ operator overloading)
into the general name-lookup fold. This cleans up some ugly,
not-quite-working code in the handling of operator overloading.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63735 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
fa047648b2a5502d7eef117adb4777eb9a63baa6 04-Feb-2009 Douglas Gregor <dgregor@apple.com> 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63692 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
48458d214c21401aa120e432a434f8ffd4e76a82 03-Feb-2009 Chris Lattner <sabre@nondot.org> silence some warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63662 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
2a3009a432bdcec59e6383d7b2b17494d6f91649 03-Feb-2009 Douglas Gregor <dgregor@apple.com> Semantic analysis, ASTs, and unqualified name lookup support for C++
using directives, from Piotr Rak!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63646 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
d863517ab7e936cbc3244a0fc431c8b672f5ece4 02-Feb-2009 Douglas Gregor <dgregor@apple.com> 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63549 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
4c921ae760cbdd9270c16d48417d7d527eb0ceb8 30-Jan-2009 Douglas Gregor <dgregor@apple.com> Eliminated LookupCriteria, whose creation was causing a bottleneck for
LookupName et al. Instead, use an enum and a bool to describe its
contents.

Optimized the C/Objective-C path through LookupName, eliminating any
unnecessarily C++isms. Simplify IdentifierResolver::iterator, removing
some code and arguments that are no longer used.

Eliminated LookupDeclInScope/LookupDeclInContext, moving all callers
over to LookupName, LookupQualifiedName, or LookupParsedName, as
appropriate.

All together, I'm seeing a 0.2% speedup on Cocoa.h with PTH and
-disable-free. Plus, we're down to three name-lookup routines.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63354 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
4afa39deaa245592977136d367251ee2c173dd8d 20-Jan-2009 Douglas Gregor <dgregor@apple.com> Remove ScopedDecl, collapsing all of its functionality into Decl, so
that every declaration lives inside a DeclContext.

Moved several things that don't have names but were ScopedDecls (and,
therefore, NamedDecls) to inherit from Decl rather than NamedDecl,
including ObjCImplementationDecl and LinkageSpecDecl. Now, we don't
store empty DeclarationNames for these things, nor do we try to insert
them into DeclContext's lookup structure.

The serialization tests are temporarily disabled. We'll re-enable them
once we've sorted out the remaining ownership/serialiazation issues
between DeclContexts and TranslationUnion, DeclGroups, etc.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62562 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
69d993ad8418cf21a56cf5b16c0f1c3cd6f74b64 17-Jan-2009 Douglas Gregor <dgregor@apple.com> PODify LookupResult, for a measly 1% speedup on Cocoa.h.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62391 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
0b7a158d120ac8d78c114a823e17eedfec6b6658 17-Jan-2009 Douglas Gregor <dgregor@apple.com> Teach DeclContext how to find the primary declaration for any TagDecl
even when we are still defining the TagDecl. This is required so that
qualified name lookup of a class name within its definition works (see
the new bits in test/SemaCXX/qualified-id-lookup.cpp).

As part of this, move the nested redefinition checking code into
ActOnTag. This gives us diagnostics earlier (when we try to perform
the nested redefinition, rather than when we try to complete the 2nd
definition) and removes some code duplication.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62386 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
4dc6b1c81c5efbaf68b868df10b18466b5e14b34 16-Jan-2009 Douglas Gregor <dgregor@apple.com> Improve diagnostics for ambiguous name lookup results

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62287 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
f185319f25efd6094870f287030270fad26085ba 15-Jan-2009 Daniel Dunbar <daniel@zuster.org> Fix some unused variable, control reaches end of non-void function,
and uninitialized use options.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62270 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
4bb64e77dd3b22070e28b7f9ff99feb576eaf6ef 15-Jan-2009 Douglas Gregor <dgregor@apple.com> Deallocate the BasePaths structure that we allocate for LookupResult.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62250 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
7176fff961e04c4dff61efb967b1d344d41335a7 15-Jan-2009 Douglas Gregor <dgregor@apple.com> Initial implementation of member name lookup

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62247 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp
eb11cd078ba8682bbb9b082f8f6ead8be5c98581 14-Jan-2009 Douglas Gregor <dgregor@apple.com> Refactor name lookup.

This change refactors and cleans up our handling of name lookup with
LookupDecl. There are several aspects to this refactoring:

- The criteria for name lookup is now encapsulated into the class
LookupCriteria, which replaces the hideous set of boolean values
that LookupDecl currently has.

- The results of name lookup are returned in a new class
LookupResult, which can lazily build OverloadedFunctionDecls for
overloaded function sets (and, eventually, eliminate the need to
allocate member for OverloadedFunctionDecls) and contains a
placeholder for handling ambiguous name lookup (for C++).

- The primary entry points for name lookup are now LookupName (for
unqualified name lookup) and LookupQualifiedName (for qualified
name lookup). There is also a convenience function
LookupParsedName that handles qualified/unqualified name lookup
when given a scope specifier. Together, these routines are meant
to gradually replace the kludgy LookupDecl, but this won't happen
until after we have base class lookup (which forces us to cope
with ambiguities).

- Documented the heck out of name lookup. Experimenting a little
with using Doxygen's member groups to make some sense of the Sema
class. Feedback welcome!

- Fixes some lingering issues with name lookup for
nested-name-specifiers, which now goes through
LookupName/LookupQualifiedName.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62245 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaLookup.cpp