summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTWriter.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* For modules, all macros that aren't include guards are implicitlyDouglas Gregor2011-10-171-3/+4
| | | | | | | public. Add a __private_macro__ directive to hide a macro, similar to the __module_private__ declaration specifier. llvm-svn: 142188
* Rename TagDecl::isDefinition -> isCompleteDefinitionJohn McCall2011-10-071-2/+2
| | | | | | | for better self-documenting code, since the semantics are subtly different from getDefinition(). llvm-svn: 141355
* Support for C1x _Atomic specifier (see testcase). This is primarily being ↵Eli Friedman2011-10-061-0/+12
| | | | | | | | 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
* Basic/Diagnostic: Add a DiagSate::getOrAddMappingInfo method.Daniel Dunbar2011-09-291-1/+1
| | | | | | - Also, spell const_iterator as const_iterator. llvm-svn: 140765
* Basic/Diagnostics: Add a DiagnosticMappingInfo helper class, and switch toDaniel Dunbar2011-09-291-4/+3
| | | | | | | storing mappings with that instead of straying some magic constants about the source. llvm-svn: 140760
* Rename Diagnostic to DiagnosticsEngine as per issue 5397David Blaikie2011-09-251-4/+4
| | | | llvm-svn: 140478
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-231-2/+2
| | | | llvm-svn: 140367
* [PCH] Don't store the source range for each preprocessed entity sinceArgyrios Kyrtzidis2011-09-201-8/+0
| | | | | | we already have the range in the PPEntityOffsets array. llvm-svn: 140209
* [PCH] Merge ASTReader::LoadPreprocessedEntity with ReadPreprocessedEntityArgyrios Kyrtzidis2011-09-201-4/+0
| | | | | | and don't store the ID for each preprocessed entity. llvm-svn: 140208
* The location of the name in MacroDefinition is the beginning of its range,Argyrios Kyrtzidis2011-09-201-1/+0
| | | | | | don't store an extra location for it. llvm-svn: 140190
* In libclang, when visiting preprocessed entities in a source range, useArgyrios Kyrtzidis2011-09-191-16/+1
| | | | | | | | | | 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
* Introduce local_begin()/local_end() methods in PreprocessingRecord whichArgyrios Kyrtzidis2011-09-191-3/+3
| | | | | | return iterators for local, non-loaded, preprocessed entities. llvm-svn: 140062
* Introduce PreprocessingRecord::getPreprocessedEntitiesInRange()Argyrios Kyrtzidis2011-09-191-2/+3
| | | | | | | | | | 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
* With modules, we can end up loading a new module after we've seen anDouglas Gregor2011-09-171-7/+69
| | | | | | | | | 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
* [PCH] Overhaul how preprocessed entities are [de]serialized.Argyrios Kyrtzidis2011-09-151-51/+23
| | | | | | | | | | | | | -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
* Don't try to write a macro offset for an identifier that names a ↵Douglas Gregor2011-09-141-17/+13
| | | | | | non-exported macro, for real this time llvm-svn: 139745
* Revert my exported-macro hackery. Something is amissDouglas Gregor2011-09-141-12/+13
| | | | llvm-svn: 139734
* Make sure that we actually keep the key length and data length in sync when ↵Douglas Gregor2011-09-141-14/+12
| | | | | | dealing with non-exported macros llvm-svn: 139731
* Don't try to write a macro offset for an identifier that names a ↵Douglas Gregor2011-09-141-1/+2
| | | | | | non-exported macro llvm-svn: 139728
* Switch the serialization of LangOptions over to use the .def file. WeDouglas Gregor2011-09-131-87/+5
| | | | | | | should no longer have the serialization of LangOptions out of sync with the structure itself (yay). llvm-svn: 139613
* Switch LangOptions over to a .def file that describes header of theDouglas Gregor2011-09-131-2/+2
| | | | | | | | | | 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
* Keep the source range of attributes. Depends on a llvm tablegen commit.Argyrios Kyrtzidis2011-09-131-1/+1
| | | | llvm-svn: 139600
* Eliminate all but one caller of Decl::getPCHLevel()Douglas Gregor2011-09-091-2/+0
| | | | llvm-svn: 139430
* Introduce a new predicate Decl::isFromASTFile() to determine whether aDouglas Gregor2011-09-091-14/+14
| | | | | | | | 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
* [libclang] Fix annotation and getting a "macro expansion" cursorArgyrios Kyrtzidis2011-09-081-2/+5
| | | | | | for a builtin macro expansion. llvm-svn: 139298
* Implement the Objective-C 'instancetype' type, which is an alias ofDouglas Gregor2011-09-081-0/+2
| | | | | | | | | | '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
* Finish implementing (de-)serialization of the CXXDefinitionData bitsDouglas Gregor2011-09-061-0/+4
| | | | | | | needed for implicit move constructors and move assignment operators. Fixes PR10847. llvm-svn: 139144
* Extend the ASTContext constructor to delay the initialization ofDouglas Gregor2011-09-021-1/+1
| | | | | | | | 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
* Modules hide macro definitions by default, so that silly things likeDouglas Gregor2011-09-011-32/+51
| | | | | | | | | | | 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
* Support importing of ObjC categories from modules.Argyrios Kyrtzidis2011-09-011-0/+34
| | | | | | | | | | | | 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
* Serialize the new bits in CXXRecordDecl::DefinitionData.Sebastian Redl2011-08-311-0/+2
| | | | llvm-svn: 138855
* When writing out the entries in a lookup table for a DeclContext, makeDouglas Gregor2011-08-301-1/+24
| | | | | | | | 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
* In ASTWriter::WriteDeclContextVisibleBlock, don't write empty lookups.Argyrios Kyrtzidis2011-08-301-2/+4
| | | | | | | 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
* Remove obsolete ObjCInferRelatedReturnType from LangOptions...the correct ↵Jordy Rose2011-08-301-1/+0
| | | | | | option is ObjCInferRelatedResultType. llvm-svn: 138793
* Don't force the complete deserialization of the visible-declarationsDouglas Gregor2011-08-241-3/+1
| | | | | | | | | | 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
* Boost the efficiency of SourceManager::getMacroArgExpandedLocation.Argyrios Kyrtzidis2011-08-211-0/+3
| | | | | | | | | | | | | | | | | | 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
* Keep track of which modules have been loaded directly (e.g., viaDouglas Gregor2011-08-181-15/+20
| | | | | | | | | | | | | -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
* In the AST file format, eliminate the CHAINED_METADATA record. Instead,Douglas Gregor2011-08-171-10/+22
| | | | | | | | | | | | | 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
* [PCH] When writing out ExpansionInfo, make sure we don't lose track if it's ↵Argyrios Kyrtzidis2011-08-171-1/+2
| | | | | | a macro arg expansion or not. llvm-svn: 137792
* Switch the __int128_t and __uint128_t types over to predefined typesDouglas Gregor2011-08-121-1/+4
| | | | | | | in the AST format, which are built lazily by the ASTContext when requested. llvm-svn: 137437
* Switch the Objective-C 'SEL' type over to a predefined type in theDouglas Gregor2011-08-121-1/+2
| | | | | | | AST file format, lazily generating the actual declaration in ASTContext as needed. llvm-svn: 137434
* Switch the Objective-C 'Class' type over to a predefined type in theDouglas Gregor2011-08-121-2/+3
| | | | | | | AST file format, lazily generating the actual declaration in ASTContext as needed. llvm-svn: 137431
* Move the creation of the predefined typedef for Objective-C's 'id'Douglas Gregor2011-08-121-2/+3
| | | | | | | | | type over into the AST context, then make that declaration a predefined declaration in the AST format. This ensures that different AST files will at least agree on the (global) declaration ID for 'id', and eliminates one of the "special" types in the AST file format. llvm-svn: 137429
* Collapse ASTWriter::WriteASTChain into ASTWriter::WriteASTCore,Douglas Gregor2011-08-121-306/+103
| | | | | | | | eliminating a pile of redundant code (and probably some bugs in the process). The variation between chained and non-chained PCH is fairly small now anyway. llvm-svn: 137410
* In the serialized AST format, make the translation unit a "predefined"Douglas Gregor2011-08-121-5/+46
| | | | | | | | | | declaration that never actually gets serialized. Instead, serialize the various kinds of update records (lexical decls, visible decls, the addition of an anonymous namespace) for the translation unit, even if we're not chaining. This way, we won't have to deal with multiple loaded translation unit declarations. llvm-svn: 137395
* The AST reader and writer don't need accessors for poking at the predefined ↵Douglas Gregor2011-08-111-4/+4
| | | | | | Objective-C types llvm-svn: 137366
* Renamings to consistently use 'Constexpr' not 'ConstExpr' when referring to ↵Richard Smith2011-08-101-1/+1
| | | | | | the C++0x 'constexpr' keyword. llvm-svn: 137230
* Move the creation of the record type for the state of Objective-C fastDouglas Gregor2011-08-091-1/+0
| | | | | | | | enumerations from the ASTContext into CodeGen, so that we don't need to serialize it to AST files. This appears to be the last of the low-hanging fruit for SpecialTypes. llvm-svn: 137124
* Don't serialize the block descriptor or block extended descriptorDouglas Gregor2011-08-091-2/+0
| | | | | | | types to AST files; they're only used by debug info generation anyway, and shouldn't ever exist in the AST anyway. llvm-svn: 137122
* Move the construction of the RecordDecl representing the runtimeDouglas Gregor2011-08-091-1/+0
| | | | | | | | layout of a constant NSString from the ASTContext over to CodeGen, since this is solely CodeGen's responsibility. Eliminates one of the unnecessary "special" types that we serialize. llvm-svn: 137121
OpenPOWER on IntegriCloud