summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Validate user headers even if -fmodules-validate-once-per-build-sessionBen Langmuir2014-11-101-3/+2
| | | | | | | | is enabled. Unlike system headers, we want to be more careful about modifications to user headers, because it's still easy to edit a header while you're building. llvm-svn: 221634
* [c++1z] N4295: fold-expressions.Richard Smith2014-11-082-1/+26
| | | | | | | | | | | | | | | | 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. llvm-svn: 221573
* Check module signature when the module has already been loadedBen Langmuir2014-11-081-7/+13
| | | | | | | | | | We may need to verify the signature on subsequent imports as well, just like we verify the size/modtime: @import A; @import B; // imports A @import C; // imports A llvm-svn: 221569
* Fix unintended fallthrough in ASTReaderBen Langmuir2014-11-081-0/+2
| | | | llvm-svn: 221567
* Introduce a SanitizerKind enum to LangOptions.Alexey Samsonov2014-11-072-3/+5
| | | | | | | | | | | | | Use the bitmask to store the set of enabled sanitizers instead of a bitfield. On the negative side, it makes syntax for querying the set of enabled sanitizers a bit more clunky. On the positive side, we will be able to use SanitizerKind to eventually implement the new semantics for -fsanitize-recover= flag, that would allow us to make some sanitizers recoverable, and some non-recoverable. No functionality change. llvm-svn: 221558
* Remove CastKind typedef from CastExpr since CastKind is in the clang namespace.Craig Topper2014-10-311-1/+1
| | | | llvm-svn: 220955
* [modules] When a .pcm file is explicitly built separately from the translationRichard Smith2014-10-311-18/+47
| | | | | | unit, allow the -O settings of the two compilations to differ. llvm-svn: 220943
* Improved capturing variable-length array types in CapturedStmt.Alexey Bataev2014-10-291-1/+1
| | | | | | | | An updated implemnentation of VLA types capturing based on previously committed solution for Lambdas. This version captures the whole VLA type instead of particular variables which are part of VLA size expression and allows to use previusly calculated size of VLA type in captured regions. Required for OpenMP. Differential Revision: http://reviews.llvm.org/D5099 llvm-svn: 220850
* Objective-C. revert patch for rdar://17554063.Fariborz Jahanian2014-10-282-4/+0
| | | | llvm-svn: 220812
* [modules] Allow -I, -D, -W flags to change between building a module andRichard Smith2014-10-281-3/+18
| | | | | | | | explicitly using the resulting .pcm file. Unlike for an implicit module build, we don't need nor want to require these flags to match between the module and its users. llvm-svn: 220780
* Remove unused variable.Richard Smith2014-10-271-2/+1
| | | | llvm-svn: 220738
* [modules] Load .pcm files specified by -fmodule-file lazily.Richard Smith2014-10-271-0/+19
| | | | llvm-svn: 220731
* Add the initial TypoExpr AST node for delayed typo correction.Kaelyn Takata2014-10-272-0/+10
| | | | llvm-svn: 220692
* Make VFS and FileManager match the current MemoryBuffer API.Benjamin Kramer2014-10-263-29/+23
| | | | | | | This eliminates converting back and forth between the 3 formats and gives us a more homogeneous interface. llvm-svn: 220657
* [modules] Support combining 'textual' with 'private'.Richard Smith2014-10-242-51/+34
| | | | llvm-svn: 220589
* [Modules] Free modules that failed signature verification.Benjamin Kramer2014-10-241-0/+1
| | | | | | The control flow and ownership is weird enough so unique_ptr doesn't help here :( llvm-svn: 220569
* [modules] Simplify reading of INPUT_FILE_OFFSETS record and make it robust ↵Richard Smith2014-10-231-7/+7
| | | | | | against changes to record order. llvm-svn: 220524
* Factor out common checks from module map deserialization. No functionality ↵Richard Smith2014-10-231-110/+17
| | | | | | change. llvm-svn: 220521
* Add a "signature" to AST files to verify that they haven't changedBen Langmuir2014-10-235-3/+79
| | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 220493
* [modules] Add support for 'textual header' directives.Richard Smith2014-10-221-1/+13
| | | | | | | | 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. llvm-svn: 220448
* Removing the setLBracLoc and setRBracLoc functions from CompoundStmt -- ↵Aaron Ballman2014-10-221-2/+2
| | | | | | their only use was with the AST reader, and friendship can be used to handle that. Drive-by rename of "Brac" to "Brace" for the private data members. NFC. llvm-svn: 220428
* [modules] Initial support for explicitly loading .pcm files.Richard Smith2014-10-223-24/+41
| | | | | | | | | | | | | | | 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. llvm-svn: 220359
* [modules] When building an injected-class-name type, we may have to insert itRichard Smith2014-10-211-6/+11
| | | | | | into multiple merged classes' TypeForDecl slots. llvm-svn: 220331
* [OPENMP] Codegen for 'private' clause in 'parallel' directive.Alexey Bataev2014-10-212-1/+9
| | | | | | | This patch generates some helper variables which used as a private copies of the corresponding original variables inside an OpenMP 'parallel' directive. These generated variables are initialized by default (with the default constructor, if any). In outlined function references to original variables are replaced by the references to these private helper variables. At the end of the initialization of the private variables and implicit barier is set by calling __kmpc_barrier(...) runtime function to be sure that all threads were initialized using original values of the variables. Differential Revision: http://reviews.llvm.org/D4752 llvm-svn: 220262
* Revert most of r215810, which is no longer neededBen Langmuir2014-10-201-24/+15
| | | | | | | | Now that we no longer add mappings when there are no local entities, there is no need to always bump the size of the tables that correspond to ContinuousRangeMaps. llvm-svn: 220208
* Don't add ID mappings for offsets with no entities in a moduleBen Langmuir2014-10-202-45/+50
| | | | | | | | | | | This is a better fix for 'duplicate key' problems in module continuous range maps (vs what I added in r215810) by not adding any mappings at all when there are no local entities. Now it also covers selectors, which were not always being bumped because the record SELECTOR_OFFSET is not always emitted. I'll back out most of r215810 in a future commit, since it should no longer be needed. llvm-svn: 220207
* Rename TemplateArgument::getTypeForDecl to getParamTypeForDecl for clarityDavid Blaikie2014-10-171-1/+1
| | | | | | Code review feedback from Richard Smith on r219900. llvm-svn: 220060
* PR21246: DebugInfo: Emit the appropriate type (cv qualifiers, ↵David Blaikie2014-10-162-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | reference-ness, etc) for non-type template parameters Plumb through the full QualType of the TemplateArgument::Declaration, as it's insufficient to only know whether the type is a reference or pointer (that was necessary for mangling, but insufficient for debug info). This shouldn't increase the size of TemplateArgument as TemplateArgument::Integer is still longer by another 32 bits. Several bits of code were testing that the reference-ness of the parameters matched, but this seemed to be insufficient (various other features of the type could've mismatched and wouldn't've been caught) and unnecessary, at least insofar as removing those tests didn't cause anything to fail. (Richard - perchaps you can hypothesize why any of these checks might need to test reference-ness of the parameters (& explain why reference-ness is part of the mangling - I would've figured that for the reference-ness to be different, a prior template argument would have to be different). I'd be happy to add them in/beef them up and add test cases if there's a reason for them) llvm-svn: 219900
* [modules] Merging for class-scope using-declarations.Richard Smith2014-10-141-0/+68
| | | | llvm-svn: 219657
* Fix deserialization of PredefinedExpr in dependent context.Alexey Bataev2014-10-111-1/+1
| | | | llvm-svn: 219561
OpenPOWER on IntegriCloud