| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
Objective-C class. The AST reader just throws away this data anyway!
llvm-svn: 149067
|
|
|
|
|
|
|
| |
method pool, so that we don't perform the same lookups into the same
PCH/module file repeatedly.
llvm-svn: 148895
|
|
|
|
|
|
|
| |
return pre-built lists. Instead, it feeds the methods it deserializes
to Sema so that Sema can unique them, which keeps the chains shorter.
llvm-svn: 148889
|
|
|
|
|
|
|
|
| |
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.
llvm-svn: 148808
|
|
|
|
|
|
|
|
|
|
| |
generational scheme for identifiers that avoids searching the hash
tables of a given module more than once for a given
identifier. Previously, loading any new module invalidated all of the
previous lookup results for all identifiers, causing us to perform the
lookups repeatedly.
llvm-svn: 148412
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
corresponding to TagType and ObjCInterfaceType. Previously, we would
serialize the definition (if available) or the canonical declaration
(if no definition was available). However, this can end up forcing the
deserialization of the definition even through we might not want to
yet.
Instead, always serialize the canonical declaration reference in the
TagType/ObjCInterfaceType entry, and as part of loading a pending
definition, update the "decl" pointer within the type node to point at
the definition. This is more robust in hard-to-isolate cases
where the *Type gets built and filled in before we see the definition.
llvm-svn: 148323
|
|
|
|
|
|
|
|
| |
a module file, be sure to also add the first (potentially canonical)
declarations to the chain. This isn't guaranteed to occur because the
first declaration is not listed in the stored redeclaration chain.
llvm-svn: 148314
|
|
|
|
|
|
|
| |
moving it from a "special type" to a predefined declaration, as we do
for id, Class, and SEL.
llvm-svn: 148313
|
|
|
|
|
|
| |
appropriate or when GCC requires it)
llvm-svn: 148292
|
|
|
|
|
|
| |
This allows -Wswitch-enum to find switches that need updating when these enums are modified.
llvm-svn: 148281
|
|
|
|
|
|
|
|
|
|
| |
class/Objective-C protocol suffices get all of the redeclarations of
that declaration wired to the definition, we no longer need to record
the identity of the definition in every declaration. Instead, just
record a bit to indicate whether a particular declaration is the
definition.
llvm-svn: 148224
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
protocol, record the definition pointer in the canonical declaration
for that entity, and then propagate that definition pointer from the
canonical declaration to all other deserialized declarations. This
approach works well even when deserializing declarations that didn't
know about the original definition, which can occur with modules.
A nice bonus from this definition-deserialization approach is that we
no longer need update records when a definition is added, because the
redeclaration chains ensure that the if any declaration is loaded, the
definition will also get loaded.
llvm-svn: 148223
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
chains, again. The prior implementation was very linked-list oriented, and
the list-splicing logic was both fairly convoluted (when loading from
multiple modules) and failed to preserve a reasonable ordering for the
redeclaration chains.
This new implementation uses a simpler strategy, where we store the
ordered redeclaration chains in an array-like structure (indexed based
on the first declaration), and use that ordering to add individual
deserialized declarations to the end of the existing chain. That way,
the chain mimics the ordering from its modules, and a bug somewhere is
far less likely to result in a broken linked list.
llvm-svn: 148222
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
llvm-svn: 148187
|
|
|
|
|
|
|
|
| |
virtual functions that provide previous/most recent redeclaration
information for any declaration. Use this to eliminate the redundant,
less efficient getPreviousDecl() functions.
llvm-svn: 148184
|
|
|
|
| |
llvm-svn: 148183
|
|
|
|
|
|
| |
RedeclarableTemplateDecl. It is not clear that it's worth delaying the allocation of said pointer
llvm-svn: 148182
|
|
|
|
|
|
|
|
|
|
|
| |
Redeclarable<RedeclarableTemplateDecl>, eliminating a bunch of
redeclaration-chain logic both in RedeclarableTemplateDecl and
especially in its (de-)serialization.
As part of this, eliminate the RedeclarableTemplate<> class template,
which was an abstraction that didn't actually save anything.
llvm-svn: 148181
|
|
|
|
|
|
|
| |
get added to the identifier chains as part of deserialization, because
they should not be visible to name lookup.
llvm-svn: 148159
|
|
|
|
|
|
|
|
| |
don't set isUsed for local variables which are referenced in unevaluated contexts. Make other code use isReferenced() (which basically indicates that a declaration isn't dead) where appropriate.
I was forced to change test/SemaCXX/linkage.cpp because we aren't actually modeling extern "C" in the AST the way that testcase expects; we were not printing a warning only because we skipped the relevant check. Someone who actually understands the semantics here should fix that.
llvm-svn: 148158
|
|
|
|
|
|
|
|
|
|
| |
was constructed, e.g. for a property access.
This allows the selector identifier locations machinery for ObjCMessageExpr
to function correctly, in that there are not real locations to handle/report for
such a message.
llvm-svn: 148013
|
|
|
|
|
|
|
|
| |
the anonymous namespace to its parent. Semantically, this means that
the anonymous namespaces defined in one module are distinct from the
anonymous namespaces defined in another module.
llvm-svn: 147782
|
|
|
|
|
|
|
|
|
|
| |
that we can merge, for example, two occurrences of
namespace N { void f(); }
in two disjoint modules.
llvm-svn: 147780
|
|
|
|
|
|
|
|
|
| |
modules. Teach name lookup into namespaces to search in each of the
merged DeclContexts as well as the (now-primary) DeclContext. This
supports the common case where two different modules put something
into the same namespace.
llvm-svn: 147778
|
|
|
|
|
|
| |
88 -> 80 bytes on x86_64.
llvm-svn: 147736
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
llvm-svn: 147729
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
llvm-svn: 147687
|
|
|
|
| |
llvm-svn: 147681
|
|
|
|
| |
llvm-svn: 147664
|
|
|
|
|
|
|
|
| |
into the two unused lower bits of the NextDeclInContext link, dropping
the number of bits in Decl down to 32, and saving 8 bytes per
declaration on x86-64.
llvm-svn: 147660
|
|
|
|
|
|
|
|
|
|
| |
is hidden from name lookup. The previous hack of tweaking the
ModulePrivate bit when loading a declaration from a hidden submodule
was brittle.
Note that we now have 34 bits in Decl. I'll fix that next.
llvm-svn: 147658
|
|
|
|
|
|
| |
David Fang and Takumi Nakamura. Fixes many PCH failures on PowerPC.
llvm-svn: 147657
|
|
|
|
|
|
|
| |
each deserialized declaration, since that information is already
available in each declaration.
llvm-svn: 147619
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
storage for the global declaration ID. Declarations that are parsed
(rather than deserialized) are unaffected, so the number of
declarations that pay this cost tends to be relatively small (since
relatively few declarations are ever deserialized).
This replaces a largish DenseMap within the AST reader. It's not
strictly a win in terms of memory use---not every declaration was
added to that DenseMap in the first place---but it's cleaner to have
this information available for every deserialized declaration, so that
future clients can rely on it.
llvm-svn: 147617
|
|
|
|
|
|
|
| |
go through a central allocation routine
Decl::AllocateDeserializedDecl(). No actual functionality change (yet).
llvm-svn: 147614
|
|
|
|
|
|
|
|
| |
the AST file,
as suggested by Tom Honermann.
llvm-svn: 147612
|
|
|
|
|
|
|
|
| |
in the module map. This provides a bit more predictability for the
user, as well as eliminating the need to sort the submodules when
serializing them.
llvm-svn: 147564
|
|
|
|
| |
llvm-svn: 147535
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
different modules. This implementation is a first approximation of
what we want, using only the function type to determine
equivalence. Later, we'll want to deal with some of the more subtle
issues, including:
- C allows a prototyped declaration and a non-prototyped declaration
to be merged, which we should support
- We may want to ignore the return type when merging, then
complain if the return types differ. Or, we may want to leave it
as it us, so that we only complain if overload resolution
eventually fails.
- C++ non-static member functions need to consider cv-qualifiers
and ref-qualifiers.
- Function templates need to consider the template parameters and
return type.
- Function template specializations will have special rules.
- We can now (accidentally!) end up overloading in C, even without
the "overloadable" attribute, and will need to detect this at some
point.
The actual detection of "is this an overload?" is implemented by
Sema::IsOverload(), which will need to be moved into the AST library
for re-use here. That will be a future refactor.
llvm-svn: 147534
|
|
|
|
|
|
|
|
|
|
|
| |
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.
llvm-svn: 147533
|
|
|
|
|
|
|
|
|
|
|
|
| |
that if two modules A and B both contain a declaration of a tag such
as
struct X;
and those two modules are unrelated, the two declarations of X will be
merged into a single redeclaration chain.
llvm-svn: 147488
|
|
|
|
|
|
|
| |
declarations in the AST unless modules are enabled. This case doesn't
come up with precompiled headers, and it isn't cheap.
llvm-svn: 147451
|
|
|
|
|
|
|
|
| |
member function template, since the behavior is identical for
ObjCInterfaceDecl and ObjCProtocolDecl. It's expected that all
redeclarable entities will have the same behavior.
llvm-svn: 147450
|
|
|
|
|
|
| |
used anywhere.
llvm-svn: 147422
|
|
|
|
|
|
| |
ObjCProtocolDecl proper source-range information.
llvm-svn: 147420
|
|
|
|
|
|
| |
They are no longer needed
llvm-svn: 147419
|
|
|
|
|
|
|
| |
multiple, disjoint modules. There is far too much duplicating with the
ObjCInterfaceDecl case here, which I'll eliminate shortly.
llvm-svn: 147417
|
|
|
|
|
|
| |
ObjCProtocolDecl modules forward declarations properly.
llvm-svn: 147415
|
|
|
|
|
|
| |
module file when we've merely added a definition
llvm-svn: 147414
|
|
|
|
|
|
| |
longer needed now that we aren't back-patching ObjCProtocolDecls.
llvm-svn: 147413
|