summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* [modules] Delay loading the field declared with an anonymous tag declarationRichard Smith2014-10-101-1/+1
| | | | | | until after we've had a chance to merge that tag. llvm-svn: 219539
* Change how we distinguish bitfield widths, in-classJohn McCall2014-10-102-13/+13
| | | | | | | | initializers, and captured VLA types so that we can answer questions like "is this a bit-field" without looking at the enclosing DeclContext. NFC. llvm-svn: 219522
* Fix for bug http://llvm.org/PR17427.Alexey Bataev2014-10-092-1/+3
| | | | | | | | Assertion failed: "Computed __func__ length differs from type!" Reworked PredefinedExpr representation with internal StringLiteral field for function declaration. Differential Revision: http://reviews.llvm.org/D5365 llvm-svn: 219393
* [OPENMP] 'omp teams' directive basic support.Alexey Bataev2014-10-092-0/+19
| | | | | | 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. llvm-svn: 219385
* [OPENMP] Codegen for 'firstprivate' clause.Alexey Bataev2014-10-082-1/+16
| | | | | | | | This patch generates some helper variables that used as private copies of the corresponding original variables inside an OpenMP 'parallel' directive. These generated variables are initialized by copy using values of the original variables (with the copy constructor, if any). For arrays, initializator is generated for single element and in the codegen procedure this initial value is automatically propagated between all elements of the private copy. 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 an implicit barier is generated 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/D5140 llvm-svn: 219306
* Revert commit r219297.Alexey Bataev2014-10-082-16/+1
| | | | | | Still troubles with OpenMP/parallel_firstprivate_codegen.cpp (now in ARM buildbots). llvm-svn: 219298
* [OPENMP] Codegen for 'firstprivate' clause.Alexey Bataev2014-10-082-1/+16
| | | | | | | | This patch generates some helper variables that used as private copies of the corresponding original variables inside an OpenMP 'parallel' directive. These generated variables are initialized by copy using values of the original variables (with the copy constructor, if any). For arrays, initializator is generated for single element and in the codegen procedure this initial value is automatically propagated between all elements of the private copy. 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 an implicit barier is generated 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/D5140 llvm-svn: 219297
* Revert back r219295.Alexey Bataev2014-10-082-16/+1
| | | | | | To fix issues with test OpenMP/parallel_firstprivate_codegen.cpp llvm-svn: 219296
* [OPENMP] Codegen for 'firstprivate' clause.Alexey Bataev2014-10-082-1/+16
| | | | | | | | This patch generates some helper variables that used as private copies of the corresponding original variables inside an OpenMP 'parallel' directive. These generated variables are initialized by copy using values of the original variables (with the copy constructor, if any). For arrays, initializator is generated for single element and in the codegen procedure this initial value is automatically propagated between all elements of the private copy. 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 an implicit barier is generated 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/D5140 llvm-svn: 219295
* Revert "[OPENMP] 'omp teams' directive basic support. Includes parsing and ↵Renato Golin2014-10-082-19/+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. llvm-svn: 219289
* [OPENMP] 'omp teams' directive basic support.Alexey Bataev2014-10-072-0/+19
| | | | | | 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. llvm-svn: 219197
* [OPENMP] Loop collapsing and codegen for 'omp simd' directive.Alexander Musman2014-10-012-0/+40
| | | | | | | | | | | | | This patch implements collapsing of the loops (in particular, in presense of clause 'collapse'). It calculates number of iterations N and expressions nesessary to calculate the nested loops counters values based on new iteration variable (that goes from 0 to N-1) in Sema. It also adds Codegen for 'omp simd', which uses (and tests) this feature. Differential Revision: http://reviews.llvm.org/D5184 llvm-svn: 218743
* PR20399: Do not assert when adding an implicit member coming from a module atRichard Smith2014-09-301-6/+5
| | | | | | | | writing time. Patch by Vassil Vassilev! llvm-svn: 218651
* -ms-extensions: Implement __super scope specifier (PR13236).Nikola Smiljanic2014-09-262-1/+23
| | | | | | | | | We build a NestedNameSpecifier that records the CXXRecordDecl in which __super appeared. Name lookup is performed in all base classes of the recorded CXXRecordDecl. Use of __super is allowed only inside class and member function scope. llvm-svn: 218484
* [OPENMP] Parsing/Sema of directive omp parallel for simdAlexander Musman2014-09-232-0/+19
| | | | llvm-svn: 218299
* [OPENMP] Initial parsing/sema analysis of 'target' directive.Alexey Bataev2014-09-192-0/+19
| | | | llvm-svn: 218110
* Parsing/Sema of directive omp for simdAlexander Musman2014-09-182-0/+17
| | | | llvm-svn: 218029
* Avoid a couple of assertions when preprocessing with modulesBen Langmuir2014-09-101-18/+20
| | | | | | | | | | | | | | | | 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. llvm-svn: 217550
* Fix PCHs that import more than one moduleBen Langmuir2014-09-081-1/+4
| | | | | | | We were passing < to std::unique, but it expects ==. Since the input is sorted, we were always trimming it to one entry. llvm-svn: 217402
* Add -Wunused-local-typedef, a warning that finds unused local typedefs.Nico Weber2014-09-062-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.) llvm-svn: 217298
OpenPOWER on IntegriCloud