summaryrefslogtreecommitdiffstats
path: root/include/clang/Serialization
Commit message (Collapse)AuthorAgeFilesLines
* Objective-C: Serialize "more than one decl" state of ObjCMethodList.Nico Weber2014-12-271-1/+1
| | | | | | | | | | | | | | | | | | This fixes PR21587, what r221933 fixed for regular programs is now also fixed for decls coming from PCH files. Use another bit from the count/bits uint16_t for storing the "more than one decl" bit. This reduces the number of bits for the count from 14 to 13. The selector with the most overloads in Cocoa.h has ~55 overloads, so 13 bits should still be plenty. Since this changes the meaning of a serialized bit pattern, also increase clang::serialization::VERSION_MAJOR. Storing the "more than one decl" state of only the first overload isn't quite correct, but Sema::AreMultipleMethodsInGlobalPool() currently only looks at the state of the first overload so it's good enough for now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224892 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] Instead of storing absolute paths in a .pcm file, store the path toRichard Smith2014-12-054-13/+34
| | | | | | | | | | | | | | | | the root of the module and use paths relative to that directory wherever possible. This is a step towards allowing explicit modules to be relocated without being rebuilt, which is important for some kinds of distributed builds, for good paths in diagnostics, and for appropriate .d output. This is a recommit of r223443, reverted in r223465; when joining together imported file paths, we now use the system's separator rather than always using '/'. This avoids path mismatches between the original module build and the module user on Windows (at least, in some cases). A more comprehensive fix will follow. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223539 91177308-0d34-0410-b5e6-96231b3b80d8
* Temporarily reverting r223443 due to bot breakage.Aaron Ballman2014-12-054-34/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223465 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] Instead of storing absolute paths in a .pcm file, store the path toRichard Smith2014-12-054-13/+34
| | | | | | | | | | the root of the module and use paths relative to that directory wherever possible. This is a step towards allowing explicit modules to be relocated without being rebuilt, which is important for some kinds of distributed builds, for good paths in diagnostics, and for appropriate .d output. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223443 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTReader] Add a convenience function to retrieve all the input files of a ↵Argyrios Kyrtzidis2014-11-181-0/+4
| | | | | | module file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222224 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Codegen for threadprivate variablesAlexey Bataev2014-11-111-0/+1
| | | | | | | | | | For all threadprivate variables which have constructor/destructor emit call to void __kmpc_threadprivate_register(ident_t * <Current Location>, void *<Original Global Addr>, kmpc_ctor <Constructor>, kmpc_cctor NULL, kmpc_dtor <Destructor>); In expressions all references to such variables are replaced by calls to void *__kmpc_threadprivate_cached(ident_t *<Current Location>, kmp_int32 <Current Thread Id>, void *<Original Global Addr>, size_t <Size of Data>, void ***<Pointer to autogenerated cache – array of private copies of threadprivate variable>); Test test/OpenMP/threadprivate_codegen.cpp checks that codegen is correct. Also it checks that codegen is correct after serialization/deserialization and one of passes verifies debug info. Differential Revision: http://reviews.llvm.org/D4002 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221663 91177308-0d34-0410-b5e6-96231b3b80d8
* [c++1z] N4295: fold-expressions.Richard Smith2014-11-081-1/+2
| | | | | | | | | | | | | | | | | This is a new form of expression of the form: (expr op ... op expr) where one of the exprs is a parameter pack. It expands into (expr1 op (expr2onwards op ... op expr)) (and likewise if the pack is on the right). The non-pack operand can be omitted; in that case, an empty pack gives a fallback value or an error, depending on the operator. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221573 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] When a .pcm file is explicitly built separately from the translationRichard Smith2014-10-311-5/+8
| | | | | | | unit, allow the -O settings of the two compilations to differ. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220943 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] Load .pcm files specified by -fmodule-file lazily.Richard Smith2014-10-271-0/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220731 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] Support combining 'textual' with 'private'.Richard Smith2014-10-241-0/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220589 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a "signature" to AST files to verify that they haven't changedBen Langmuir2014-10-234-1/+20
| | | | | | | | | | | | | | | | | | | | | Since the order of the IDs in the AST file (e.g. DeclIDs, SelectorIDs) is not stable, it is not safe to load an AST file that depends on another AST file that has been rebuilt since the importer was built, even if "nothing changed". We previously used size and modtime to check this, but I've seen cases where a module rebuilt quickly enough to foil this check and caused very hard to debug build errors. To save cycles when we're loading the AST, we just generate a random nonce value and check that it hasn't changed when we load an imported module, rather than actually hash the whole file. This is slightly complicated by the fact that we need to verify the signature inside addModule, since we might otherwise consider that a mdoule is "OutOfDate" when really it is the importer that is out of date. I didn't see any regressions in module load time after this change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220493 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] Add support for 'textual header' directives.Richard Smith2014-10-221-1/+4
| | | | | | | | | This allows a module to specify that it logically contains a file, but that said file is non-modular and intended for textual inclusion. This allows layering checks to work properly in the presence of such files. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220448 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] Initial support for explicitly loading .pcm files.Richard Smith2014-10-222-5/+38
| | | | | | | | | | | | | | | | Implicit module builds are not well-suited to a lot of build systems. In particular, they fare badly in distributed build systems, and they lead to build artifacts that are not tracked as part of the usual dependency management process. This change allows explicitly-built module files (which are already supported through the -emit-module flag) to be explicitly loaded into a build, allowing build systems to opt to manage module builds and dependencies themselves. This is only the first step in supporting such configurations, and it should be considered experimental and subject to change or removal for now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220359 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] 'omp teams' directive basic support.Alexey Bataev2014-10-091-0/+1
| | | | | | | Includes parsing and semantic analysis for 'omp teams' directive support from OpenMP 4.0. Adds additional analysis to 'omp target' directive with 'omp teams' directive. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219385 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[OPENMP] 'omp teams' directive basic support. Includes parsing and ↵Renato Golin2014-10-081-1/+0
| | | | | | | | | semantic analysis for 'omp teams' directive support from OpenMP 4.0. Adds additional analysis to 'omp target' directive with 'omp teams' directive." This reverts commit r219197 because it broke ARM self-hosting buildbots with segmentation fault errors in many tests. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219289 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] 'omp teams' directive basic support.Alexey Bataev2014-10-071-0/+1
| | | | | | | Includes parsing and semantic analysis for 'omp teams' directive support from OpenMP 4.0. Adds additional analysis to 'omp target' directive with 'omp teams' directive. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219197 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Parsing/Sema of directive omp parallel for simdAlexander Musman2014-09-231-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218299 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a typo in comment in ASTBitCodes.hAlexander Musman2014-09-231-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218294 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Initial parsing/sema analysis of 'target' directive.Alexey Bataev2014-09-191-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218110 91177308-0d34-0410-b5e6-96231b3b80d8
* Parsing/Sema of directive omp for simdAlexander Musman2014-09-181-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218029 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid a couple of assertions when preprocessing with modulesBen Langmuir2014-09-101-2/+2
| | | | | | | | | | | | | | | | 1. We were hitting the NextIsPrevious assertion because we were trying to merge decl chains that were independent of each other because we had no Sema object to allow them to find existing decls. This is fixed by delaying loading the "preloaded" decls until Sema is available. 2. We were trying to get identifier info from an annotation token, which asserts. The fix is to special-case the module annotations in the preprocessed output printer. Fixed in a single commit because when you hit 1 you almost invariably hit 2 as well. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217550 91177308-0d34-0410-b5e6-96231b3b80d8
* Add -Wunused-local-typedef, a warning that finds unused local typedefs.Nico Weber2014-09-062-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The warning warns on TypedefNameDecls -- typedefs and C++11 using aliases -- that are !isReferenced(). Since the isReferenced() bit on TypedefNameDecls wasn't used for anything before this warning it wasn't always set correctly, so this patch also adds a few missing MarkAnyDeclReferenced() calls in various places for TypedefNameDecls. This is made a bit complicated due to local typedefs possibly being used only after their local scope has closed. Consider: template <class T> void template_fun(T t) { typename T::Foo s3foo; // YYY (void)s3foo; } void template_fun_user() { struct Local { typedef int Foo; // XXX } p; template_fun(p); } Here the typedef in XXX is only used at end-of-translation unit, when YYY in template_fun() gets instantiated. To handle this, typedefs that are unused when their scope exits are added to a set of potentially unused typedefs, and that set gets checked at end-of-TU. Typedefs that are still unused at that point then get warned on. There's also serialization code for this set, so that the warning works with precompiled headers and modules. For modules, the warning is emitted when the module is built, for precompiled headers each time the header gets used. Finally, consider a function using C++14 auto return types to return a local type defined in a header: auto f() { struct S { typedef int a; }; return S(); } Here, the typedef escapes its local scope and could be used by only some translation units including the header. To not warn on this, add a RecursiveASTVisitor that marks all delcs on local types returned from auto functions as referenced. (Except if it's a function with internal linkage, or the decls are private and the local type has no friends -- in these cases, it _is_ safe to warn.) Several of the included testcases (most of the interesting ones) were provided by Richard Smith. (gcc's spelling -Wunused-local-typedefs is supported as an alias for this warning.) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217298 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] Number anonymous declarations that are lexically within mergeableRichard Smith2014-08-282-0/+10
| | | | | | | contexts, so that we can merge them when we merge the surrounding context. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216639 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] When merging a tag declaration that has a typedef name for linkageRichard Smith2014-08-231-0/+5
| | | | | | | | purposes, look for other typedefs with that same name and merge into their named tag declaration if there is one. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216312 91177308-0d34-0410-b5e6-96231b3b80d8
* Store std::unique_ptr in InMemoryBuffers. NFC.Rafael Espindola2014-08-182-5/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215928 91177308-0d34-0410-b5e6-96231b3b80d8
* Repace SmallPtrSet with SmallPtrSetImpl in function arguments to avoid ↵Craig Topper2014-08-171-1/+1
| | | | | | needing to mention the size. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215869 91177308-0d34-0410-b5e6-96231b3b80d8
* When loading a module with no local entities, still bump the size of theBen Langmuir2014-08-161-0/+8
| | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215810 91177308-0d34-0410-b5e6-96231b3b80d8
* Header guard canonicalization, clang part.Benjamin Kramer2014-08-138-16/+16
| | | | | | Modifications made by clang-tidy with minor tweaks. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215557 91177308-0d34-0410-b5e6-96231b3b80d8
* Verify all the module map files for a pcm are the same on loadBen Langmuir2014-08-121-0/+3
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215455 91177308-0d34-0410-b5e6-96231b3b80d8
* unique_ptr-ify the MemoryBuffer parameter of GlobalModuleIndexDavid Blaikie2014-08-111-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215376 91177308-0d34-0410-b5e6-96231b3b80d8
* unique_ptr-ify ASTReaderListener in the ASTReaderDavid Blaikie2014-08-101-7/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215317 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor out exception specification information fromRichard Smith2014-07-311-1/+1
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214450 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] Factor out ODR checking, to avoid unnecessary repeated work inRichard Smith2014-07-291-0/+1
| | | | | | | finishPendingActions loop. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214246 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] Add abbreviation for ImplicitCastExpr. This is the most commonRichard Smith2014-07-271-6/+10
| | | | | | | record type in LLVM's IR module. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214048 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] Improve abbreviations for C++:Richard Smith2014-07-262-4/+15
| | | | | | | | | | | | | | | | | | * 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214024 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] Substantially improve handling of #undef:Richard Smith2014-07-251-3/+4
| | | | | | | | | | | * 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213922 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Initial parsing and sema analysis for 'atomic' directive.Alexey Bataev2014-07-221-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213639 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Initial parsing and sema analysis for 'ordered' directive.Alexey Bataev2014-07-221-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213616 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Initial parsing and sema analysis for 'flush' directive.Alexey Bataev2014-07-211-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213512 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Parsing/Sema of the OpenMP directive 'critical'.Alexander Musman2014-07-211-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213510 91177308-0d34-0410-b5e6-96231b3b80d8
* Reinstate r213348, reverted in r213395, with an additional bug fix and moreRichard Smith2014-07-181-2/+3
| | | | | | | | | | | | | | | | | | | | | thorough tests. Original commit message: [modules] Fix macro hiding bug exposed if: * A submodule of module A is imported into module B * Another submodule of module A that is not imported into B exports a macro * Some submodule of module B also exports a definition of the macro, and happens to be the first submodule of B that imports module A. In this case, we would incorrectly determine that A's macro redefines B's macro, and so we don't need to re-export B's macro at all. This happens with the 'assert' macro in an LLVM self-host. =( git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213416 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[modules] Fix macro hiding bug exposed if:"Ben Langmuir2014-07-181-3/+2
| | | | | | | | | | This is breaking the system modules on Darwin, because something that was defined and re-exported no longer is. Might be this patch, or might just be a really poor interaction with an existing visibility bug. This reverts commit r213348. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213395 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Initial parsing and sema analysis for 'taskwait' directive.Alexey Bataev2014-07-181-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213363 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Initial parsing and sema analysis for 'barrier' directive.Alexey Bataev2014-07-181-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213360 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Initial parsing and sema analysis of 'taskyield' directive.Alexey Bataev2014-07-181-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213355 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] Fix macro hiding bug exposed if:Richard Smith2014-07-181-2/+3
| | | | | | | | | | | | | | | * A submodule of module A is imported into module B * Another submodule of module A that is not imported into B exports a macro * Some submodule of module B also exports a definition of the macro, and happens to be the first submodule of B that imports module A. In this case, we would incorrectly determine that A's macro redefines B's macro, and so we don't need to re-export B's macro at all. This happens with the 'assert' macro in an LLVM self-host. =( git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213348 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Parsing/Sema analysis of directive 'master'Alexander Musman2014-07-171-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213237 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Parsing and sema analysis for 'omp task' directive.Alexey Bataev2014-07-111-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212804 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Parsing and sema analysis for 'omp parallel sections' directive.Alexey Bataev2014-07-081-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212516 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Added initial support for 'omp parallel for'.Alexey Bataev2014-07-071-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212453 91177308-0d34-0410-b5e6-96231b3b80d8