summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization
Commit message (Collapse)AuthorAgeFilesLines
...
* Wrap clang module files in a Mach-O, ELF, or COFF container.Adrian Prantl2015-02-205-24/+43
| | | | | | | | | | | | | | This is a necessary prerequisite for debugging with modules. The .pcm files become containers that hold the serialized AST which allows us to store debug information in the module file that can be shared by all object files that were built importing the module. rdar://problem/19104245 This reapplies r230044 with a fixed configure+make build and updated dependencies. llvm-svn: 230067
* Don't try to rebuild modules on umbrella header mismatchBen Langmuir2015-02-201-3/+7
| | | | | | | | | | | | | | | There are two issues here: 1) It's too late to rebuild at this point, because we won't go through removeModules and when we try to reload the new .pcm we'll get the old one instead. We might be able to call removeModules after an OutOfDate here, but I'm not yet confident that it is always safe to do so. 2) In practice, this check fails spuriously when the umbrella header appears to change because of a VFS change that means it maps to a different copy of the same file. Because of this, we just skip the check for now. llvm-svn: 230064
* Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."Adrian Prantl2015-02-205-43/+24
| | | | | | | | | This reverts commit r230044 while dealing with buildbot breakage. Conflicts: test/Modules/module_container.m llvm-svn: 230052
* Wrap clang module files in a Mach-O, ELF, or COFF container.Adrian Prantl2015-02-205-24/+43
| | | | | | | | | | | This is a necessary prerequisite for debugging with modules. The .pcm files become containers that hold the serialized AST which allows us to store debug information in the module file that can be shared by all object files that were built importing the module. rdar://problem/19104245 llvm-svn: 230044
* Revert "Mangle the IsSystem bit into the .pcm file name"Ben Langmuir2015-02-192-8/+0
| | | | | | | | While I investigate some possible problems with this patch. This reverts commit r228966 llvm-svn: 229910
* [PCH/Modules] Check that the specific module cache path the PCH was built ↵Argyrios Kyrtzidis2015-02-192-8/+57
| | | | | | | | | | | | with, is the same as the one in the current compiler invocation. If they differ reject the PCH. This protects against the badness occurring from getting modules loaded from different module caches (see crashes). rdar://19889860 llvm-svn: 229909
* Prevent use after free caused by accessing a member into a dense set.Daniel Jasper2015-02-181-1/+2
| | | | | | | | The member gets invalidated as elements are added to the dense set. Directly access the underlying pointer instead. Not sure how to create a test case for this :-(. Maybe Richard can help. llvm-svn: 229673
* Prefer SmallVector::append/insert over push_back loops. Clang edition.Benjamin Kramer2015-02-171-2/+1
| | | | | | Same functionality, but hoists the vector growth out of the loop. llvm-svn: 229508
* Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for ↵Aaron Ballman2015-02-151-2/+2
| | | | | | requiring the macro. NFC; Clang edition. llvm-svn: 229339
* [modules] Guard against recursively re-entering diagnosing ODR violations whileRichard Smith2015-02-131-0/+11
| | | | | | | in the middle of emitting an ODR violation diagnostic. I don't yet have a reduced testcase for this issue, working on it... llvm-svn: 229167
* [modules] Don't produce duplicate lookup results if the same declaration isRichard Smith2015-02-131-5/+12
| | | | | | visible through multiple imported modules. No functionality change. llvm-svn: 229147
* [modules] Improve llvm-bcanalyzer output on AST files a little. No ↵Richard Smith2015-02-132-4/+5
| | | | | | functionality change. llvm-svn: 229145
* [modules] When collecting declarations to complete a redeclaration chain for anRichard Smith2015-02-121-12/+18
| | | | | | | | | | entity, put the originally-canonical decl IDs in the right places in the redecl chain rather than reordering them all to the start. If we don't ensure that the redecl chain order is consistent with the topological module order, we can fail to make a declaration visible if later declarations are in more IDNSs than earlier ones (for instance, because the earlier decls are invisible friends). llvm-svn: 228978
* Mangle the IsSystem bit into the .pcm file nameBen Langmuir2015-02-122-0/+8
| | | | | | | | | When mangling the module map path into a .pcm file name, also mangle the IsSystem bit, which can also depend on the header search paths. For example, the user may change from -I to -isystem. This can affect diagnostics in the importing TU. llvm-svn: 228966
* [modules] Treat friend declarations that are lexically within a dependentRichard Smith2015-02-075-24/+59
| | | | | | | context as anonymous for merging purposes. They can't be found by their names, so we merge them based on their position within the surrounding context. llvm-svn: 228485
* PR22405: don't lose implicit-deleted-ness across AST write / read.Richard Smith2015-02-061-14/+14
| | | | llvm-svn: 228464
* ASTUnit: Use range-based for loops.Benjamin Kramer2015-02-061-1/+2
| | | | llvm-svn: 228420
* Update APIs that return a pair of iterators to return an iterator_range instead.Benjamin Kramer2015-02-061-7/+8
| | | | | | Convert uses of those APIs into ranged for loops. NFC. llvm-svn: 228404
* [modules] If a module declares an entity and then imports another declarationRichard Smith2015-02-062-20/+55
| | | | | | | | | of that entity, ensure that the redeclaration chain is reordered properly on reload. Otherwise, the result of name lookup for that entity may point to an entity that is too old; if that's an injected friend name or the like, that can result in the name not being found at all. llvm-svn: 228371
* [modules] Refactor: unify the code that picks which declaration goes into aRichard Smith2015-02-051-55/+46
| | | | | | name lookup table. llvm-svn: 228354
* [modules] When using -E, we may try to merge decls despite having no SemaRichard Smith2015-02-041-0/+5
| | | | | | | | | | | object. In such a case, use the TU's DC for merging global decls rather than giving up when we find there is no TU scope. Ultimately, we should probably avoid all loading of decls when preprocessing, but there are other reasonable use cases for loading an AST file with no Sema object for which this is the right thing. llvm-svn: 228234
* [modules] If we already have a fake definition for one declaration of a class,Richard Smith2015-02-041-1/+2
| | | | | | | don't think we're providing a new one in an update record adding a definition to another declaration of the same class. llvm-svn: 228104
* [modules] Be sure to load the lexical definition of a class templateRichard Smith2015-02-031-13/+22
| | | | | | | specialization from an update record exactly once, even if we needed to fake up the definition. llvm-svn: 227939
* [modules] When we try to complete the redeclaration chain for a class templateRichard Smith2015-01-311-0/+15
| | | | | | specialization, pull in any lazy specializations of the class template. llvm-svn: 227668
* [modules] Sometimes we can deserialize a class member but not have yetRichard Smith2015-01-242-22/+62
| | | | | | | | | | | encountered any definition for the class; this happens when the definition is added by an update record that is not yet loaded. In such a case, eagerly pick the original parent of the member as the canonical definition of the class rather than muddling through with the canonical declaration (the latter can lead to us failing to merge properly later if the canonical definition turns out to be some other declaration). llvm-svn: 226977
* [modules] If we add an implicit special member to a class through an updateRichard Smith2015-01-221-1/+13
| | | | | | | | record, and that class declaration is not the canonical definition of the class, be sure to add the class to the list of classes that are consulted when we look up a special member in the canonical definition. llvm-svn: 226778
* [modules] If we load two declarations with typedef names for linkage purposesRichard Smith2015-01-221-4/+10
| | | | | | | on top of a local declaration of the same entity, we still need to remember that we loaded the first one or we may fail to merge the second one properly. llvm-svn: 226765
* [modules] It's possible to merge into the pattern of a class template before weRichard Smith2015-01-221-3/+7
| | | | | | | load the definition data from the declaration itself. In that case, merge properly; don't assume the prior definition is the same as our own. llvm-svn: 226761
* Fix bogus 'method is unavailable' errors with modulesBen Langmuir2015-01-121-3/+7
| | | | | | | | This just tweaks the fix from r224892 (which handled PCHs) to work with modules, where we will serialize each method individually and hence the hasMoreThanOneDecl bit needs to be updated as we add the methods. llvm-svn: 225659
* Rename RefersToCapturedVariable to RefersToEnclosingVariableOrCapture, NFCAlexey Bataev2015-01-123-4/+4
| | | | llvm-svn: 225624
* Objective-C: Serialize "more than one decl" state of ObjCMethodList.Nico Weber2014-12-273-14/+34
| | | | | | | | | | | | | | | | | 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. llvm-svn: 224892
* Address review feedback on r221933.Nico Weber2014-12-272-21/+21
| | | | | | | | | | | Remove ObjCMethodList::Count, instead store a "has more than one decl" bit in the low bit of the ObjCMethodDecl pointer, using a PointerIntPair. Most of this patch is replacing ".Method" with ".getMethod()". No intended behavior change. llvm-svn: 224876
* Renamed RefersToEnclosingLocal bitfield to RefersToCapturedVariable.Alexey Bataev2014-12-163-3/+4
| | | | | | | Bitfield RefersToEnclosingLocal of Stmt::DeclRefExprBitfields renamed to RefersToCapturedVariable to reflect latest changes introduced in commit 224323. Also renamed method Expr::refersToEnclosingLocal() to Expr::refersToCapturedVariable() and comments for constant arguments. No functional changes. llvm-svn: 224329
* First patch with codegen of the 'omp for' directive. It implementsAlexander Musman2014-12-152-0/+18
| | | | | | | | | | | | | | | the simplest case, which is used when no chunk_size is specified in the schedule(static) or no 'schedule' clause is specified - the iteration space is divided by the library into chunks that are approximately equal in size, and at most one chunk is distributed to each thread. In this case, we do not need an outer loop in each thread - each thread requests once which iterations range it should handle (using __kmpc_for_static_init runtime call) and then runs the inner loop on this range. Differential Revision: http://reviews.llvm.org/D5865 llvm-svn: 224233
* [modules] When constructing paths relative to a module, strip out /./ directoryRichard Smith2014-12-111-15/+19
| | | | | | | components. These sometimes get synthetically added, and we don't want -Ifoo and -I./foo to be treated fundamentally differently here. llvm-svn: 224055
* [modules] If we import a module, and we've seen a module map that describes theRichard Smith2014-12-061-2/+24
| | | | | | | | | module, use the path from the module map file in preference to the path from the .pcm file when resolving relative paths in the .pcm file. This allows diagnostics (and .d output) to give relative paths if the module was found via a relative path. llvm-svn: 223577
* [modules] Instead of storing absolute paths in a .pcm file, store the path toRichard Smith2014-12-053-142/+187
| | | | | | | | | | | | | | | 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. llvm-svn: 223539
* Temporarily reverting r223443 due to bot breakage.Aaron Ballman2014-12-053-187/+140
| | | | llvm-svn: 223465
* [modules] Instead of storing absolute paths in a .pcm file, store the path toRichard Smith2014-12-053-140/+187
| | | | | | | | | 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. llvm-svn: 223443
* Try to fix the MSVC build.Hans Wennborg2014-12-021-3/+2
| | | | llvm-svn: 223105
* [modules] Track how 'header' directives were written in module map files,Richard Smith2014-12-022-13/+26
| | | | | | | | | | | | | rather than trying to extract this information from the FileEntry after the fact. This has a number of beneficial effects. For instance, diagnostic messages for failed module builds give a path relative to the "module root" rather than an absolute file path, and the contents of the module includes file is no longer dependent on what files the including TU happened to inspect prior to triggering the module build. llvm-svn: 223095
* [modules] When explicitly importing a module, it's fine for the imported moduleRichard Smith2014-11-211-0/+7
| | | | | | | | to be newer than we were expecting. That happens if .pcm's get moved between file systems during a distributed build. (It's still not OK for them to actually be different, though, so we still check the size and signature matches.) llvm-svn: 222507
* PR21323: Fix iterator invalidation issue when looking for redeclarations of aRichard Smith2014-11-211-3/+8
| | | | | | | | | special member function. No test yet: the only testcases we have for this issue are extremely complex. Testcase will be added once I get a reasonable reduction. llvm-svn: 222506
* Update for LLVM API change to make Small(Ptr)Set::insert return ↵David Blaikie2014-11-193-4/+4
| | | | | | pair<iterator, bool> as per the C++ standard's associative container concept. llvm-svn: 222335
* [OPENMP] Additional processing of 'omp atomic read' directive.Alexey Bataev2014-11-182-0/+6
| | | | | | According to OpenMP standard, Section 2.12.6, atomic Construct, '#pragma omp atomic read' is allowed to be used only for expression statements of form 'v = x;', where x and v (as applicable) are both l-value expressions with scalar type. Patch adds checks for it. llvm-svn: 222231
* [ASTReader] Add a convenience function to retrieve all the input files of a ↵Argyrios Kyrtzidis2014-11-181-0/+8
| | | | | | module file. llvm-svn: 222224
* PR21437, final part of DR1330: delay-parsing of exception-specifications. ThisRichard Smith2014-11-131-4/+2
| | | | | | | is a re-commit of Doug's r154844 (modernized and updated to fit into current Clang). llvm-svn: 221918
* Update for llvm api change.Rafael Espindola2014-11-121-1/+1
| | | | llvm-svn: 221786
* Simplify code a bit by passing StreamFile to the BitstreamCursor constructor.Rafael Espindola2014-11-122-6/+3
| | | | llvm-svn: 221784
* [OPENMP] Codegen for threadprivate variablesAlexey Bataev2014-11-113-2/+20
| | | | | | | | | 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 llvm-svn: 221663
OpenPOWER on IntegriCloud