summaryrefslogtreecommitdiffstats
path: root/clang/test/PCH/Inputs
Commit message (Collapse)AuthorAgeFilesLines
* [c++20] P1959R0: Remove support for std::*_equality.Richard Smith2019-12-161-131/+1
|
* When skipping code at the start of a file during PCH use, Preprocessor::LexMike Rice2019-04-291-0/+3
| | | | | | | | | | | | | | is not used since it consumes all preprocessor directives until it returns a real token. Using the specific Lexer (i.e. CurLexer->Lex) makes it possible to stop skipping after an #include or #pragma hdrstop. Previously the skipping code was only handling CurLexer, now all will be handled correctly. Fixes: llvm.org/PR41585 Differential Revision: https://reviews.llvm.org/D61217 llvm-svn: 359506
* [clang-cl, PCH] Support for /Yc and /Yu without filename and #pragma hdrstopMike Rice2018-09-112-0/+24
| | | | | | | | | | | | | With clang-cl, when the user specifies /Yc or /Yu without a filename the compiler uses a #pragma hdrstop in the main source file to determine the end of the PCH. If a header is specified with /Yc or /Yu #pragma hdrstop has no effect. The optional #pragma hdrstop filename argument is not yet supported. Differential Revision: https://reviews.llvm.org/D51391 llvm-svn: 341963
* Fix for bug 38508 - Don't do PCH processing when only generating ↵Erich Keane2018-08-172-0/+3
| | | | | | | | | | | | preprocessor output This clang-cl driver change removes the PCH options when we are only generating preprocessed output. This is similar to the behavior of Y-. Patch by: mikerice Differential Revision: https://reviews.llvm.org/D50640 llvm-svn: 340025
* Add PCH tests for R336379Erich Keane2018-07-059-0/+23
| | | | | | I seemingly forgot the tests for this commit, added here. llvm-svn: 336380
* [C++2a] Implement operator<=> CodeGen and ExprConstantEric Fiselier2018-05-071-0/+437
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch tackles long hanging fruit for the builtin operator<=> expressions. It is currently needs some cleanup before landing, but I want to get some initial feedback. The main changes are: * Lookup, build, and store the required standard library types and expressions in `ASTContext`. By storing them in ASTContext we don't need to store (and duplicate) the required expressions in the BinaryOperator AST nodes. * Implement [expr.spaceship] checking, including diagnosing narrowing conversions. * Implement `ExprConstant` for builtin spaceship operators. * Implement builitin operator<=> support in `CodeGenAgg`. Initially I emitted the required comparisons using `ScalarExprEmitter::VisitBinaryOperator`, but this caused the operand expressions to be emitted once for every required cmp. * Implement [builtin.over] with modifications to support the intent of P0946R0. See the note on `BuiltinOperatorOverloadBuilder::addThreeWayArithmeticOverloads` for more information about the workaround. Reviewers: rsmith, aaron.ballman, majnemer, rnk, compnerd, rjmccall Reviewed By: rjmccall Subscribers: rjmccall, rsmith, aaron.ballman, junbuml, mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D45476 llvm-svn: 331677
* Support '#pragma once' in headers when using PCHSunil Srivastava2016-07-251-0/+5
| | | | | | | | | | | | | 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 llvm-svn: 276653
* [PCH] Add a fno-pch-timestamp option to cc1 to disable inclusion of ↵Pierre Gousseau2016-07-132-0/+4
| | | | | | | | | | | | 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 llvm-svn: 275267
* Re-apply "test: Use add_lit_testsuites so that subsets of tests can be ↵Justin Bogner2016-07-052-0/+30
| | | | | | | | | | | | | | | | | 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. llvm-svn: 274565
* Revert "test: Use add_lit_testsuites so that subsets of tests can be specified"Justin Bogner2016-07-052-30/+0
| | | | | | | 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. llvm-svn: 274562
* test: Use add_lit_testsuites so that subsets of tests can be specifiedJustin Bogner2016-07-052-0/+30
| | | | | | | | | 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. llvm-svn: 274560
* Fix a bug involving deferred decl emission and PCHReid Kleckner2016-04-221-0/+4
| | | | | | | | | | | | | | | | For various reasons, involving dllexport and class linkage compuations, we have to wait until after the semicolon after a class declaration to emit inline methods. These are "deferred" decls. Before this change, finishing the tag decl would trigger us to deserialize some PCH so that we could make a "pretty" IR-level type. Deserializing the PCH triggered calls to HandleTopLevelDecl, which, when done, checked the deferred decl list, and emitted some dllexported decls that weren't ready. Avoid this re-entrancy. Deferred decls should not get emitted when a tag is finished, they should only be emitted after a real top level decl in the main file. llvm-svn: 267186
* [Clang][ARM] __va_list declaration is not saved in ASTContext causing ↵Oleg Ranevskyy2016-03-301-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | compilation error or crash Summary: When the code is compiled for arm32 and the builtin `__va_list` declaration is created by `CreateAAPCSABIBuiltinVaListDecl`, the declaration is not saved in the `ASTContext` which may lead to a compilation error or crash. Minimal reproducer I was able to find: **header.h** ``` #include <stdarg.h> typedef va_list va_list_1; ``` **test.cpp** ``` typedef __builtin_va_list va_list_2; void foo(const char* format, ...) { va_list args; va_start( args, format ); } ``` Steps to reproduce: ``` clang -x c++-header --target=armv7l-linux-eabihf header.h clang -c -include header.h --target=armv7l-linux-eabihf test.cpp ``` Compilation error: ``` error: non-const lvalue reference to type '__builtin_va_list' cannot bind to a value of unrelated type 'va_list' (aka '__builtin_va_list') ``` Compiling the same code as a C source leads to a crash: ``` clang --target=armv7l-linux-eabihf header.h clang -c -x c -include header.h --target=armv7l-linux-eabihf test.cpp ``` Reviewers: logan, rsmith Subscribers: cfe-commits, asl, aemerson, rengolin Differential Revision: http://reviews.llvm.org/D18557 llvm-svn: 264930
* P0188R1: add support for standard [[fallthrough]] attribute. This is almostRichard Smith2016-03-081-1/+2
| | | | | | | | | | | | | | exactly the same as clang's existing [[clang::fallthrough]] attribute, which has been updated to have the same semantics. The one significant difference is that [[fallthrough]] is ill-formed if it's not used immediately before a switch label (even when -Wimplicit-fallthrough is disabled). To support that, we now build a CFG of any function that uses a '[[fallthrough]];' statement to check. In passing, fix some bugs with our support for statement attributes -- in particular, diagnose their use on declarations, rather than asserting. llvm-svn: 262881
* Support __builtin_ms_va_list.Charles Davis2015-09-171-0/+3
| | | | | | | | | | | | | | | | | | Summary: This change adds support for `__builtin_ms_va_list`, a GCC extension for variadic `ms_abi` functions. The existing `__builtin_va_list` support is inadequate for this because `va_list` is defined differently in the Win64 ABI vs. the System V/AMD64 ABI. Depends on D1622. Reviewers: rsmith, rnk, rjmccall CC: cfe-commits Differential Revision: http://reviews.llvm.org/D1623 llvm-svn: 247941
* [PCH/Modules] Check that the specific module cache path the PCH was built ↵Argyrios Kyrtzidis2015-02-192-0/+4
| | | | | | | | | | | | 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
* Objective-C. Reduce false positive warnings with -Wselector by issuing warning Fariborz Jahanian2014-05-091-0/+2
| | | | | | | only when named selector is declared in TU and it is not declared in a system header. rdar://16600230 llvm-svn: 208443
* Move all CUDA testing inputs to Inputs/ subdirectory inside the tests.Eli Bendersky2014-04-281-0/+20
| | | | llvm-svn: 207453
* Objective-C: Implements gcc's -Wselector optionFariborz Jahanian2013-05-301-1/+1
| | | | | | | | which diagnoses type mismatches of identical selectors declared in classes throughout. // rdar://14007194 llvm-svn: 182964
* Store on the CXXRecordDecl whether the class has, or would have, a copyRichard Smith2012-11-281-0/+3
| | | | | | | constructor/assignment operator with a const-qualified parameter type. The prior method for determining this incorrectly used overload resolution. llvm-svn: 168775
* [PCH] Remove the stat cache from the PCH file.Argyrios Kyrtzidis2012-10-311-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The stat cache became essentially useless ever since we started validating all file entries in the PCH. But the motivating reason for removing it now is that it also affected correctness in this situation: -You have a header without include guards (using "#pragma once" or #import) -When creating the PCH: -The same header is referenced in an #include with different filename cases. -In the PCH, of course, we record only one file entry for the header file -But we cache in the PCH file the stat info for both filename cases -Then the source files are updated and the header file is updated in a way that its size and modification time are the same but its inode changes -When using the PCH: -We validate the headers, we check that header file and we create a file entry with its current inode -There's another #include with a filename with different case than the previously created file entry -In order to get its stat info we go through the cached stat info of the PCH and we receive the old inode -because of the different inodes, we think they are different files so we go ahead and include its contents. Removing the stat cache will potentially break clients that are attempting to use the stat cache as a way of avoiding having the actual input files available. If that use case is important, patches are welcome to bring it back in a way that will actually work correctly (i.e., emit a PCH that is self-contained, coping with literal strings, line/column computations, etc.). This fixes rdar://5502805 llvm-svn: 167172
* Move the input files for test/PCH/badpch.c under test/PCH/Inputs/.Kaelyn Uhrain2012-10-252-0/+0
| | | | llvm-svn: 166711
* Rework the (de-)serialization of macros, as stored inDouglas Gregor2012-10-092-0/+7
| | | | | | | | | | | | | | | | MacroInfo*. Instead of simply dumping an offset into the current file, give each macro definition a proper ID with all of the standard modules-remapping facilities. Additionally, when a macro is modified in a subsequent AST file (e.g., #undef'ing a macro loaded from another module or from a precompiled header), provide a macro update record rather than rewriting the entire macro definition. This gives us greater consistency with the way we handle declarations, and ties together macro definitions much more cleanly. Note that we're still not actually deserializing macro history (we never were), but it's far easy to do properly now. llvm-svn: 165560
* Added a test for C++11 statement attributes serialization.Alexander Kornienko2012-10-021-0/+14
| | | | | | | | | | | | | | Summary: Uses [[clang::fallthrough]] attribute in a template function, and -Wimplicit-fallthrough to check the attribute presence in an instantiation. Reviewers: rsmith Reviewed By: rsmith CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D55 llvm-svn: 165068
* PR13189: va_list broken with precompiled headersMeador Inge2012-07-011-0/+5
| | | | | | | | | | For some targets a structure named __va_list_tag is built to help define the __builtin_va_list type. However, __va_list_tag was not being treated as a predefined type thus causing problems when serializing the AST. This commit fixes that oversight by adding the necessary support to treat __va_list_tag as a predefined type. llvm-svn: 159508
* objc-arc: bridge casts in non-arc mode are nowFariborz Jahanian2011-12-191-2/+8
| | | | | | error. // rdar://10597832 llvm-svn: 146918
* When writing out the entries in a lookup table for a DeclContext, makeDouglas Gregor2011-08-301-0/+6
| | | | | | | | sure that all of the CXXConversionDecls go into the same bucket. Otherwise, name lookup might not find them all. Fixes <rdar://problem/10041960>. llvm-svn: 138824
* Add support for C++ namespace-aware typo correction, e.g., correctingDouglas Gregor2011-06-281-0/+8
| | | | | | | | | | | | | | | vector<int> to std::vector<int> Patch by Kaelyn Uhrain, with minor tweaks + PCH support from me. Fixes PR5776/<rdar://problem/8652971>. Thanks Kaelyn! llvm-svn: 134007
* Automatic Reference Counting.John McCall2011-06-151-0/+20
| | | | | | | | | | Language-design credit goes to a lot of people, but I particularly want to single out Blaine Garst and Patrick Beard for their contributions. Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself, in no particular order. llvm-svn: 133103
* When writing file references in a pch, make sure to ask the file manager for ↵Anders Carlsson2011-03-081-0/+5
| | | | | | the absolute path. llvm-svn: 127248
* Putting back safe fixes 116836,116837,116838Andrew Trick2010-10-192-51/+0
| | | | llvm-svn: 116866
* Reverting 116836,116837,116838 until we resolve the getLangStandardForKind ↵Andrew Trick2010-10-192-0/+51
| | | | | | failures. llvm-svn: 116859
* Merge headers into test/PCH/chain-cxx.cpp for convenience.Argyrios Kyrtzidis2010-10-192-51/+0
| | | | llvm-svn: 116836
* When performing typo correction, look through the set of knownDouglas Gregor2010-10-141-0/+6
| | | | | | | | | | | | | | | | | | | | identifiers to determine good typo-correction candidates. Once we've identified those candidates, we perform name lookup on each of them and the consider the results. This optimization makes typo correction > 2x faster on a benchmark example using a single typo (NSstring) in a tiny file that includes Cocoa.h from a precompiled header, since we are deserializing far less information now during typo correction. There is a semantic change here, which is interesting. The presence of a similarly-named entity that is not visible can now affect typo correction. This is both good (you won't get weird corrections if the thing you wanted isn't in scope) and bad (you won't get good corrections if there is a similarly-named-but-completely-unrelated thing). Time will tell whether it was a good choice or not. llvm-svn: 116528
* Serialize the "inline" bit for namespaces. Fixes <rdar://problem/8515069>.Douglas Gregor2010-10-051-0/+4
| | | | llvm-svn: 115667
* Fix a marvelous chained AST writing bug, where we end up with theDouglas Gregor2010-10-052-0/+18
| | | | | | | | | | | | | | | | | | | | | | | following amusing sequence: - AST writing schedules writing a type X* that it had never seen before - AST writing starts writing another declaration, ends up deserializing X* from a prior AST file. Now we have two type IDs for the same type! - AST writer tries to write X*. It only has the lower-numbered ID from the the prior AST file, so references to the higher-numbered ID that was scheduled for writing go off into lalaland. To fix this, keep the higher-numbered ID so we end up writing the type twice. Since this issue occurs so rarely, and type records are generally rather small, I deemed this better than the alternative: to keep a separate mapping from the higher-numbered IDs to the lower-numbered IDs, which we would end up having to check whenever we want to deserialize any type. Fixes <rdar://problem/8511624>, I think. llvm-svn: 115647
* Register the __builtin_va_list_type node when we parse it, rather thanDouglas Gregor2010-10-051-0/+2
| | | | | | | | waiting until we think we need it: we didn't catch all of the places where we actually needed it, and we probably wouldn't ever. Fixes a C++ PCH crasher. llvm-svn: 115617
* When we insert a category (or class extension) into an interface, markDouglas Gregor2010-10-022-0/+8
| | | | | | | | the interface as having changed since it was originally serialized. This ensures that we see class extensions/categories in chained PCH files. llvm-svn: 115421
* When an identifier that has a macro definition in the original PCHDouglas Gregor2010-10-012-0/+2
| | | | | | | file is somehow changed in a chained PCH file, make sure that we write out the macro definition. Fixes part of <rdar://problem/8499034>. llvm-svn: 115259
* AST writer support for having specializations of templates from earlier in ↵Sebastian Redl2010-08-242-1/+17
| | | | | | the chain. This ought to finish C++ chained PCH support. llvm-svn: 111986
* Add testcase for C++ chained PCH and fix the bugs it uncovered in name lookup.Sebastian Redl2010-08-242-0/+35
| | | | llvm-svn: 111882
* Activate selectors in chained PCH. Chained PCH now works for Objective-C.Sebastian Redl2010-08-042-0/+23
| | | | llvm-svn: 110262
* Query only the latest version of an identifier in the PCH chain. Make sure ↵Sebastian Redl2010-08-022-0/+14
| | | | | | this version holds the entire declaration chain. This is a much saner solution than trying to merge the info from all elements, and makes redeclarations work properly. Expand the declarations test case to cover more compliated cases. llvm-svn: 110052
* Correctly deal with using names for both functions and structs in chained PCH.Sebastian Redl2010-07-304-2/+9
| | | | llvm-svn: 109871
* Make macro weirdness in chained PCH work. This required changing the way ↵Sebastian Redl2010-07-302-0/+8
| | | | | | PCHReader and PCHWriter are initialized to correctly pick up all initializer. On the upside, this means that there is far less repetition in the dependent PCH now. llvm-svn: 109823
* Support extended vector types in chained PCH.Sebastian Redl2010-07-282-0/+6
| | | | llvm-svn: 109675
* Add a test case for tentative definitions in chained PCH. Fix a bug that ↵Sebastian Redl2010-07-282-0/+24
| | | | | | completely messed up source locations and thus caused a crash whenever a diagnostic was emitted in chained PCH files. llvm-svn: 109660
* Record macros in dependent PCHs. Also add various info tables to dependent ↵Sebastian Redl2010-07-272-0/+2
| | | | | | PCHs; tests for this to follow. llvm-svn: 109554
* Introduce basic support for loading a precompiled preamble whileDouglas Gregor2010-07-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | reparsing an ASTUnit. When saving a preamble, create a buffer larger than the actual file we're working with but fill everything from the end of the preamble to the end of the file with spaces (so the lexer will quickly skip them). When we load the file, create a buffer of the same size, filling it with the file and then spaces. Then, instruct the lexer to start lexing after the preamble, therefore continuing the parse from the spot where the preamble left off. It's now possible to perform a simple preamble build + parse (+ reparse) with ASTUnit. However, one has to disable a bunch of checking in the PCH reader to do so. That part isn't committed; it will likely be handled with some other kind of flag (e.g., -fno-validate-pch). As part of this, fix some issues with null termination of the memory buffers created for the preamble; we were trying to explicitly NULL-terminate them, even though they were also getting implicitly NULL terminated, leading to excess warnings about NULL characters in source files. llvm-svn: 109445
* Make declarations in the dependent PCH visible, for C at least.Sebastian Redl2010-07-232-0/+2
| | | | llvm-svn: 109292
OpenPOWER on IntegriCloud