summaryrefslogtreecommitdiff
path: root/test/PCH
Commit message (Collapse)AuthorAgeFilesLines
* Correctly handle line table entries without filenames during AST serializationHans Wennborg2017-12-042-0/+14
| | | | | | | | | | The current code would hit an assert in ASTWriter when trying to write out the filename for a line table entry that didn't have any. Fix this by allowing the -1 sentinel value to round-trip through serialization. Differential revision: https://reviews.llvm.org/D40746 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@319707 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement C++ [basic.link]p8.Richard Smith2017-09-201-1/+1
| | | | | | | | | | | | | | | If a function or variable has a type with no linkage (and is not extern "C"), any use of it requires a definition within the same translation unit; the idea is that it is not possible to define the entity elsewhere, so any such use is necessarily an error. There is an exception, though: some types formally have no linkage but nonetheless can be referenced from other translation units (for example, this happens to anonymous structures defined within inline functions). For entities with those types, we suppress the diagnostic except under -pedantic. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313729 91177308-0d34-0410-b5e6-96231b3b80d8
* [c++2a] P0683R1: Permit default member initializers for bit-fields.Richard Smith2017-08-281-0/+25
| | | | | | | | This would be trivial, except that our in-memory and serialized representations for FieldDecls assumed that this can't happen. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311867 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang] Get rid of "%T" expansionsKuba Mracek2017-08-152-16/+19
| | | | | | | | | | | | The %T lit expansion expands to a common directory shared between all the tests in the same directory, which is unexpected and unintuitive, and more importantly, it's been a source of subtle race conditions and flaky tests. In https://reviews.llvm.org/D35396, it was agreed that it would be best to simply ban %T and only keep %t, which is unique to each test. When a test needs a temporary directory, it can just create one using mkdir %t. This patch removes %T in clang. Differential Revision: https://reviews.llvm.org/D36437 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310950 91177308-0d34-0410-b5e6-96231b3b80d8
* -Wpragma-pack: add an additional note and fixit when warningAlex Lorenz2017-07-311-1/+3
| | | | | | | | | | about unterminated push directives that are followed by a reset ('#pragma pack()') This has been suggested by Hans Wennborg. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309559 91177308-0d34-0410-b5e6-96231b3b80d8
* Recommit r308327 3rd time: Add a warning for missingAlex Lorenz2017-07-282-15/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '#pragma pack (pop)' and suspicious uses of '#pragma pack' in included files The second recommit (r309106) was reverted because the "non-default #pragma pack value chages the alignment of struct or union members in the included file" warning proved to be too aggressive for external projects like Chromium (https://bugs.chromium.org/p/chromium/issues/detail?id=749197). This recommit makes the problematic warning a non-default one, and gives it the -Wpragma-pack-suspicious-include warning option. The first recommit (r308441) caused a "non-default #pragma pack value might change the alignment of struct or union members in the included file" warning in LLVM itself. This recommit tweaks the added warning to avoid warnings for #includes that don't have any records that are affected by the non-default alignment. This tweak avoids the previously emitted warning in LLVM. Original message: This commit adds a new -Wpragma-pack warning. It warns in the following cases: - When a translation unit is missing terminating #pragma pack (pop) directives. - When entering an included file if the current alignment value as determined by '#pragma pack' directives is different from the default alignment value. - When leaving an included file that changed the state of the current alignment value. rdar://10184173 Differential Revision: https://reviews.llvm.org/D35484 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309386 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r309106 "Recommit r308327 2nd time: Add a warning for missing"Hans Wennborg2017-07-262-23/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The warning fires on non-suspicious code in Chromium. Reverting until a solution is figured out. > Recommit r308327 2nd time: Add a warning for missing > '#pragma pack (pop)' and suspicious uses of '#pragma pack' in included files > > The first recommit (r308441) caused a "non-default #pragma pack value might > change the alignment of struct or union members in the included file" warning > in LLVM itself. This recommit tweaks the added warning to avoid warnings for > #includes that don't have any records that are affected by the non-default > alignment. This tweak avoids the previously emitted warning in LLVM. > > Original message: > > This commit adds a new -Wpragma-pack warning. It warns in the following cases: > > - When a translation unit is missing terminating #pragma pack (pop) directives. > - When entering an included file if the current alignment value as determined > by '#pragma pack' directives is different from the default alignment value. > - When leaving an included file that changed the state of the current alignment > value. > > rdar://10184173 > > Differential Revision: https://reviews.llvm.org/D35484 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309186 91177308-0d34-0410-b5e6-96231b3b80d8
* Recommit r308327 2nd time: Add a warning for missingAlex Lorenz2017-07-262-15/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | '#pragma pack (pop)' and suspicious uses of '#pragma pack' in included files The first recommit (r308441) caused a "non-default #pragma pack value might change the alignment of struct or union members in the included file" warning in LLVM itself. This recommit tweaks the added warning to avoid warnings for #includes that don't have any records that are affected by the non-default alignment. This tweak avoids the previously emitted warning in LLVM. Original message: This commit adds a new -Wpragma-pack warning. It warns in the following cases: - When a translation unit is missing terminating #pragma pack (pop) directives. - When entering an included file if the current alignment value as determined by '#pragma pack' directives is different from the default alignment value. - When leaving an included file that changed the state of the current alignment value. rdar://10184173 Differential Revision: https://reviews.llvm.org/D35484 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309106 91177308-0d34-0410-b5e6-96231b3b80d8
* [coroutines] Add serialization/deserialization of coroutinesGor Nishanov2017-07-251-0/+77
| | | | | | | | | | | | Reviewers: rsmith Reviewed By: rsmith Subscribers: EricWF, cfe-commits Differential Revision: https://reviews.llvm.org/D35383 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308996 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r308441 "Recommit r308327: Add a warning for missing '#pragma pack ↵Hans Wennborg2017-07-192-23/+15
| | | | | | | | | | | | | | | | | | | | | (pop)' and suspicious uses of '#pragma pack' in included files" This seems to have broken the sanitizer-x86_64-linux buildbot. Reverting until it's fixed, especially since this landed just before the 5.0 branch. > This commit adds a new -Wpragma-pack warning. It warns in the following cases: > > - When a translation unit is missing terminating #pragma pack (pop) directives. > - When entering an included file if the current alignment value as determined > by '#pragma pack' directives is different from the default alignment value. > - When leaving an included file that changed the state of the current alignment > value. > > rdar://10184173 > > Differential Revision: https://reviews.llvm.org/D35484 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308455 91177308-0d34-0410-b5e6-96231b3b80d8
* Recommit r308327: Add a warning for missing '#pragma pack (pop)'Alex Lorenz2017-07-192-15/+23
| | | | | | | | | | | | | | | | | | | and suspicious uses of '#pragma pack' in included files This commit adds a new -Wpragma-pack warning. It warns in the following cases: - When a translation unit is missing terminating #pragma pack (pop) directives. - When entering an included file if the current alignment value as determined by '#pragma pack' directives is different from the default alignment value. - When leaving an included file that changed the state of the current alignment value. rdar://10184173 Differential Revision: https://reviews.llvm.org/D35484 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308441 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r308327Alex Lorenz2017-07-182-23/+15
| | | | | | | I forgot to test clang-tools-extra which is now failing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308328 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a warning for missing '#pragma pack (pop)' and suspicious usesAlex Lorenz2017-07-182-15/+23
| | | | | | | | | | | | | | | | | | | of '#pragma pack' in included files This commit adds a new -Wpragma-pack warning. It warns in the following cases: - When a translation unit is missing terminating #pragma pack (pop) directives. - When entering an included file if the current alignment value as determined by '#pragma pack' directives is different from the default alignment value. - When leaving an included file that changed the state of the current alignment value. rdar://10184173 Differential Revision: https://reviews.llvm.org/D35484 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308327 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] Allow unmarked overloadable functions.George Burgess IV2017-06-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch extends the `overloadable` attribute to allow for one function with a given name to not be marked with the `overloadable` attribute. The overload without the `overloadable` attribute will not have its name mangled. So, the following code is now legal: void foo(void) __attribute__((overloadable)); void foo(int); void foo(float) __attribute__((overloadable)); In addition, this patch fixes a bug where we'd accept code with `__attribute__((overloadable))` inconsistently applied. In other words, we used to accept: void foo(void); void foo(void) __attribute__((overloadable)); But we will do this no longer, since it defeats the original purpose of requiring `__attribute__((overloadable))` on all redeclarations of a function. This breakage seems to not be an issue in practice, since the only code I could find that had this pattern often looked like: void foo(void); void foo(void) __attribute__((overloadable)) __asm__("foo"); void foo(int) __attribute__((overloadable)); ...Which can now be simplified by simply removing the asm label and overloadable attribute from the redeclaration of `void foo(void);` Differential Revision: https://reviews.llvm.org/D32332 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306467 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't mark a member as a member specialization until we know we're keeping ↵Richard Smith2017-05-092-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | the specialization. This improves our behavior in a few ways: * We now guarantee that if a member is marked as being a member specialization, there will actually be a member specialization declaration somewhere on its redeclaration chain. This fixes a crash in modules builds where we would try to check that there was a visible declaration of the member specialization and be surprised to not find any declaration of it at all. * We don't set the source location of the in-class declaration of the member specialization to the out-of-line declaration's location until we have actually finished merging them. This fixes some very silly looking diagnostics, where we'd point a "previous declaration is here" note at the same declaration we're complaining about. Ideally we wouldn't mess with the prior declaration's location at all, but too much code assumes that the first declaration of an entity is a reasonable thing to use as an indication of where it was declared, and that's not really true for a member specialization unless we fake it like this. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302596 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] Add __is_aggregate type-traitEric Fiselier2017-04-122-0/+2
| | | | | | | | | | | | | | | | Summary: [LWG 2911](http://cplusplus.github.io/LWG/lwg-defects.html#2911) adds `std::is_aggregate` to the library, which requires a new builtin trait. This patch implements `__is_aggregate`. Reviewers: rsmith, majnemer, aaron.ballman Reviewed By: aaron.ballman Subscribers: STL_MSFT, cfe-commits Differential Revision: https://reviews.llvm.org/D31513 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300116 91177308-0d34-0410-b5e6-96231b3b80d8
* [Modules][PCH] Serialize #pragma packAlex Lorenz2017-03-311-0/+90
| | | | | | | | | | | | This patch serializes the state of #pragma pack. It preserves the state of the pragma from a PCH/from modules in a file that uses that PCH/those modules. rdar://21359084 Differential Revision: https://reviews.llvm.org/D31241 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299226 91177308-0d34-0410-b5e6-96231b3b80d8
* Unbreak windows bot.Graydon Hoare2017-03-291-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299012 91177308-0d34-0410-b5e6-96231b3b80d8
* [PCH] Attach instance's dependency collectors to PCH external AST sources.Graydon Hoare2017-03-291-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When a PCH is included via -include-pch, clang should treat the current TU as dependent on the sourcefile that the PCH was generated from. This is currently _partly_ accomplished by InitializePreprocessor calling AddImplicitIncludePCH to synthesize an implicit #include of the sourcefile, into the preprocessor's Predefines buffer. For FrontendActions such as PreprocessOnlyAction (which is, curiously, what the driver winds up running one of in response to a plain clang -M) this is sufficient: the preprocessor cranks over its Predefines and emits a dependency reference to the initial sourcefile. For other FrontendActions (for example -emit-obj or -fsyntax-only) the Predefines buffer is reset to the suggested predefines buffer from the PCH, so the dependency edge is lost. The result is that clang emits a .d file in those cases that lacks a reference to the .h file responsible for the input (and in Swift's case, our .swiftdeps file winds up not including a reference to the source file for a PCH bridging header.) This patch fixes the problem by taking a different tack: ignoring the Predefines buffer (which seems a bit like a hack anyways) and directly attaching the CompilerInstance's DependencyCollectors (and legacy DependencyFileGenerator) to the ASTReader for the external AST. This approach is similar to the one chosen in earlier consultation with Bruno and Ben, and I think it's the least-bad solution, given several options. Reviewers: bruno, benlangmuir, doug.gregor Reviewed By: bruno, doug.gregor Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D31378 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299009 91177308-0d34-0410-b5e6-96231b3b80d8
* [Serialization] Serialize DependentSizedExtVectorTypeAlex Lorenz2017-03-221-0/+18
| | | | | | | | | rdar://30659700 Differential Revision: https://reviews.llvm.org/D31134 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298493 91177308-0d34-0410-b5e6-96231b3b80d8
* [PCH] Avoid VarDecl emission attempt if no owning module avaiableBruno Cardoso Lopes2017-03-011-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a stopgap fix for PR31863, a regression introduced in r276159. Consider this snippet: struct FVector; struct FVector {}; struct FBox { FVector Min; FBox(int); }; namespace { FBox InvalidBoundingBox(0); } While parsing the DECL_VAR for 'struct FBox', clang recursively read all the dep decls until it finds the DECL_CXX_RECORD forward declaration for 'struct FVector'. Then, it resumes all the way up back to DECL_VAR handling in `ReadDeclRecord`, where it checks if `isConsumerInterestedIn` for the decl. One of the condition for `isConsumerInterestedIn` to return false is if the VarDecl is imported from a module `D->getImportedOwningModule()`, because it will get emitted when we import the relevant module. However, before checking if it comes from a module, clang checks if `Ctx.DeclMustBeEmitted(D)`, which triggers the emission of 'struct FBox'. Since one of its fields is still incomplete, it crashes. Instead, check if `D->getImportedOwningModule()` is true before calling `Ctx.DeclMustBeEmitted(D)`. Differential Revision: https://reviews.llvm.org/D29753 rdar://problem/30173654 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@296656 91177308-0d34-0410-b5e6-96231b3b80d8
* [Test] Make Lit tests C++11 compatible - miscCharles Li2017-02-171-3/+3
| | | | | | | | | Updated 5 tests. Differential Revision: https://reviews.llvm.org/D24812 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295484 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Correct ndrange_t implementationAnastasia Stulova2017-02-161-3/+0
| | | | | | | | | | | | | | | | Removed ndrange_t as Clang builtin type and added as a struct type in the OpenCL header. Use type name to do the Sema checking in enqueue_kernel and modify IR generation accordingly. Review: D28058 Patch by Dmitry Borisenkov! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295311 91177308-0d34-0410-b5e6-96231b3b80d8
* Serialize the UsesSEH bit on FunctionDeclReid Kleckner2017-01-101-0/+29
| | | | | | Fixes PR31539 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291600 91177308-0d34-0410-b5e6-96231b3b80d8
* Cleanup the handling of noinline function attributes, -fno-inline,Chandler Carruth2016-12-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -fno-inline-functions, -O0, and optnone. These were really, really tangled together: - We used the noinline LLVM attribute for -fno-inline - But not for -fno-inline-functions (breaking LTO) - But we did use it for -finline-hint-functions (yay, LTO is happy!) - But we didn't for -O0 (LTO is sad yet again...) - We had weird structuring of CodeGenOpts with both an inlining enumeration and a boolean. They interacted in weird ways and needlessly. - A *lot* of set smashing went on with setting these, and then got worse when we considered optnone and other inlining-effecting attributes. - A bunch of inline affecting attributes were managed in a completely different place from -fno-inline. - Even with -fno-inline we failed to put the LLVM noinline attribute onto many generated function definitions because they didn't show up as AST-level functions. - If you passed -O0 but -finline-functions we would run the normal inliner pass in LLVM despite it being in the O0 pipeline, which really doesn't make much sense. - Lastly, we used things like '-fno-inline' to manipulate the pass pipeline which forced the pass pipeline to be much more parameterizable than it really needs to be. Instead we can *just* use the optimization level to select a pipeline and control the rest via attributes. Sadly, this causes a bunch of churn in tests because we don't run the optimizer in the tests and check the contents of attribute sets. It would be awesome if attribute sets were a bit more FileCheck friendly, but oh well. I think this is a significant improvement and should remove the semantic need to change what inliner pass we run in order to comply with the requested inlining semantics by relying completely on attributes. It also cleans up tho optnone and related handling a bit. One unfortunate aspect of this is that for generating alwaysinline routines like those in OpenMP we end up removing noinline and then adding alwaysinline. I tried a bunch of other approaches, but because we recompute function attributes from scratch and don't have a declaration here I couldn't find anything substantially cleaner than this. Differential Revision: https://reviews.llvm.org/D28053 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290398 91177308-0d34-0410-b5e6-96231b3b80d8
* [c++1z] P0195R2: Support pack-expansion of using-declarations.Richard Smith2016-12-201-0/+35
| | | | | | | | | | | | | | | This change introduces UsingPackDecl as a marker for the set of UsingDecls produced by pack expansion of a single (unresolved) using declaration. This is not strictly necessary (we just need to be able to map from the original using declaration to its expansions somehow), but it's useful to maintain the invariant that each declaration reference instantiates to refer to one declaration. This is a re-commit of r290080 (reverted in r290092) with a fix for a use-after-lifetime bug. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290203 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[c++1z] P0195R2: Support pack-expansion of using-declarations."Daniel Jasper2016-12-191-35/+0
| | | | | | | This reverts commit r290080 as it leads to many Clang crashes, e.g.: http://lab.llvm.org:8011/builders/clang-cmake-aarch64-quick/builds/1814 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290092 91177308-0d34-0410-b5e6-96231b3b80d8
* [c++1z] P0195R2: Support pack-expansion of using-declarations.Richard Smith2016-12-191-0/+35
| | | | | | | | | | | | This change introduces UsingPackDecl as a marker for the set of UsingDecls produced by pack expansion of a single (unresolved) using declaration. This is not strictly necessary (we just need to be able to map from the original using declaration to its expansions somehow), but it's useful to maintain the invariant that each declaration reference instantiates to refer to one declaration. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290080 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a lit test issue exposed by r290056Yaxun Liu2016-12-181-3/+3
| | | | | | | | | | | The test requests a target which supports cl_khr_gl_msaa_sharing since in test/PCH/ocl_types.h it tries to enable cl_khr_gl_msaa_sharing. Therefore this test fails on targets not supporting cl_khr_gl_msaa_sharing, e.g. ppc64, etc. The fix is to add triple spir-unknown-unknown which supports cl_khr_gl_msaa_sharing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290059 91177308-0d34-0410-b5e6-96231b3b80d8
* Relax IRgen check in decl-in-prototype.c to match signext on PPC64Reid Kleckner2016-12-091-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289234 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't assert when redefining a built-in macro in a PCH, PR29119Nico Weber2016-12-091-0/+35
| | | | | | | | | | | | | | | | | PCH files store the macro history for a given macro, and the whole history list for one identifier is given to the Preprocessor at once via Preprocessor::setLoadedMacroDirective(). This contained an assert that no macro history exists yet for that identifier. That's usually true, but it's not true for builtin macros, which are created in Preprocessor() before flags and pchs are processed. Luckily, ASTWriter stops writing macro history lists at builtins (see shouldIgnoreMacro() in ASTWriter.cpp), so the head of the history list was missing for builtin macros. So make the assert weaker, and splice the history list to the existing single define for builtins. https://reviews.llvm.org/D27545 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289228 91177308-0d34-0410-b5e6-96231b3b80d8
* Store decls in prototypes on the declarator instead of in the ASTReid Kleckner2016-12-091-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This saves two pointers from FunctionDecl that were being used for some rare and questionable C-only functionality. The DeclsInPrototypeScope ArrayRef was added in r151712 in order to parse this kind of C code: enum e {x, y}; int f(enum {y, x} n) { return x; // should return 1, not 0 } The challenge is that we parse 'int f(enum {y, x} n)' it its own function prototype scope that gets popped before we build the FunctionDecl for 'f'. The original change was doing two questionable things: 1. Saving all tag decls introduced in prototype scope on a TU-global Sema variable. This is problematic when you have cases like this, where 'x' and 'y' shouldn't be visible in 'f': void f(void (*fp)(enum { x, y } e)) { /* no x */ } This patch fixes that, so now 'f' can't see 'x', which is consistent with GCC. 2. Storing the decls in FunctionDecl in ActOnFunctionDeclarator so that they could be used in ActOnStartOfFunctionDef. This is just an inefficient way to move information around. The AST lives forever, but the list of non-parameter decls in prototype scope is short lived. Moving these things to the Declarator solves both of these issues. Reviewers: rsmith Subscribers: jmolloy, cfe-commits Differential Revision: https://reviews.llvm.org/D27279 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289225 91177308-0d34-0410-b5e6-96231b3b80d8
* Add dllexport default ctor closure PCH regression test for PR31121Reid Kleckner2016-11-231-0/+26
| | | | | | Follow up to r287774 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287793 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove 24 instances of 'REQUIRES: shell'Reid Kleckner2016-10-201-2/+0
| | | | | | | | | | | | | | | | | Tests fall into one of the following categories: - The requirement was unnecessary - Additional quoting was required for backslashes in paths (see "sed -e 's/\\/\\\\/g'") in the sanitizer tests. - OpenMP used 'REQUIRES: shell' as a proxy for the test failing on Windows. Those tests fail there reliably, so use XFAIL instead. I tried not to remove shell requirements that were added to suppress flaky test failures, but if I screwed up, we can add it back as needed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@284793 91177308-0d34-0410-b5e6-96231b3b80d8
* [CUDA] Rework tests now that we emit deferred diagnostics during sema. ↵Justin Lebar2016-10-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | Test-only change. Summary: Previously we had to split out a lot of our tests into a test that checked only immediate errors and a test that checked only deferred errors. This was because, if you emitted any immediate errors, we wouldn't run codegen, where the deferred errors were emitted. We've fixed this, and now emit deferred errors during sema. This lets us merge a bunch of tests, and lets us convert some other tests to -fsyntax-only. Reviewers: tra Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25755 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@284553 91177308-0d34-0410-b5e6-96231b3b80d8
* [CUDA] Add #pragma clang force_cuda_host_device_{begin,end} pragmas.Justin Lebar2016-10-081-0/+27
| | | | | | | | | | | | | | | | | Summary: These cause us to consider all functions in-between to be __host__ __device__. You can nest these pragmas; you just can't have more 'end's than 'begin's. Reviewers: rsmith Subscribers: tra, jhen, cfe-commits Differential Revision: https://reviews.llvm.org/D24975 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@283677 91177308-0d34-0410-b5e6-96231b3b80d8
* P0035R4: add std::align_val_t overloads of operator new/delete in C++17 mode.Richard Smith2016-09-291-0/+35
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@282800 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not validate pch when -fno-validate-pch is setYaxun Liu2016-09-071-0/+39
| | | | | | | | | | | | | | | | There is a bug causing pch to be validated even though -fno-validate-pch is set. This patch fixes it. ASTReader relies on ASTReaderListener to initialize SuggestedPredefines, which is required for compilations using PCH. Before this change, PCHValidator is the default ASTReaderListener. After this change, when -fno-validate-pch is set, PCHValidator is disabled, but we need a replacement ASTReaderListener to initialize SuggestedPredefines. Class SimpleASTReaderListener is implemented for this purpose. This change only affects -fno-validate-pch. There is no functional change if -fno-validate-pch is not set. If -fno-validate-pch is not set, conflicts in predefined macros between pch and current compiler instance causes error. If -fno-validate-pch is set, predefine macros in current compiler override those in pch so that compilation can continue. Differential Revision: https://reviews.llvm.org/D24054 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@280842 91177308-0d34-0410-b5e6-96231b3b80d8
* Lazily load the ContextDecl for a lambda's DefinitionData, to fix aRichard Smith2016-08-251-0/+7
| | | | | | | | deserialization cycle caused by the ContextDecl recursively importing members of the lambda's closure type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@279694 91177308-0d34-0410-b5e6-96231b3b80d8
* PR29097: add an update record when we instantiate the default memberRichard Smith2016-08-241-6/+21
| | | | | | | initializer of an imported field. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@279667 91177308-0d34-0410-b5e6-96231b3b80d8
* P0217R3: serialization/deserialization support for c++17 decomposition ↵Richard Smith2016-08-121-0/+32
| | | | | | declarations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@278460 91177308-0d34-0410-b5e6-96231b3b80d8
* Support '#pragma once' in headers when using PCHSunil Srivastava2016-07-252-0/+18
| | | | | | | | | | | | | | The '#pragma once' directive was erroneously ignored when encountered in the header-file specified in generate-PCH-mode. This resulted in compile-time errors in some cases with legal code, and also a misleading warning being produced. Patch by Warren Ristow! Differential Revision: http://reviews.llvm.org/D19815 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@276653 91177308-0d34-0410-b5e6-96231b3b80d8
* The test added in r275267 does not work on read-only checkouts because of ↵Pierre Gousseau2016-07-141-7/+12
| | | | | | | | the use of touch -m -t. Following Tom Rybka suggestion, the test files are now copied to a temporary directory first. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275415 91177308-0d34-0410-b5e6-96231b3b80d8
* P0305R0: Semantic analysis and code generation for C++17 init-statement for ↵Richard Smith2016-07-142-0/+39
| | | | | | | | | | | 'if' and 'switch': if (stmt; condition) { ... } Patch by Anton Bikineev! Some minor formatting and comment tweets by me. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275350 91177308-0d34-0410-b5e6-96231b3b80d8
* [PCH/preamble] Make sure that if the preamble/PCH was serialized with errors ↵Argyrios Kyrtzidis2016-07-131-0/+28
| | | | | | | | | | that we set diagnostic engine state appropriately. Otherwise there can be a crash with CFG analysis warnings doing work on invalid AST. Fixes crash of rdar://26224134 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275313 91177308-0d34-0410-b5e6-96231b3b80d8
* [PCH] Add a fno-pch-timestamp option to cc1 to disable inclusion of ↵Pierre Gousseau2016-07-133-0/+31
| | | | | | | | | | | | timestamps in PCH files. This is to allow distributed build systems, that do not preserve time stamps, to use PCH files. Second and last part of the patch proposed at: Differential Revision: http://reviews.llvm.org/D20867 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275267 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-apply "test: Use add_lit_testsuites so that subsets of tests can be ↵Justin Bogner2016-07-053-4/+4
| | | | | | | | | | | | | | | | | specified" This version should actually remove the empty directories I removed all of the files from. Thanks to tstellar for pointing out git-svn's --rmdir flag. Original message: This creates make/ninja targets like check-clang-codegen and check-clang-unit, much like LLVM already has. I had to move some input files into Input directories so they weren't picked up as test directories. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274565 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "test: Use add_lit_testsuites so that subsets of tests can be specified"Justin Bogner2016-07-053-4/+4
| | | | | | | This reverts r274560. It's breaking a bunch of bots due to a directory with a space in the name. Doesn't repro locally for some reason. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274562 91177308-0d34-0410-b5e6-96231b3b80d8
* test: Use add_lit_testsuites so that subsets of tests can be specifiedJustin Bogner2016-07-053-4/+4
| | | | | | | | | This creates make/ninja targets like check-clang-codegen and check-clang-unit, much like LLVM already has. I had to move some input files into Input directories so they weren't picked up as test directories. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274560 91177308-0d34-0410-b5e6-96231b3b80d8
* [Feature] Add a builtin for indexing into parameter packs. Patch by Louis ↵Eric Fiselier2016-07-011-0/+16
| | | | | | | | | | | | | | | Dionne. This patch adds a __nth_element builtin that allows fetching the n-th type of a parameter pack with very little compile-time overhead. The patch was inspired by r252036 and r252115 by David Majnemer, which add a similar __make_integer_seq builtin for efficiently creating a std::integer_sequence. Reviewed as D15421. http://reviews.llvm.org/D15421 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274316 91177308-0d34-0410-b5e6-96231b3b80d8