summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization
Commit message (Collapse)AuthorAgeFilesLines
* Move the common source locations of CastStmt & DefaultStmt into their base ↵Argyrios Kyrtzidis2013-01-042-8/+4
| | | | | | class, SwitchCase. llvm-svn: 171483
* [PCH/Modules] In ASTReader::completeVisibleDeclsMap, make sure to visit allArgyrios Kyrtzidis2012-12-191-4/+7
| | | | | | | | | | modules when getting the decls for a namespace or translation unit. Otherwise the code-completion results will not be complete. rdar://12889089 llvm-svn: 170596
* PR13470: Ensure that copy-list-initialization isntantiates asRichard Smith2012-12-192-0/+2
| | | | | | | | | | | | copy-list-initialization (and doesn't add an additional copy step): Fill in the ListInitialization bit when creating a CXXConstructExpr. Use it when instantiating initializers in order to correctly handle instantiation of copy-list-initialization. Teach TreeTransform that function arguments are initializations, and so need this special treatment too. Finally, remove some hacks which were working around SubstInitializer's shortcomings. llvm-svn: 170489
* Change DeclContextLookup(Const)Result to (Mutable)ArrayRef<NamedDecl*>, as ↵David Blaikie2012-12-193-16/+17
| | | | | | | | | | | | | | | per review discussion in r170365 This does limit these typedefs to being sequences, but no current usage requires them to be contiguous (we could expand this to a more general iterator pair range concept at some point). Also, it'd be nice if SmallVector were constructible directly from an ArrayRef but this is a bit tricky since ArrayRef depends on SmallVectorBaseImpl for the inverse conversion. (& generalizing over all range-like things, while nice, would require some nontrivial SFINAE I haven't thought about yet) llvm-svn: 170482
* Re-commit r170428 changes with Linux style file endings.Guy Benyei2012-12-182-0/+12
| | | | | | Add OpenCL images as clang builtin types. llvm-svn: 170432
* Revert changes from r170428, as I accidentally changed the line endings of ↵Guy Benyei2012-12-182-7084/+7072
| | | | | | these files to Windows style. llvm-svn: 170431
* Add OpenCL images as clang builtin types.Guy Benyei2012-12-182-7072/+7084
| | | | llvm-svn: 170428
* [PCH] Make the new PCH format (control block) backwards compatible andArgyrios Kyrtzidis2012-12-132-0/+16
| | | | | | | | | | | | don't crash when loading a PCH with the older format. The introduction of the control block broke compatibility with PCHs from older versions. This patch allows loading (and rejecting) PCHs from an older version and allows newer PCHs to be rejected from older clang versions as well. rdar://12821386 llvm-svn: 170150
* [PCH] Remove redundant stat call when validating the input files.Argyrios Kyrtzidis2012-12-111-11/+2
| | | | | | This became redundant after we removed the stat cache. llvm-svn: 169830
* [PCH] When writing out the list of input files, avoid emitting duplicateArgyrios Kyrtzidis2012-12-111-1/+6
| | | | | | | | | entries of the same file. This can happen because the file was "included" multiple times and is referenced by multiple SLocEntries. llvm-svn: 169829
* Finish implementing 'selected constructor' rules for triviality in C++11. InRichard Smith2012-12-082-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | the cases where we can't determine whether special members would be trivial while building the class, we eagerly declare those special members. The impact of this is bounded, since it does not trigger implicit declarations of special members in classes which merely *use* those classes. In order to determine whether we need to apply this rule, we also need to eagerly declare move operations and destructors in cases where they might be deleted. If a move operation were supposed to be deleted, it would instead be suppressed, and we could need overload resolution to determine if we fall back to a trivial copy operation. If a destructor were implicitly deleted, it would cause the move constructor of any derived classes to be suppressed. As discussed on cxx-abi-dev, C++11's selected constructor rules are also retroactively applied as a defect resolution in C++03 mode, in order to identify that class B has a non-trivial copy constructor (since it calls A's constructor template, not A's copy constructor): struct A { template<typename T> A(T &); }; struct B { mutable A a; }; llvm-svn: 169673
* Implement C++03 [dcl.init]p5's checking for value-initialization of referencesRichard Smith2012-12-082-0/+2
| | | | | | | | properly, rather than faking it up by pretending that a reference member makes the default constructor non-trivial. That leads to rejects-valids when putting such types inside unions. llvm-svn: 169662
* Add a bit on FunctionDecl/ObjCMethodDecl to indicate if there was a bodyArgyrios Kyrtzidis2012-12-062-0/+4
| | | | | | that was skipped by the parser. llvm-svn: 169531
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-049-43/+44
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* Refactor recording the preprocessor conditional directive regions out ofArgyrios Kyrtzidis2012-12-041-2/+2
| | | | | | | | | PreprocessingRecord and into its own class, PPConditionalDirectiveRecord. Decoupling allows a client to use the functionality of PPConditionalDirectiveRecord without needing a PreprocessingRecord. llvm-svn: 169229
* When we're emitting a diagnostic with a source location in an importedDouglas Gregor2012-11-301-0/+19
| | | | | | | | | | | | | | module, provide a module import stack similar to what we would get for an include stack, e.g., In module 'DependsOnModule' imported from build-fail-notes.m:4: In module 'Module' imported from DependsOnModule.framework/Headers/DependsOnModule.h:1: Inputs/Module.framework/Headers/Module.h:15:12: note: previous definition is here @interface Module <rdar://problem/12696425> llvm-svn: 169042
* Actually keep track of the source locations at which particular moduleDouglas Gregor2012-11-302-6/+11
| | | | | | files are loaded. llvm-svn: 169027
* Refactor to reduce duplication in handling of special member functions. No ↵Richard Smith2012-11-302-36/+8
| | | | | | functionality change. llvm-svn: 168977
* Store on the CXXRecordDecl whether the class has, or would have, a copyRichard Smith2012-11-282-0/+8
| | | | | | | constructor/assignment operator with a const-qualified parameter type. The prior method for determining this incorrectly used overload resolution. llvm-svn: 168775
* Introduce ASTUnresolvedSet, an UnresolvedSet-like class, whose contents areArgyrios Kyrtzidis2012-11-283-5/+6
| | | | | | | | | | | allocated using the allocator associated with an ASTContext. Use this inside CXXRecordDecl::DefinitionData instead of an UnresolvedSet to avoid a potential memory leak. rdar://12761275 llvm-svn: 168771
* [modules] Use a memory buffer directly as input for the module includes,Argyrios Kyrtzidis2012-11-152-0/+9
| | | | | | instead of messing with virtual files. llvm-svn: 168062
* [modules] Setup the import location of a module file and use itArgyrios Kyrtzidis2012-11-152-9/+31
| | | | | | as the include location of the main file of an imported module. llvm-svn: 168061
* Suppress elided variadic macro argument extension diagnostic for macros usingEli Friedman2012-11-142-0/+3
| | | | | | | | | | | | | | | | | | | | | | the related comma pasting extension. In certain cases, we used to get two diagnostics for what is essentially one extension. This change suppresses the first diagnostic in certain cases where we know we're going to print the second diagnostic. The diagnostic is redundant, and it can't be suppressed in the definition of the macro because it points at the use of the macro, so we want to avoid printing it if possible. The implementation works by detecting constructs which look like comma pasting at the time of the definition of the macro; this information is then used when the macro is used. (We can't actually detect whether we're using the comma pasting extension until the macro is actually used, but we can detecting constructs which will be comma pasting if the varargs argument is elided.) <rdar://problem/12292192> llvm-svn: 167907
* Add a FileCharacteristic parameter to SourceManager::createFileIDForMemBufferArgyrios Kyrtzidis2012-11-091-2/+4
| | | | | | | for completeness and use it in CompilerInstance::InitializeSourceManager if the input is a memory buffer. llvm-svn: 167628
* Allow to pass from syntactic form of InitListExpr to semantic form (just as ↵Abramo Bagnara2012-11-082-1/+4
| | | | | | viceversa). No functionality change. llvm-svn: 167591
* When loading a module fails because it is out of date, rebuild thatDouglas Gregor2012-11-072-9/+53
| | | | | | module in place. <rdar://problem/10138913> llvm-svn: 167539
* PR13552: Fix the end location of a CXXNewExpr.David Blaikie2012-11-072-2/+2
| | | | | | | | | Spent longer than reasonable looking for a nice way to test this & decided to give up for now. Open to suggestions/requests. Richard Smith suggested adding something to ASTMatchers but it wasn't readily apparent how to test this with that. llvm-svn: 167507
* Tease out the routine that reads the control block of an AST file fromDouglas Gregor2012-11-061-26/+34
| | | | | | the validation of an AST file against a specific set of options. llvm-svn: 167504
* [PCH] Take into account the 'include' source location of a SM_SLOC_BUFFER_ENTRY.Argyrios Kyrtzidis2012-11-061-1/+3
| | | | llvm-svn: 167426
* [PCH] Write out the ClassTemplateDecl::Common::InjectedClassNameType typeArgyrios Kyrtzidis2012-11-062-3/+3
| | | | | | | | | | | | | | | | | reference instead of relying on computing it. In general, if storage is no issue, it is preferable to deserialize info from the PCH instead of trying to recompute it after the PCH was loaded. The incentive to change this now was due to r155303 changing how friend template classes in dependent contexts are handled; such classes can now be chained to a previous template class but the computed InjectedClassNameType may be different due to the extra template parameters from the dependent context. The new handling requires more investigation but, in the meantime, writing out InjectedClassNameType fixes PCH issue in rdar://12627738. llvm-svn: 167425
* [libclang] Correct how the index inside the local preprocessed entities arrayArgyrios Kyrtzidis2012-11-021-5/+3
| | | | | | is getting converted to a global PreprocessedEntityID. llvm-svn: 167280
* [PCH] Remove the stat cache from the PCH file.Argyrios Kyrtzidis2012-10-314-169/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The stat cache became essentially useless ever since we started validating all file entries in the PCH. But the motivating reason for removing it now is that it also affected correctness in this situation: -You have a header without include guards (using "#pragma once" or #import) -When creating the PCH: -The same header is referenced in an #include with different filename cases. -In the PCH, of course, we record only one file entry for the header file -But we cache in the PCH file the stat info for both filename cases -Then the source files are updated and the header file is updated in a way that its size and modification time are the same but its inode changes -When using the PCH: -We validate the headers, we check that header file and we create a file entry with its current inode -There's another #include with a filename with different case than the previously created file entry -In order to get its stat info we go through the cached stat info of the PCH and we receive the old inode -because of the different inodes, we think they are different files so we go ahead and include its contents. Removing the stat cache will potentially break clients that are attempting to use the stat cache as a way of avoiding having the actual input files available. If that use case is important, patches are welcome to bring it back in a way that will actually work correctly (i.e., emit a PCH that is self-contained, coping with literal strings, line/column computations, etc.). This fixes rdar://5502805 llvm-svn: 167172
* getOriginalSourceFileName and getOriginalSourceFile can return a StringRef.Rafael Espindola2012-10-301-6/+5
| | | | | | | MaybeAddSystemRootToFilename doesn't need to return anything, it modifies its argument. llvm-svn: 166988
* [PCH] The diagnostic state points can refer to previously createdArgyrios Kyrtzidis2012-10-302-14/+37
| | | | | | | | | diagnostic states; make sure the ASTReader sets the diagnostic state properly instead of always recreating it. Fixes rdar://12581618 & http://llvm.org/PR14181 llvm-svn: 166987
* Remove the old predefines-buffer diffing code completely. It's beenDouglas Gregor2012-10-251-332/+1
| | | | | | | replaced by the more efficient, cleaner preprocessor-option version that occurs earlier in PCH validation. llvm-svn: 166654
* Fix computation of predefines buffer from the preprocessor-optionDouglas Gregor2012-10-251-10/+1
| | | | | | checking, and disable the old predefines-buffer-diff'ing code path. llvm-svn: 166653
* The the preprocessor option validator to compute suggestedDouglas Gregor2012-10-251-14/+72
| | | | | | | predefines. We're not quite ready to cut over to these suggested predefines yet, however. llvm-svn: 166648
* Teach the PCH validator to check the preprocessor options, especiallyDouglas Gregor2012-10-242-6/+129
| | | | | | | | | | | | | | | the macros that are #define'd or #undef'd on the command line. This checking happens much earlier than the current macro-definition checking and is far cleaner, because it does a direct comparison rather than a diff of the predefines buffers. Moreover, it allows us to use the result of this check to skip over PCH files within a directory that have non-matching -D's or -U's on the command line. Finally, it improves the diagnostics a bit for mismatches, fixing <rdar://problem/8612222>. The old predefines-buffer diff'ing will go away in a subsequent commit. llvm-svn: 166641
* (De-)serialize the preprocessor options, including macros defined,Douglas Gregor2012-10-242-3/+75
| | | | | | -include'd files, etc. llvm-svn: 166614
* (De-)serialize header search options.Douglas Gregor2012-10-242-2/+101
| | | | llvm-svn: 166586
* (De-)serialize the file system options.Douglas Gregor2012-10-242-1/+27
| | | | llvm-svn: 166577
* Serialize DiagnosticOptions to the AST file.Douglas Gregor2012-10-242-0/+45
| | | | llvm-svn: 166572
* If the precompiled header named by "-include" is actually a directory,Douglas Gregor2012-10-231-82/+235
| | | | | | | | | check each of the files within that directory to determine if any of them is an AST file that matches the language and target options. If so, the first matching AST file is loaded. This fixes a longstanding discrepency with GCC's precompiled header implementation. llvm-svn: 166469
* Allow clients of the AST reader to specify what kinds of AST loadDouglas Gregor2012-10-221-62/+108
| | | | | | | | | | failures they know how to tolerate, e.g., out-of-date input files or configuration/version mismatches. Suppress the corresponding diagnostics if the client can handle it. No clients actually use this functionality, yet. llvm-svn: 166449
* Collapse ASTReader::ReadSLocEntryRecord() into its only caller,Douglas Gregor2012-10-221-8/+3
| | | | | | ReadSLocEntry(). No functionality change. llvm-svn: 166447
* Distinguish the various kinds of AST file loading failures:Douglas Gregor2012-10-221-112/+90
| | | | | | | | file corruption, compiler version mismatch, target/language configuration mismatch, out-of-date AST file. No functionality change yet. llvm-svn: 166446
* ASTReader.cpp: Fix a warning. [-Wunused-variable]NAKAMURA Takumi2012-10-221-0/+1
| | | | llvm-svn: 166442
* 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
OpenPOWER on IntegriCloud