summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization
Commit message (Collapse)AuthorAgeFilesLines
...
* Eliminate the redundancy between source-file information in the sourceDouglas Gregor2012-10-222-201/+174
| | | | | | | | | | manager block and input-file information in the control block. The source manager entries now point back into the control block. Input files are now lazily deserialized (if validation is disabled). Reduces Cocoa's PCH by the ~70k I added when I introduced the redundancy in r166251. llvm-svn: 166429
* ASTWriter.cpp: Fix a warning. [-Wunused-variable]NAKAMURA Takumi2012-10-191-2/+1
| | | | llvm-svn: 166257
* Describe the new input-files block and its record, for llvm-bcanalyzer.Douglas Gregor2012-10-191-0/+3
| | | | llvm-svn: 166252
* Move the set of files to be validated in an AST file into the controlDouglas Gregor2012-10-193-126/+190
| | | | | | | | | | | | | block, so the input files are validated early on, before we've committed to loading the AST file. This (accidentally) fixed a but wherein the main file used to generate the AST file would *not* be validated by the existing validation logic. At the moment, this leads to some duplication of filenames between the source manager block and input-file blocks, as well as validation logic. This will be handled via an upcoming patch. llvm-svn: 166251
* Move OriginalDir from ASTReader to ModuleFile.Douglas Gregor2012-10-181-18/+13
| | | | llvm-svn: 166233
* Move the "RelocatablePCH" bit from the ASTReader to the module file.Douglas Gregor2012-10-181-9/+9
| | | | llvm-svn: 166229
* Move information about the "original file" from the ASTReader into theDouglas Gregor2012-10-181-17/+21
| | | | | | module files. llvm-svn: 166228
* From Vassil Vassilev: enable Sema to deal with multiple ExternalSemaSources.Axel Naumann2012-10-181-1/+1
| | | | llvm-svn: 166208
* Collapse the original file name and original file ID records into aDouglas Gregor2012-10-182-19/+9
| | | | | | single record. llvm-svn: 166206
* Collapse the "version control revision/tag" AST file record into theDouglas Gregor2012-10-182-33/+35
| | | | | | | metadata record, which already had other version information. Clean up the block info block along the way. llvm-svn: 166204
* Split the target options out into their own record within the ASTDouglas Gregor2012-10-182-31/+39
| | | | | | file's control block. llvm-svn: 166195
* DR1442: In a range-based for statement, namespace 'std' is not an associatedRichard Smith2012-10-182-4/+0
| | | | | | namespace. llvm-svn: 166194
* Start factoring the on-disk records for an AST file into a controlDouglas Gregor2012-10-182-155/+230
| | | | | | | | | | | | | | | | | block, which stores information about how the AST file to generated, from the AST block, which stores the actual serialized AST. The information in the control block should be enough to determine whether the AST file is up-to-date and compatible with the current translation unit, and reading it should not cause any side effects that aren't easy to undo. That way, we can back out from an attempt to read an incompatible or out-of-date AST file. Note that there is still more factoring to do. In particular, information about the source files used to generate the AST file (along with their time stamps, sizes, etc.) still resides in the source manager block. llvm-svn: 166166
* Set a special flag in class metadata when an Objective-C classJohn McCall2012-10-172-0/+4
| | | | | | | | | has ivars that require destruction, but none that require anything except zero-initialization. This is common in ARC and (when true throughout a class hierarchy) permits the elimination of an unnecessary message-send during allocation. llvm-svn: 166088
* Serialize TargetOptions into an AST file, and make sure that we keepDouglas Gregor2012-10-162-23/+92
| | | | | | | target options around so they can be accessed at any point (rather than keeping them transient). llvm-svn: 166072
* Introduce the notion of excluded headers into the module mapDouglas Gregor2012-10-152-1/+33
| | | | | | | | description. Previously, one could emulate this behavior by placing the header in an always-unavailable submodule, but Argyrios guilted me into expressing this idea properly. llvm-svn: 165921
* [PCH] We only need to record C++ overridden methods once for the canonical decl.Argyrios Kyrtzidis2012-10-121-5/+10
| | | | llvm-svn: 165788
* Track which particular submodule #undef's a macro, so that the actualDouglas Gregor2012-10-122-10/+49
| | | | | | #undef only occurs if that submodule is imported. llvm-svn: 165773
* Diagnose the expansion of ambiguous macro definitions. This can happenDouglas Gregor2012-10-111-2/+21
| | | | | | | only with modules, when two disjoint modules #define the same identifier to different token sequences. llvm-svn: 165746
* Introduce a simple "hint" scheme to eliminate the quadratic behaviorDouglas Gregor2012-10-111-5/+7
| | | | | | associated with deserializing macro history for an identifier. llvm-svn: 165729
* Make the deserialization of PendingMacroIDs deterministic.Douglas Gregor2012-10-111-11/+9
| | | | llvm-svn: 165727
* [libclang] Improve AST serialization done by ASTUnit::Save().Argyrios Kyrtzidis2012-10-111-1/+1
| | | | | | | | | The ASTUnit needs to initialize an ASTWriter at the beginning of parsing to fully handle serialization of a translation unit that imports modules. Do this by introducing an option to enable it, which corresponds to CXTranslationUnit_ForSerialization on the C API side. llvm-svn: 165717
* Remove the ASTDeserializationListener's MacroVisible() callback, whichDouglas Gregor2012-10-112-18/+0
| | | | | | | is no longer necessary, as well as the little bit of infrastructure in the AST writer that used it. llvm-svn: 165684
* Remove an unused bit from the serialized IdentifierInfoDouglas Gregor2012-10-112-4/+0
| | | | llvm-svn: 165683
* Deserialize macro history when we deserialize an identifier that hasDouglas Gregor2012-10-112-76/+80
| | | | | | | | | | | | | | | | | | | | | | | | macro history. When deserializing macro history, we arrange history such that the macros that have definitions (that haven't been #undef'd) and are visible come at the beginning of the list, which is what the preprocessor and other clients of Preprocessor::getMacroInfo() expect. If additional macro definitions become visible later, they'll be moved toward the front of the list. Note that it's possible to have ambiguities, but we don't diagnose them yet. There is a partially-implemented design decision here that, if a particular identifier has been defined or #undef'd within the translation unit, that definition (or #undef) hides any macro definitions that come from imported modules. There's still a little work to do to ensure that the right #undef'ing happens. Additionally, we'll need to scope the update records for #undefs, so they only kick in when the submodule containing that update record becomes visible. llvm-svn: 165682
* Rename ObjCMethodDecl::isSynthesized to isPropertyAccessor.Jordan Rose2012-10-102-2/+2
| | | | | | | | | | | | | This more accurately reflects its use: this flag is set when a method matches the getter or setter name for a property in the same class, and does not actually specify whether or not the definition of the method will be synthesized (either implicitly or explicitly with @synthesize). This renames the setter and backing field as well, and changes the (soon-to-be-obsolete?) XML dump format to use 'property_accessor' instead of 'synthesized'. llvm-svn: 165626
* When indexing a module file, for the ppIncludedFile callback giveArgyrios Kyrtzidis2012-10-101-8/+10
| | | | | | | an invalid location if the location points to the synthetic buffer for the module input. llvm-svn: 165592
* [modules] Consistently construct a buffer as input to build the module.Argyrios Kyrtzidis2012-10-101-1/+1
| | | | | | This means the main file for modules will always be a virtual one. llvm-svn: 165591
* Rework the (de-)serialization of macros, as stored inDouglas Gregor2012-10-094-52/+240
| | | | | | | | | | | | | | | | MacroInfo*. Instead of simply dumping an offset into the current file, give each macro definition a proper ID with all of the standard modules-remapping facilities. Additionally, when a macro is modified in a subsequent AST file (e.g., #undef'ing a macro loaded from another module or from a precompiled header), provide a macro update record rather than rewriting the entire macro definition. This gives us greater consistency with the way we handle declarations, and ties together macro definitions much more cleanly. Note that we're still not actually deserializing macro history (we never were), but it's far easy to do properly now. llvm-svn: 165560
* Make the order of visitation of the pending bodies in the AST readerDouglas Gregor2012-10-091-2/+2
| | | | | | deterministic. llvm-svn: 165515
* When we load a function or method body from an AST file, we checkDouglas Gregor2012-10-092-15/+38
| | | | | | | | | | whether that function/method already has a body (loaded from some other AST file), as introduced in r165137. Delay this check until after the redeclaration chains have been wired up. While I'm here, make the loading of method bodies lazy. llvm-svn: 165513
* If a macro has been #undef'd in a precompiled header, we still need toDouglas Gregor2012-10-092-3/+4
| | | | | | | | | | | | write out the macro history for that macro. Similarly, we need to cope with reading a macro definition that has been #undef'd. Take advantage of this new ability so that global code-completion results can refer to #undef'd macros, rather than losing them entirely. For multiply defined/#undef'd macros, we will still get the wrong result, but it's better than getting no result. llvm-svn: 165502
* [Modules] Introduce Module::TopHeaders which is a set of top-level headersArgyrios Kyrtzidis2012-10-052-1/+28
| | | | | | that are associated with a (sub)module. llvm-svn: 165279
* Fixed FunctionTypeLoc source range.Abramo Bagnara2012-10-042-0/+4
| | | | llvm-svn: 165259
* Fix r165005: The lexical DeclContext is not the right place to make a ↵Axel Naumann2012-10-041-4/+6
| | | | | | decision about whether we need to call tryAddTopLevelDecl or not. That call should be made when the DeclContext's redeclaration context is the translation unit. llvm-svn: 165215
* Remove ASTReader::needPendingInstantiation(), introduced in r164993,Douglas Gregor2012-10-031-57/+0
| | | | | | | which is neither correct nor necessary. The use of this routine was eliminated by r165137. llvm-svn: 165139
* Add some FIXMEs to the ASTReader codeDouglas Gregor2012-10-031-0/+2
| | | | llvm-svn: 165138
* Revert most of the functionality in r165001. Instead, make sure thatDouglas Gregor2012-10-032-16/+7
| | | | | | | the ASTReader doesn't attach a body to a function that is already defined elsewhere. llvm-svn: 165137
* [PCH] Fix serialization of an ImportDecl.Argyrios Kyrtzidis2012-10-032-0/+2
| | | | | | | | ImportDecl's module ID was not written out and the reader accepted as module ID the serialized: Record.push_back(!IdentifierLocs.empty()); llvm-svn: 165087
* Set the file entry for a Module* that was created during deserializationArgyrios Kyrtzidis2012-10-033-3/+6
| | | | | | of a module file. llvm-svn: 165086
* [PCH/Module] Change the map of file-level DeclIDs to use a FileIDArgyrios Kyrtzidis2012-10-021-4/+5
| | | | | | | as key instead of a SLocEntry pointer. This allows the array of file sorted declarations in a PCH/module to be deterministic. llvm-svn: 165047
* [libclang] When indexing an AST file, only deserialize the file levelArgyrios Kyrtzidis2012-10-023-2/+13
| | | | | | declarations of the current primary module. llvm-svn: 165046
* [libclang] When indexing an AST file, only deserialize the preprocessing recordArgyrios Kyrtzidis2012-10-021-0/+10
| | | | | | entities of the current primary module. llvm-svn: 165023
* Add info in the preprocessing record whether an inclusion directiveArgyrios Kyrtzidis2012-10-022-1/+3
| | | | | | resulted in an automatic module import. llvm-svn: 165022
* Add redecls into their lexical DeclContext: this is what they assert on, and ↵Axel Naumann2012-10-021-1/+1
| | | | | | | | the merging should have set it correctly. This is especially relevant for templatedDecls that might be injected (and thus have their DeclContext set to) somewhere completely different. llvm-svn: 165005
* Only those InterestingDecls that got added to the AST should be passed to ↵Axel Naumann2012-10-022-2/+11
| | | | | | the ASTConsumer. llvm-svn: 165001
* Merge pending instantiations instead of overwriting existing ones.Axel Naumann2012-10-022-6/+69
| | | | | | | | | | | Check whether a pending instantiation needs to be instantiated (or whether an instantiation already exists). Verify the size of the PendingInstantiations record (was only checking size of existing PendingInstantiations). Migrate Obj-C++ part of redecl-merge into separate test, now that this is growing. templates.mm: test that CodeGen has seen exactly one definition of template instantiations. redecl-merge.m: use "@" specifier for expected-diagnostics. llvm-svn: 164993
* Add FP_CONTRACT support for clang.Lang Hames2012-10-022-0/+4
| | | | | | | | Clang will now honor the FP_CONTRACT pragma and emit LLVM fmuladd intrinsics for expressions of the form A * B + C (when they occur in a single statement). llvm-svn: 164989
* The Redeclarable part of named decls is read before their name.Axel Naumann2012-10-011-2/+4
| | | | | | | | Lookup can nevertheless find them due to the serialized lookup table. For instance when reading a template decl's templatedDecl, it will search for existing decls that it could be a redeclaration of, and find the half-read template decl. Thus there is no point in asserting the names of decls. llvm-svn: 164932
* Also merge template redeclarations.Axel Naumann2012-10-011-7/+13
| | | | | | Don't require specializations (of existing and read template) to be unique. llvm-svn: 164931
OpenPOWER on IntegriCloud