|  | Commit message (Collapse) | Author | Age | Files | Lines | 
|---|
| | 
| 
| 
| 
| 
| 
| 
| 
| | HeaderFileInfos
from the primary PCH is deserialized, otherwise we lose info that headers were
already #imported/#included.
llvm-svn: 144510 | 
| | 
| 
| 
| | llvm-svn: 144505 | 
| | 
| 
| 
| 
| 
| 
| 
| | [is/set]ChangedSinceDeserialization
and remove them.
llvm-svn: 144466 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | of its categories because
it is going to be rewritten (and the chain will be serialized again), otherwise we may form a cycle in its
categories list when deserializing.
Also introduce ASTMutationListener::CompletedObjCForwardRef to notify that a forward reference
was completed; using Decl's isChangedSinceDeserialization/setChangedSinceDeserialization
is bug inducing and kinda gross, we should phase it out.
Fixes infinite loop in rdar://10418538.
llvm-svn: 144465 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| | that it retains source location information for the type. Aside from
general goodness (being able to walk the types described in that
information), we now have a proper representation for dependent
delegating constructors. Fixes PR10457 (for real).
llvm-svn: 143410 | 
| | 
| 
| 
| 
| 
| | make sure that we keep track of locations of replaced decls as well.
llvm-svn: 143341 | 
| | 
| 
| 
| 
| 
| 
| | Currently sorting by raw source location does work as intended but who knows
what may change in the future..
llvm-svn: 143256 | 
| | 
| 
| 
| 
| 
| | if we are not interested in the decl.
llvm-svn: 143255 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Introduce a FILE_SORTED_DECLS [de]serialization record that contains
a file sorted array of file-level DeclIDs in a PCH/Module.
The rationale is to allow "targeted" deserialization of decls inside
a range of a source file.
Cocoa PCH increased by 0.8%
Difference of creation time for Cocoa PCH is below the noise level.
llvm-svn: 143238 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | 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.
llvm-svn: 143100 | 
| | 
| 
| 
| 
| 
| 
| | public. Add a __private_macro__ directive to hide a macro, similar to
the __module_private__ declaration specifier.
llvm-svn: 142188 | 
| | 
| 
| 
| 
| 
| 
| | for better self-documenting code, since the semantics
are subtly different from getDefinition().
llvm-svn: 141355 | 
| | 
| 
| 
| 
| 
| 
| 
| | 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!
llvm-svn: 141330 | 
| | 
| 
| 
| 
| 
| | - Also, spell const_iterator as const_iterator.
llvm-svn: 140765 | 
| | 
| 
| 
| 
| 
| 
| | storing mappings with that instead of straying some magic constants about the
source.
llvm-svn: 140760 | 
| | 
| 
| 
| | llvm-svn: 140478 | 
| | 
| 
| 
| | llvm-svn: 140367 | 
| | 
| 
| 
| 
| 
| | we already have the range in the PPEntityOffsets array.
llvm-svn: 140209 | 
| | 
| 
| 
| 
| 
| | and don't store the ID for each preprocessed entity.
llvm-svn: 140208 | 
| | 
| 
| 
| 
| 
| | don't store an extra location for it.
llvm-svn: 140190 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| | PreprocessingRecord's getPreprocessedEntitiesInRange.
Also remove all the stuff that were added in ASTUnit that are unnecessary now
that we do a binary search for preprocessed entities and deserialize only
what is necessary.
llvm-svn: 140063 | 
| | 
| 
| 
| 
| 
| | return iterators for local, non-loaded, preprocessed entities.
llvm-svn: 140062 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| | which will do a binary search and return a pair of iterators
for preprocessed entities in the given source range.
Source ranges of preprocessed entities are stored twice currently in
the PCH/Module file but this will be fixed in a subsequent commit.
llvm-svn: 140058 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| | arbitrary amount of code. This forces us to stage the AST writer more
strictly, ensuring that we don't assign a declaration ID to a
declaration until after we're certain that no more modules will get
loaded.
llvm-svn: 139974 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | -Use an array of offsets for all preprocessed entities
-Get rid of the separate array of offsets for just macro definitions;
 for references to macro definitions use an index inside the preprocessed
 entities array.
-Deserialize each preprocessed entity lazily, at first request; not in bulk.
Paves the way for binary searching of preprocessed entities that will offer
efficiency and will simplify things on the libclang side a lot.
llvm-svn: 139809 | 
| | 
| 
| 
| 
| 
| | non-exported macro, for real this time
llvm-svn: 139745 | 
| | 
| 
| 
| | llvm-svn: 139734 | 
| | 
| 
| 
| 
| 
| | dealing with non-exported macros
llvm-svn: 139731 | 
| | 
| 
| 
| 
| 
| | non-exported macro
llvm-svn: 139728 | 
| | 
| 
| 
| 
| 
| 
| | should no longer have the serialization of LangOptions out of sync
with the structure itself (yay).
llvm-svn: 139613 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| | language options. Use that .def file to declare the LangOptions class
and initialize all of its members, eliminating a source of annoying
initialization bugs.
AST serialization changes are next up.
llvm-svn: 139605 | 
| | 
| 
| 
| | llvm-svn: 139600 | 
| | 
| 
| 
| | llvm-svn: 139430 | 
| | 
| 
| 
| 
| 
| 
| 
| | declaration was deserialized from an AST file. Use this instead of
Decl::getPCHLevel() wherever possible. This is a simple step toward
killing off Decl::getPCHLevel().
llvm-svn: 139427 | 
| | 
| 
| 
| 
| 
| | for a builtin macro expansion.
llvm-svn: 139298 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| | 'id' that can be used (only!) via a contextual keyword as the result
type of an Objective-C message send. 'instancetype' then gives the
method a related result type, which we have already been inferring for
a variety of methods (new, alloc, init, self, retain). Addresses
<rdar://problem/9267640>.
llvm-svn: 139275 | 
| | 
| 
| 
| 
| 
| 
| | needed for implicit move constructors and move assignment
operators. Fixes PR10847.
llvm-svn: 139144 | 
| | 
| 
| 
| 
| 
| 
| 
| | builtin types (When requested). This is another step toward making
ASTUnit build the ASTContext as needed when loading an AST file,
rather than doing so after the fact. No actual functionality change (yet).
llvm-svn: 138985 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | include guards don't show up as macro definitions in every translation
unit that imports a module. Macro definitions can, however, be
exported with the intentionally-ugly #__export_macro__
directive. Implement this feature by not even bothering to serialize
non-exported macros to a module, because clients of that module need
not (should not) know that these macros even exist.
llvm-svn: 138943 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | The initial incentive was to fix a crash when PCH chaining categories
to an interface, but the fix was done in the "modules way" that I hear
is popular with the kids these days.
Each module stores the local chain of categories and we combine them
when the interface is loaded. We also warn if non-dependent modules
introduce duplicate named categories.
llvm-svn: 138926 | 
| | 
| 
| 
| | llvm-svn: 138855 | 
| | 
| 
| 
| 
| 
| 
| 
| | sure that all of the CXXConversionDecls go into the same
bucket. Otherwise, name lookup might not find them all. Fixes
<rdar://problem/10041960>.
llvm-svn: 138824 | 
| | 
| 
| 
| 
| 
| 
| | Empty lookups can occur in the DeclContext map when we are chaining PCHs, where
the empty lookup indicates that we already looked in ExternalASTSource.
llvm-svn: 138816 | 
| | 
| 
| 
| 
| 
| | option is ObjCInferRelatedResultType.
llvm-svn: 138793 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| | table when serializing an AST file. This was a holdover from the days
before chained PCH, and is a complete waste of time and storage
now. It's a good thing it's useless, because I have no idea how I
would have implemented MaterializeVisibleDecls efficiently in the
presence of modules.
llvm-svn: 138496 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Currently getMacroArgExpandedLocation is very inefficient and for the case
of a location pointing at the main file it will end up checking almost all of
the SLocEntries. Make it faster:
-Use a map of macro argument chunks to their expanded source location. The map
 is for a single source file, it's stored in the file's ContentCache and lazily
 computed, like the source lines cache.
-In SLocEntry's FileInfo add an 'unsigned NumCreatedFIDs' field that keeps track
 of the number of FileIDs (files and macros) that were created during preprocessing
 of that particular file SLocEntry. This is useful when computing the macro argument
 map in skipping included files while scanning for macro arg FileIDs that lexed from
 a specific source file. Due to padding, the new field does not increase the size
 of SLocEntry.
llvm-svn: 138225 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | -import-module) vs. loaded because some other module depends on
them. As part of doing this, pass down the module that caused a module
to be loaded directly, rather than assuming that we're loading a
chain. Finally, write out all of the directly-loaded modules when
serializing an AST file (using the new IMPORTS record), so that an AST
file can depend on more than one other AST file, all of which will be
loaded when that AST file is loaded. This allows us to form and load a
tree of modules, but we can't yet load a DAG of modules.
llvm-svn: 137923 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | all AST files have a normal METADATA record that has the same form
regardless of whether we refer to a chained PCH or any other kind of
AST file.
Introduce the IMPORTS record, which describes all of the AST files
that are imported by this AST file, and how (as a module, a PCH file,
etc.). Currently, we emit at most one entry to this record, to support
chained PCH.
llvm-svn: 137869 | 
| | 
| 
| 
| 
| 
| | a macro arg expansion or not.
llvm-svn: 137792 | 
| | 
| 
| 
| 
| 
| 
| | in the AST format, which are built lazily by the ASTContext when
requested.
llvm-svn: 137437 |