summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization
Commit message (Collapse)AuthorAgeFilesLines
...
* [modules] Make NamespaceAliasDecl redeclarable, as it should be. This fixesRichard Smith2014-09-033-10/+22
| | | | | | | merging of namespace aliases across modules and improves source fidelity. Incidentally also fixes PR20816. llvm-svn: 217103
* Use llvm::makeArrayRef instead of explicitly calling ArrayRef constructor ↵Craig Topper2014-08-302-4/+4
| | | | | | and mentioning the type. This works now that we have a conversion from ArrayRef<T*> to ArrayRef<const T*>. llvm-svn: 216824
* [modules] Fix deserialization cycle when loading a tag declaration with a ↵Richard Smith2014-08-302-59/+77
| | | | | | typedef name for linkage purposes. When loading the type, delay loading its typedef until we've finished loading and merging the type. In its place, save out the name of the typedef, which we need for merging purposes. llvm-svn: 216806
* unique_ptrify SourceManager::createFileIDDavid Blaikie2014-08-291-1/+1
| | | | llvm-svn: 216715
* [modules] When completing the redecl chain for an anonymous declaration in aRichard Smith2014-08-281-4/+14
| | | | | | | merged context, pull in the lexical decls in that context, since one of them may complete the redecl chain. llvm-svn: 216652
* [C++11] Support for capturing of variable length arrays in lambda expression.Alexey Bataev2014-08-283-4/+18
| | | | | | Differential Revision: http://reviews.llvm.org/D4368 llvm-svn: 216649
* [modules] Number anonymous declarations that are lexically within mergeableRichard Smith2014-08-286-20/+138
| | | | | | contexts, so that we can merge them when we merge the surrounding context. llvm-svn: 216639
* [modules] Add an assert that we properly manage the IsCompleteDefinition flagRichard Smith2014-08-273-3/+9
| | | | | | | | on CXXRecordDecls when merging definitions, and make it pass by not trying to save and restore this flag across AST serialization/deserialization. For CXXRecordDecls, we have a separate mechanism to manage this. llvm-svn: 216633
* Overload SourceManager::overrideFileContents so that unconditionally passing ↵David Blaikie2014-08-271-1/+1
| | | | | | | | | | ownership is explicitly done using unique_ptr. Only those callers who are dynamically passing ownership should need the 3 argument form. Those accepting the default ("do pass ownership") should do so explicitly with a unique_ptr now. llvm-svn: 216614
* Update for LLVM api change.Rafael Espindola2014-08-271-6/+6
| | | | llvm-svn: 216585
* [modules] Don't assert when merging virtual functions that override otherRichard Smith2014-08-261-5/+12
| | | | | | | functions. Also don't needlessly pull in non-canonical declarations of the overridden virtual functions. llvm-svn: 216503
* Return a std::unique_ptr from getBufferForFile. NFC.Rafael Espindola2014-08-263-9/+10
| | | | llvm-svn: 216476
* [modules] Track the described template in an alias declaration that is theRichard Smith2014-08-262-5/+13
| | | | | | | pattern of an alias template declaration. Use this to merge alias templates properly when they're members of class template specializations. llvm-svn: 216437
* Fix typo.Richard Smith2014-08-251-1/+1
| | | | llvm-svn: 216417
* Update for llvm api change.Rafael Espindola2014-08-251-4/+3
| | | | llvm-svn: 216397
* Use range based for loops to avoid needing to re-mention SmallPtrSet size.Craig Topper2014-08-251-8/+6
| | | | llvm-svn: 216370
* [modules] Fix false report of an ODR violation when merging friendRichard Smith2014-08-251-1/+3
| | | | | | | | | | declarations. We can't expect to find them in the canonical definition of the class, because that's not where they live. This means we no longer reject real ODR violations with friend declarations, but we weren't consistently doing so anyway. llvm-svn: 216369
* [modules] When merging a tag declaration that has a typedef name for linkageRichard Smith2014-08-231-7/+66
| | | | | | | purposes, look for other typedefs with that same name and merge into their named tag declaration if there is one. llvm-svn: 216312
* [OPENMP] Extract common superclass from all the loop directives. No ↵Alexander Musman2014-08-192-24/+20
| | | | | | functional changes (having common superclass is convenient for future loop directives CodeGen implementation) llvm-svn: 215975
* Fix the rececl chain for redeclarations of predefined declsBen Langmuir2014-08-181-0/+2
| | | | | | | | | Predefined decls like 'Protocol' in objc are not loaded from AST files, so we cannot rely on loading the canonical decl to complete the redecl chain for redeclarations of these decls. The broken redecl chain was non-circular, so looping over redecls() would hang. llvm-svn: 215929
* Store std::unique_ptr in InMemoryBuffers. NFC.Rafael Espindola2014-08-181-11/+12
| | | | llvm-svn: 215928
* Repace SmallPtrSet with SmallPtrSetImpl in function arguments to avoid ↵Craig Topper2014-08-172-5/+5
| | | | | | needing to mention the size. llvm-svn: 215869
* When loading a module with no local entities, still bump the size of theBen Langmuir2014-08-162-16/+28
| | | | | | | | | | | | | | | | | tables that correspond to ContinuousRangeMaps, since the keys to those maps need to be unique, or we may map to the wrong offset. This fixes a crash + malformed AST file seen when loading some modules that import Cocoa on Darwin, which is a module with no contents except imports of other modules. Unfortunately I have not been able to find a reduced test case that reproduces this problem. Also add an assert that we aren't mapping one key to multiple values in CRM. We ought to be able to say there are no duplicate keys at all, but there are a bunch of 0 -> 0 mappings that are showing up, probably coming from the source location table. llvm-svn: 215810
* [modules] Turn off a broken optimization: we need to pick up implicit specialRichard Smith2014-08-141-2/+5
| | | | | | | members from all redefinitions of a class that have them, in case the special member is defined in one module but only declared in another. llvm-svn: 215675
* [modules] Don't assert if the same imported class template specializationRichard Smith2014-08-141-2/+13
| | | | | | | declaration has its definition instantiated in two sibling modules and they use a partial specialization. llvm-svn: 215616
* [modules] When we merge together multiple class template specializationRichard Smith2014-08-142-28/+61
| | | | | | | | | | definitions (because some other declaration declares a special member that isn't present in the canonical definition), we need to search *all* of them; we can't just stop when we find the requested name in any of the definitions, because that can fail to find things (and in particular, it can fail to find the member of the canonical declaration and return a bogus ODR failure). llvm-svn: 215612
* Header guard canonicalization, clang part.Benjamin Kramer2014-08-132-4/+4
| | | | | | Modifications made by clang-tidy with minor tweaks. llvm-svn: 215557
* [modules] When performing a lookup into a namespace, ensure that any laterRichard Smith2014-08-133-23/+38
| | | | | | | | | | redefinitions of that namespace have already been loaded. When writing out the names in a namespace, if we see a name that is locally declared and had imported declarations merged on top of it, export the local declaration as the lookup result, because it will be the most recent declaration of that entity in the redeclaration chain of an importer of the module. llvm-svn: 215518
* Verify all the module map files for a pcm are the same on loadBen Langmuir2014-08-122-52/+111
| | | | | | | | | | We already verified the primary module map file (either the one that defines the top-level module, or the one that allows inferring it if it is an inferred framework module). Now we also verify any other module map files that define submodules, such as when there is a module.private.modulemap file. llvm-svn: 215455
* Correctly implement -include search logic.Manuel Klimek2014-08-121-4/+2
| | | | | | | | | | | | | | | According to the gcc docs, -include uses the current working directory for the lookup instead of the main source file. This patch gets rid of NormalizeIncludePath (which relied on an implementation detail of FileManager / FileEntry for the include path logic to work), and instead hands the correct lookup information down to LookupFile. This will allow us to change the FileEntry's behavior regarding its Name caching. llvm-svn: 215433
* unique_ptr-ify the MemoryBuffer parameter of GlobalModuleIndexDavid Blaikie2014-08-111-5/+4
| | | | llvm-svn: 215376
* Add some FIXMEs.Richard Smith2014-08-111-0/+2
| | | | llvm-svn: 215375
* Refactor the module map file used for uniquing a module name out ofBen Langmuir2014-08-092-14/+15
| | | | | | | | | class Module. It's almost always going to be the same as getContainingModule() for top-level modules, so just add a map to cover the remaining cases. This lets us do less bookkeeping to keep the ModuleMap fields up to date. llvm-svn: 215268
* [modules] Don't defer performing updates if we have incomplete redecl chains.Richard Smith2014-08-072-25/+39
| | | | | | Instead, perform them carefully immediately. llvm-svn: 215147
* [modules] When emitting an update record containing the body of a destructor,Richard Smith2014-08-073-14/+17
| | | | | | | | | also emit the updated 'operator delete' looked up for that destructor. Switch from UpdateDecl to an actual update record when this happens due to implicitly defining a special member function and unify this code path and the one for instantiating a function definition. llvm-svn: 215132
* Use -Rblah, not -Wblah, to control remark diagnostics. This was always theRichard Smith2014-08-072-2/+6
| | | | | | | | | | | | | | | | | | | | | | intent when we added remark support, but was never implemented in the general case, because the first -R flags didn't need it. (-Rpass= had special handling to accomodate its argument.) -Rno-foo, -Reverything, and -Rno-everything can be used to turn off a remark, or to turn on or off all remarks. Per discussion on cfe-commits, -Weverything does not affect remarks, and -Reverything does not affect warnings or errors. The only "real" -R flag we have right now is -Rmodule-build; that flag is effectively renamed from -Wmodule-build to -Rmodule-build by this change. -Wpass and -Wno-pass (and their friends) are also renamed to -Rpass and -Rno-pass by this change; it's not completely clear whether we intended to have a -Rpass (with no =pattern), but that is unchanged by this commit, other than the flag name. The default pattern is effectively one which matches no passes. In future, we may want to make the default pattern be .*, so that -Reverything works for -Rpass properly. llvm-svn: 215046
* Objective-C ARC. First patch toward generating new APIsFariborz Jahanian2014-08-062-0/+4
| | | | | | | for Objective-C's array and dictionary literals. rdar://17554063. This is wip. llvm-svn: 214983
* [modules] Remove IRGen special case for emitting implicit special members ifRichard Smith2014-08-011-0/+2
| | | | | | | | | | | they're somehow missing a body. Looks like this was left behind when the loop was generalized, and it's not been problematic before because without modules, a used, implicit special member function declaration must be a definition. This was resulting in us trying to emit a constructor declaration rather than a definition, and producing a constructor missing its member initializers. llvm-svn: 214473
* Fix buildbot: work around missing GCC C++11 feature.Richard Smith2014-07-311-0/+2
| | | | llvm-svn: 214459
* [modules] Maintain an AST invariant across module load/save: if any declarationRichard Smith2014-07-311-42/+113
| | | | | | | | | | | | | | | of a function has a resolved exception specification, then all declarations of the function do. We should probably improve the AST representation to make this implicit (perhaps only store the exception specification on the canonical declaration), but this fixes things for now. The testcase for this (which used to assert) also exposes the actual bug I was trying to reduce here: we sometimes fail to emit the body of an imported special member function definition. Fix for that to follow. llvm-svn: 214458
* Factor out exception specification information fromRichard Smith2014-07-312-15/+14
| | | | | | | | FunctionProtoType::ExtProtoInfo. Most of the users of these fields don't care about the other ExtProtoInfo bits and just want to talk about the exception specification. llvm-svn: 214450
* [modules] Factor out ODR checking, to avoid unnecessary repeated work inRichard Smith2014-07-291-75/+85
| | | | | | finishPendingActions loop. llvm-svn: 214246
* [modules] PR20475: merging support for alias template declarations.Richard Smith2014-07-281-0/+3
| | | | llvm-svn: 214124
* [modules] Add some missing record names. We really should be generating this ↵Richard Smith2014-07-271-2/+8
| | | | | | from a .def file or similar... llvm-svn: 214049
* [modules] Add abbreviation for ImplicitCastExpr. This is the most commonRichard Smith2014-07-273-3/+26
| | | | | | record type in LLVM's IR module. llvm-svn: 214048
* [modules] Improve abbreviations for C++:Richard Smith2014-07-263-46/+169
| | | | | | | | | | | | | | | | | * Add abbreviation for CXXMethodDecl and for FunctionProtoType. These come up a *lot* in C++ modules. * Allow typedef declarations to use the abbreviation if they're class members, or if they're used. In passing, add more record name records for Clang AST node kinds. The downside is that we had already used up our allotment of 12 abbreviations, so this pushes us to an extra bit on each record to support the extra abbrev kinds, which increases file size by ~1%. This patch *barely* pays for that through the other improvements, but we've got room for another 18 abbrevs, so we should be able to make it much more profitable with future changes. llvm-svn: 214024
* [modules] Substantially improve handling of #undef:Richard Smith2014-07-252-137/+198
| | | | | | | | | | * Track override set across module load and save * Track originating module to allow proper re-export of #undef * Make override set properly transitive when it picks up a #undef This fixes nearly all of the remaining macro issues with self-host. llvm-svn: 213922
* [OPENMP] Initial parsing and sema analysis for clause 'seq_cst' of 'atomic' ↵Alexey Bataev2014-07-242-0/+7
| | | | | | directive. llvm-svn: 213846
* [OPENMP] Initial parsing and sema analysis for clause 'capture' in 'atomic' ↵Alexey Bataev2014-07-242-0/+7
| | | | | | directive. llvm-svn: 213842
* [OPENMP] Initial parsing and sema analysis for 'update' clause of 'atomic' ↵Alexey Bataev2014-07-232-0/+7
| | | | | | directive. llvm-svn: 213735
OpenPOWER on IntegriCloud