History log of /external/clang/lib/Sema/IdentifierResolver.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
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/IdentifierResolver.cpp
16f1f717af196b1448258857b2e6dcfe144b39d0 29-Feb-2012 James Molloy <james.molloy@arm.com> Reapply r151638 and r151641.

The bug that was caught by Apple's internal buildbots was valid and also showed another bug in my implementation.

These are now fixed, with regression tests added to catch them both (not Darwin-specific).

Original log:
====================

Revert r151638 because it causes assertion hit on PCH creation for Cocoa.h

Original log:
---------------------
Correctly track tags and enum members defined in the prototype of a function, and ensure they are properly scoped.

This fixes code such as:

enum e {x, y};
int f(enum {y, x} n) {
return 0;
}

This finally fixes PR5464 and PR5477.
---------------------

I also reverted r151641 which was enhancement on top of r151638.

====================




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151712 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.cpp
32a9a7543f0296b0ae141899005f788bbe4262ca 29-Feb-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Revert r151638 because it causes assertion hit on PCH creation for Cocoa.h

Original log:
---------------------
Correctly track tags and enum members defined in the prototype of a function, and ensure they are properly scoped.

This fixes code such as:

enum e {x, y};
int f(enum {y, x} n) {
return 0;
}

This finally fixes PR5464 and PR5477.
---------------------

I also reverted r151641 which was enhancement on top of r151638.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151667 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.cpp
fbcf0405b7da1c8606e4223b4f91835643ecd5b4 28-Feb-2012 James Molloy <james.molloy@arm.com> Correctly track tags and enum members defined in the prototype of a function, and ensure they are properly scoped.

This fixes code such as:

enum e {x, y};
int f(enum {y, x} n) {
return 0;
}

This finally fixes PR5464 and PR5477.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151638 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.cpp
5d5051f3e79bf754134ccdf7a1dc7778cd80c73e 24-Jan-2012 Douglas Gregor <dgregor@apple.com> Only mark an IdentifierInfo as having changed since deserialization
when it actually has changed (and not, e.g., when we've simply attached a
deserialized macro definition). Good for ~1.5% reduction in module
file size, mostly in the identifier table.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148808 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.cpp
7723fec9b45b7258c0eddf4cbfd0d335348f5edc 15-Dec-2011 Douglas Gregor <dgregor@apple.com> Keep track of all declarations of an Objective-C class (both forward
declarations and definitions) as ObjCInterfaceDecls within the same
redeclaration chain. This new representation matches what we do for
C/C++ variables/functions/classes/templates/etc., and makes it
possible to answer the query "where are all of the declarations of
this class?"



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146679 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.cpp
eee242ff426bf79149f221798966e58688383c1e 27-Oct-2011 Douglas Gregor <dgregor@apple.com> Make the loading of information attached to an IdentifierInfo from an
AST file more lazy, so that we don't eagerly load that information for
all known identifiers each time a new AST file is loaded. The eager
reloading made some sense in the context of precompiled headers, since
very few identifiers were defined before PCH load time. With modules,
however, a huge amount of code can get parsed before we see an
@import, so laziness becomes important here.

The approach taken to make this information lazy is fairly simple:
when we load a new AST file, we mark all of the existing identifiers
as being out-of-date. Whenever we want to access information that may
come from an AST (e.g., whether the identifier has a macro definition,
or what top-level declarations have that name), we check the
out-of-date bit and, if it's set, ask the AST reader to update the
IdentifierInfo from the AST files. The update is a merge, and we now
take care to merge declarations before/after imports with declarations
from multiple imports.

The results of this optimization are fairly dramatic. On a small
application that brings in 14 non-trivial modules, this takes modules
from being > 3x slower than a "perfect" PCH file down to 30% slower
for a full rebuild. A partial rebuild (where the PCH file or modules
can be re-used) is down to 7% slower. Making the PCH file just a
little imperfect (e.g., adding two smallish modules used by a bunch of
.m files that aren't in the PCH file) tips the scales in favor of the
modules approach, with 24% faster partial rebuilds.

This is just a first step; the lazy scheme could possibly be improved
by adding versioning, so we don't search into modules we already
searched. Moreover, we'll need similar lazy schemes for all of the
other lookup data structures, such as DeclContexts.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143100 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.cpp
b219cfc4d75f0a03630b7c4509ef791b7e97b2c8 23-Sep-2011 David Blaikie <dblaikie@gmail.com> Switch assert(0/false) llvm_unreachable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140367 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.cpp
fa7b8ced6f3318879b39f44b5ace8346e979826e 24-Mar-2011 Douglas Gregor <dgregor@apple.com> Fix the insertion of label declarations into the identifier chain in
the case where we only have a single identifier with that name in the
chain. Fixes PR9463 for real this time.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128208 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.cpp
250e7a74d5a23db5bd7202ecb0bb4a8fef6016b4 16-Mar-2011 Douglas Gregor <dgregor@apple.com> When we're inserting a synthesized label declaration for a
forward-looking "goto" statement, make sure to insert it *after* the
last declaration in the identifier resolver's declaration chain that
is either outside of the function/block/method's scope or that is
declared in that function/block/method's specific scope. Previously,
we could end up inserting the label ahead of declarations in inner
scopes, confusing C++ name lookup.

Fixes PR9491/<rdar://problem/9140426> and <rdar://problem/9135994>.

Note that the crash-on-invalid PR9495 is *not* fixed. That's a
separate issue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127737 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.cpp
7cbc558ffda5877ec4d2e432534e3d3d4ac10050 14-Mar-2011 Douglas Gregor <dgregor@apple.com> When synthesizing a label declaration based on a goto statement that
cannot yet be resolved, be sure to push the new label declaration into
the right place within the identifier chain. Otherwise, name lookup in
C++ gets confused when searching for names that are lexically closer
than the label. Fixes PR9463.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127623 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.cpp
cc20945c787a56abe418947fc6a2c520bcec66c0 07-Mar-2011 Douglas Gregor <dgregor@apple.com> Support explicit template specialization and instantiation for members
of a C++0x inline namespace within enclosing namespaces, as noted in
C++0x [namespace.def]p8.

Fixes <rdar://problem/9006349>, a libc++ failure where Clang was
rejected an explicit specialization of std::swap (since libc++ puts it
into an inline, versioned namespace std::__1).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127162 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.cpp
7a126a474fdde06382b315b4e3d8ef0a21d4dc31 31-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Rename DeclContext::getLookupContext to getRedeclContext and change its semantics slightly. No functionality change in the absence of inline namespaces. Also, change a few places where inline namespaces actually make a difference to be prepared for them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112563 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.cpp
7cd088e519d7e6caa4c4c12db52e0e4ae35d25c2 24-Aug-2010 John McCall <rjmccall@apple.com> Struggle mightily against header inclusion in Sema.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111904 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.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/IdentifierResolver.cpp
3c7f4134603d04b44f997b43c0a9def270f25386 19-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> More PCH -> AST renaming.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111472 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.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/IdentifierResolver.cpp
1450ef99896d66ba67e2ddd2798a29be1bf560b8 30-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Correctly deal with using names for both functions and structs in chained PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109871 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.cpp
eeb1cb49244a67327fce088c1f720da1f8c021a9 15-Feb-2010 John McCall <rjmccall@apple.com> Optimize the implementation of IdDeclInfo pooling in the IdentifierResolver.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96253 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.cpp
3a349947e5d4ba6bd16d775ce17cf9c9d181bc39 02-Jan-2010 Eli Friedman <eli.friedman@gmail.com> Eliminate dead code.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92424 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.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/IdentifierResolver.cpp
61481dad22ebca3fba3fe4fb67a3b926d0895e9c 01-Sep-2009 Douglas Gregor <dgregor@apple.com> Add DeclContext::Equals to compare declaration contexts based on their primary context. Use this instead of pointer comparisons

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80690 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.cpp
db3a0f543e9a120d37823c6f2a2f1c693b69f2a1 26-Aug-2009 Douglas Gregor <dgregor@apple.com> Make sure to compare primary declaration contexts when determining whether a declaration is in scope

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80126 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.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/IdentifierResolver.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/IdentifierResolver.cpp
0b2b6e1cb1573bb295c0a65813dc4df8d57f305b 04-Mar-2009 Chris Lattner <sabre@nondot.org> Switch attributes to be allocated from the declcontext bump pointer just like
decls. This reduces the number of calls to malloc on cocoa.h with pth and
-disable-free from 15958 to 12444 times (down ~3500).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66023 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.cpp
6393519272ce727f4d26e71bbefb5de712274d0e 02-Mar-2009 Douglas Gregor <dgregor@apple.com> Rework the way we find locally-scoped external declarations when we
need them to evaluate redeclarations or call a function that hasn't
already been declared. We now keep a DenseMap of these locally-scoped
declarations so that they are not visible but can be quickly found,
e.g., when we're looking for previous declarations or before we go
ahead and implicitly declare a function that's being called. Fixes
PR3672.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65792 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.cpp
7fd46dac4ab51de4d224f6bc7ce197913220a70c 17-Feb-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Now that ObjC decls have DeclContexts too, remove an ugly hack from IdentifierResolver.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64802 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.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/IdentifierResolver.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/IdentifierResolver.cpp
72de6676bd30f9081ee4166bbe07b4c270258ce6 08-Jan-2009 Douglas Gregor <dgregor@apple.com> Unify the code for defining tags in C and C++, so that we always
introduce a Scope for the body of a tag. This reduces the number of
semantic differences between C and C++ structs and unions, and will
help with other features (e.g., anonymous unions) in C. Some important
points:

- Fields are now in the "member" namespace (IDNS_Member), to keep
them separate from tags and ordinary names in C. See the new test
in Sema/member-reference.c for an example of why this matters. In
C++, ordinary and member name lookup will find members in both the
ordinary and member namespace, so the difference between
IDNS_Member and IDNS_Ordinary is erased by Sema::LookupDecl (but
only in C++!).
- We always introduce a Scope and push a DeclContext when we're
defining a tag, in both C and C++. Previously, we had different
actions and different Scope/CurContext behavior for enums, C
structs/unions, and C++ structs/unions/classes. Now, it's one pair
of actions. (Yay!)

There's still some fuzziness in the handling of struct/union/enum
definitions within other struct/union/enum definitions in C. We'll
need to do some more cleanup to eliminate some reliance on CurContext
before we can solve this issue for real. What we want is for something
like this:

struct X {
struct T { int x; } t;
};

to introduce T into translation unit scope (placing it at the
appropriate point in the IdentifierResolver chain, too), but it should
still have struct X as its lexical declaration
context. PushOnScopeChains isn't smart enough to do that yet, though,
so there's a FIXME test in nested-redef.c



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61940 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.cpp
0701bbb228dfd87e1fe82a0a4b7b9facfecb43da 08-Jan-2009 Steve Naroff <snaroff@apple.com> This is a large/messy diff that unifies the ObjC AST's with DeclContext.

- ObjCContainerDecl's (ObjCInterfaceDecl/ObjCCategoryDecl/ObjCProtocolDecl), ObjCCategoryImpl, & ObjCImplementation are all DeclContexts.
- ObjCMethodDecl is now a ScopedDecl (so it can play nicely with DeclContext).
- ObjCContainerDecl now does iteration/lookup using DeclContext infrastructure (no more linear search:-)
- Removed ASTContext argument to DeclContext::lookup(). It wasn't being used and complicated it's use from an ObjC AST perspective.
- Added Sema::ProcessPropertyDecl() and removed Sema::diagnosePropertySetterGetterMismatch().
- Simplified Sema::ActOnAtEnd() considerably. Still more work to do.
- Fixed an incorrect casting assumption in Sema::getCurFunctionOrMethodDecl(), now that ObjCMethodDecl is a ScopedDecl.
- Removed addPropertyMethods from ObjCInterfaceDecl/ObjCCategoryDecl/ObjCProtocolDecl.

This passes all the tests on my machine. Since many of the changes are central to the way ObjC finds it's methods, I expect some fallout (and there are still a handful of FIXME's). Nevertheless, this should be a step in the right direction.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61929 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.cpp
ce35607c282c845b3285d0f6e106489d8bbeba13 07-Jan-2009 Douglas Gregor <dgregor@apple.com> Allow Objective-C entities to be declared within a transparent context
nested in the translation unit. This fixes <rdar://problem/6476070>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61832 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.cpp
074149e11baf5f7db12f84efd5c34ba6e35d5cdf 05-Jan-2009 Douglas Gregor <dgregor@apple.com> Introduce support for "transparent" DeclContexts, which are
DeclContexts whose members are visible from enclosing DeclContexts up
to (and including) the innermost enclosing non-transparent
DeclContexts. Transparent DeclContexts unify the mechanism to be used
for various language features, including C enumerations, anonymous
unions, C++0x inline namespaces, and C++ linkage
specifications. Please refer to the documentation in the Clang
internals manual for more information.

Only enumerations and linkage specifications currently use transparent
DeclContexts.

Still to do: use transparent DeclContexts to implement anonymous
unions and GCC's anonymous structs extension, and, later, the C++0x
features. We also need to tighten up the DeclContext/ScopedDecl link
to ensure that every ScopedDecl is in a single DeclContext, which
will ensure that we can then enforce ownership and reduce the memory
footprint of DeclContext.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61735 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.cpp
a0fd8652f3302d0f39ed9849b521ee5b76597b0a 21-Dec-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Parser support for C++ try-catch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61312 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.cpp
44b4321feab46299d3f5cfd404680884752a0fcf 11-Dec-2008 Douglas Gregor <dgregor@apple.com> Unifies the name-lookup mechanisms used in various parts of the AST
and separates lexical name lookup from qualified name lookup. In
particular:
* Make DeclContext the central data structure for storing and
looking up declarations within existing declarations, e.g., members
of structs/unions/classes, enumerators in C++0x enums, members of
C++ namespaces, and (later) members of Objective-C
interfaces/implementations. DeclContext uses a lazily-constructed
data structure optimized for fast lookup (array for small contexts,
hash table for larger contexts).

* Implement C++ qualified name lookup in terms of lookup into
DeclContext.

* Implement C++ unqualified name lookup in terms of
qualified+unqualified name lookup (since unqualified lookup is not
purely lexical in C++!)

* Limit the use of the chains of declarations stored in
IdentifierInfo to those names declared lexically.

* Eliminate CXXFieldDecl, collapsing its behavior into
FieldDecl. (FieldDecl is now a ScopedDecl).

* Make RecordDecl into a DeclContext and eliminates its
Members/NumMembers fields (since one can just iterate through the
DeclContext to get the fields).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60878 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.cpp
ebed7971cf47d2fc83f262e7d99cacc3d8b5f163 05-Dec-2008 Zhongxing Xu <xuzhongxing@gmail.com> Rename: FindContext -> FindDeclVisibleInContext.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60574 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.cpp
2def48394f6d48bde0dec2b514193c2b533265b5 17-Nov-2008 Douglas Gregor <dgregor@apple.com> Updated IdentifierResolver to deal with DeclarationNames. The names of
C++ constructors, destructors, and conversion functions now have a
FETokenInfo field that IdentifierResolver can access, so that these
special names are handled just like ordinary identifiers. A few other
Sema routines now use DeclarationNames instead of IdentifierInfo*'s.

To validate this design, this code also implements parsing and
semantic analysis for id-expressions that name conversion functions,
e.g.,

return operator bool();

The new parser action ActOnConversionFunctionExpr takes the result of
parsing "operator type-id" and turning it into an expression, using
the IdentifierResolver with the DeclarationName of the conversion
function. ActOnDeclarator pushes those conversion function names into
scope so that the IdentifierResolver can find them, of course.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59462 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.cpp
c42e1183846228a7fa5143ad76507d6d60f5c6f3 11-Nov-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Implement C++ 'typeid' parsing and sema.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59042 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.cpp
8e9bebdea69c590dedfbf27374114cb76fe12fbd 21-Oct-2008 Douglas Gregor <dgregor@apple.com> Preliminary support for function overloading

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57909 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.cpp
f99cb051665d2faab038ed855b2eff15d603796d 09-Sep-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Make IdentifierResolver::isDeclInScope regard declarations of a parent 'control' scope as part of the current scope.
The 'control' scope is the 'condition' scope of if/switch/while statements and the scope that contains the for-init-statement and 'condition' of a for statement.

e.g:
if (int x = 0 /*'control' scope*/) {
// x will be regarded as part of this substatement scope.
} else {
// and as part of this substatement scope too.
}


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56020 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.cpp
eb7c388bc7ce19fffb8b4b440cee0173297e8490 09-Sep-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add a LangOptions member to IdentifierResolver.
Make Sema pass the LangOptions to IdentifierResolver's constructor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56015 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.cpp
81bebb1e2e6bb05e360f36da098dc7016e8f654b 09-Sep-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> IdentifierResolver cleanup. Make some methods out-of-line.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56002 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.cpp
90eb539bc3121bdc0e867ab1cd6bdca3b36d961e 17-Jul-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Unify ctx_iterator/ctx_begin()/ctx_end() and iterator/begin()/end() so that a single iterator type is used for both traversing decls of the same declaration context *and* of the parent declaration contexts, depending on the value of the bool parameter 'LookInParentCtx' that is passed to IdentifierResolver::begin().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53724 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.cpp
3d0d83a4a0694c1bf4509c893162f0cdf454ee14 15-May-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Comments fix.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51151 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.cpp
00bc645d154f8f30bfbfb2fe508caf087793157c 10-May-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> -Implement proper name lookup for namespaces.
-identifierResolver exposes an iterator interface to get all decls through the scope chain.
-The semantic staff (checking IdentifierNamespace and Doug's checking for shadowed tags were moved out of IdentifierResolver and back into Sema. IdentifierResolver just gives an iterator for all reachable decls of an identifier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50923 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.cpp
f8d9e76a58c2c6b00f925e347088ec9b5dc8f1b0 14-Apr-2008 Douglas Gregor <dgregor@apple.com> Argiris Kirtzidis's fix for handling empty IdDeclInfo's in IdentifierResolver::AddDecl

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49631 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.cpp
7bc198fb47a498e327a9ceb2d17612dcb3d15095 14-Apr-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Move IdDeclInfoMap class in an anonymous namespace. Suggestion by Chris Lattner.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49628 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.cpp
2ce52f3fb95bf544db6bd3d91a72bce7d9cceb6c 13-Apr-2008 Douglas Gregor <dgregor@apple.com> Introduce support for finding class and enum names via ordinary name lookup in C++

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49621 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.cpp
72e62b0c6049b7e76b508bb74116314eb7772be5 12-Apr-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Use std::list's push_back instead of resize to add an element.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49582 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.cpp
321f278db3405268e8644eb75f4fcf8900e0d09c 12-Apr-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fixed comments.
Moved IdDeclInfo class to anonymous namespace.
Replaced array with a std::vector.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49570 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/IdentifierResolver.cpp
a2f42b1d18db7a6e05314b04532a6643e1ffba0f 11-Apr-2008 Chris Lattner <sabre@nondot.org> two new files for previous patch, by Argiris Kirtzidis


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