summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization
Commit message (Collapse)AuthorAgeFilesLines
...
* finish converting the normal cases in ASTReader to use the new ↵Chris Lattner2013-01-201-202/+147
| | | | | | BitstreamCursor APIs. llvm-svn: 172937
* convert some more stuff over to use new cursor APIs.Chris Lattner2013-01-201-37/+34
| | | | llvm-svn: 172932
* switch a bunch of ASTReader to use the new BitstreamCursor::advance* methods,Chris Lattner2013-01-191-162/+145
| | | | | | | which hide a bunch of private details of the cursor from clients and simplify their code. More to come. llvm-svn: 172922
* libclangSerialization also depends on the bitreader.Benjamin Kramer2013-01-191-0/+2
| | | | llvm-svn: 172910
* [PCH/Modules] Revert r172843, it caused a module to fail building.Argyrios Kyrtzidis2013-01-192-41/+44
| | | | llvm-svn: 172884
* Remove unused variableMatt Beaumont-Gay2013-01-181-1/+0
| | | | llvm-svn: 172862
* [PCH/Modules] Re-apply r172620 and r172629, now with 100% less infinite loops!Argyrios Kyrtzidis2013-01-182-44/+42
| | | | | | | | | Makes sure that a deserialized macro is only added to the preprocessor macro definitions only once. Unfortunately I couldn't get a reduced test case. rdar://13016031 llvm-svn: 172843
* [ubsan] Add support for -fsanitize-blacklistWill Dietz2013-01-182-0/+4
| | | | llvm-svn: 172808
* Revert Clang r172620 and r172629, which caused a hang when buildingDouglas Gregor2013-01-182-30/+56
| | | | | | | complicated modules (<rdar://problem/13038265>). Unfortunately, this un-fixes <rdar://problem/13016031>. llvm-svn: 172783
* Rework the traversal of Objective-C categories and extensions toDouglas Gregor2013-01-163-11/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | consider (sub)module visibility. The bulk of this change replaces myriad hand-rolled loops over the linked list of Objective-C categories/extensions attached to an interface declaration with loops using one of the four new category iterator kinds: visible_categories_iterator: Iterates over all visible categories and extensions, hiding any that have their "hidden" bit set. This is by far the most commonly used iterator. known_categories_iterator: Iterates over all categories and extensions, ignoring the "hidden" bit. This tends to be used for redeclaration-like traversals. visible_extensions_iterator: Iterates over all visible extensions, hiding any that have their "hidden" bit set. known_extensions_iterator: Iterates over all extensions, whether they are visible to normal name lookup or not. The effect of this change is that any uses of the visible_ iterators will respect module-import visibility. See the new tests for examples. Note that the old accessors for categories and extensions are gone; there are *Raw() forms for some of them, for those (few) areas of the compiler that have to manipulate the linked list of categories directly. This is generally discouraged. Part two of <rdar://problem/10634711>. llvm-svn: 172665
* [PCH/Modules] The iterator may become invalidated because a new macro can be ↵Argyrios Kyrtzidis2013-01-161-2/+4
| | | | | | | | | | added while deserializing a macro, make sure to copy/move what we need from it. Fixes clang-x86_64-debian-fast bot. llvm-svn: 172629
* [PCH/Modules] Change how macro [re]definitions are de/serialized.Argyrios Kyrtzidis2013-01-162-56/+28
| | | | | | | | | | | | | | | | | | Previously we would serialize the macro redefinitions as a list, part of the identifier, and try to chain them together across modules individually without having the info that they were already chained at definition time. Change this by serializing the macro redefinition chain and then try to synthesize the chain parts across modules. This allows us to correctly pinpoint when 2 different definitions are ambiguous because they came from unrelated modules. Fixes bogus "ambiguous expansion of macro" warning when a macro in a PCH is redefined without undef'ing it first. rdar://13016031 llvm-svn: 172620
* Fix CastingDavid Greene2013-01-151-1/+1
| | | | | | Make the const_cast explicit to silence a compiler warning. llvm-svn: 172560
* Implement parsing, AST, (de-)serialization, and placeholder globalDouglas Gregor2013-01-142-1/+33
| | | | | | | | | | | | | | | | | | | | | | | | | metadata for linking against the libraries/frameworks for imported modules. The module map language is extended with a new "link" directive that specifies what library or framework to link against when a module is imported, e.g., link "clangAST" or link framework "MyFramework" Importing the corresponding module (or any of its submodules) will eventually link against the named library/framework. For now, I've added some placeholder global metadata that encodes the imported libraries/frameworks, so that we can test that this information gets through to the IR. The format of the data is still under discussion. llvm-svn: 172437
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-124-23/+23
| | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
* Provide Decl::getOwningModule(), which determines the (sub)module inDouglas Gregor2013-01-121-1/+5
| | | | | | | | | | | | | which a particular declaration resides. Use this information to customize the "definition of 'blah' must be imported from another module" diagnostic with the module the user actually has to import. Additionally, recover by importing that module, so we don't complain about other names in that module. Still TODO: coming up with decent Fix-Its for these cases, and expand this recovery approach for other name lookup failures. llvm-svn: 172290
* [PCH] Make the const_cast explicit to silence a compiler warning.Argyrios Kyrtzidis2013-01-111-1/+2
| | | | | | Patch by David Greene. llvm-svn: 172262
* Truth in advertising: LocallyScopedExternalDecls actually only containsRichard Smith2013-01-102-17/+17
| | | | | | external declarations with C language linkage. llvm-svn: 172150
* [PCH] (De)serialize the end location of MacroInfo.Argyrios Kyrtzidis2013-01-072-0/+2
| | | | llvm-svn: 171772
* updateOutOfDateIdentifier() can cause the identifier table to beDouglas Gregor2013-01-071-2/+10
| | | | | | | | rehashed, invaliding the iterator walking through the identifier table. Separate out the identification of out-of-date identifiers from updating them. llvm-svn: 171756
* 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
OpenPOWER on IntegriCloud