summaryrefslogtreecommitdiffstats
path: root/clang/test/PCH
Commit message (Collapse)AuthorAgeFilesLines
* Stop messing with the 'g' group of options in CompilerInvocation.Douglas Katzman2015-10-082-2/+2
| | | | | | | | | | | | | | | | With this change, most 'g' options are rejected by CompilerInvocation. They remain only as Driver options. The new way to request debug info from cc1 is with "-debug-info-kind={line-tables-only|limited|standalone}" and "-dwarf-version={2|3|4}". In the absence of a command-line option to specify Dwarf version, the Toolchain decides it, rather than placing Toolchain-specific logic in CompilerInvocation. Also fix a bug in the Windows compatibility argument parsing in which the "rightmost argument wins" principle failed. Differential Revision: http://reviews.llvm.org/D13221 llvm-svn: 249655
* Support __builtin_ms_va_list.Charles Davis2015-09-174-0/+21
| | | | | | | | | | | | | | | | | | 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
* [OpenCL] Add new types for OpenCL 2.0.Alexey Bader2015-09-151-0/+34
| | | | | | | | Patch by Pedro Ferreira. Reviewers: pekka.jaaskelainen Differential Revision: http://reviews.llvm.org/D12855 llvm-svn: 247676
* Fix crash on invalid if we can't find a suitable PCH file in a specifiedRichard Smith2015-09-041-2/+8
| | | | | | | directory, and our frontend action cares whether the frontend setup actually succeeded. llvm-svn: 246881
* Don't use fprintf to emit this diagnostic!Richard Smith2015-09-011-0/+3
| | | | llvm-svn: 246526
* PR24597: Fix in-place evaluation of call expressions to provide a proper "this"Richard Smith2015-08-281-0/+1
| | | | | | pointer to an RVO construction of a returned object. llvm-svn: 246263
* Internal-linkage variables with constant-evaluatable initializers do not ↵Richard Smith2015-08-191-3/+12
| | | | | | need to be emitted. (Also reduces the set of variables that need to be eagerly deserialized when using PCH / modules.) llvm-svn: 245497
* Remove bad test.Sean Silva2015-07-302-15/+0
| | | | | | | | | | | | | We currently don't canonicalize paths in the preprocessed files. But we do when writing to PCH. This causes a discrepancy on Windows with the test below. This test fails even on unix if you change the test to use `%S//preprocess.h`. I am led to conclude that the invariant that this test was intending to test has not been upheld for a while (and may never have been). llvm-svn: 243602
* Add missing files for objc_boxable feature.Alex Denisov2015-07-233-0/+25
| | | | | | Original patch [r240761] is missing all new files because of committer's mistake. llvm-svn: 243018
* [Sema] Emit a better diagnostic when variable redeclarations disagreeDavid Majnemer2015-07-141-2/+2
| | | | | | | | | | | We referred to all declaration in definitions in our diagnostic messages which is can be inaccurate. Instead, classify the declaration and emit an appropriate diagnostic for the new declaration and an appropriate note pointing to the old one. This fixes PR24116. llvm-svn: 242190
* Tweak clang/test/PCH/chain-openmp-threadprivate.cpp to satisfy i686-win32.NAKAMURA Takumi2015-07-141-1/+1
| | | | llvm-svn: 242131
* Fix test for Visual C++.Yaron Keren2015-07-141-5/+7
| | | | llvm-svn: 242124
* Mark clang/test/PCH/chain-openmp-threadprivate.cpp as REQUIRES:tls.NAKAMURA Takumi2015-07-141-0/+3
| | | | llvm-svn: 242116
* [OpenMP] Add TLS-based implementation for threadprivate directive.Samuel Antao2015-07-131-2/+12
| | | | llvm-svn: 242080
* Revert "Revert r241620 and follow-up commits" and move the initializationAdrian Prantl2015-07-0817-1/+17
| | | | | | of the llvm targets from clang/CodeGen into ClangCheck.cpp and CIndex.cpp. llvm-svn: 241653
* Revert r241620 and follow-up commits while investigating linux buildbot ↵Adrian Prantl2015-07-0717-17/+1
| | | | | | failures. llvm-svn: 241642
* Wrap clang modules and pch files in an object file container.Adrian Prantl2015-07-0717-1/+17
| | | | | | | | | | | | | This patch adds ObjectFilePCHContainerOperations uses the LLVM backend to put the contents of a PCH into a __clangast section inside a COFF, ELF, or Mach-O object file container. This is done to facilitate module debugging by makeing it possible to store the debug info for the types defined by a module alongside the AST. rdar://problem/20091852 llvm-svn: 241620
* Implement variance for Objective-C type parameters.Douglas Gregor2015-07-071-2/+10
| | | | | | | | | | | | | | | Introduce co- and contra-variance for Objective-C type parameters, which allows us to express that (for example) an NSArray is covariant in its type parameter. This means that NSArray<NSMutableString *> * is a subtype of NSArray<NSString *> *, which is expected of the immutable Foundation collections. Type parameters can be annotated with __covariant or __contravariant to make them co- or contra-variant, respectively. This feature can be detected by __has_feature(objc_generics_variance). Implements rdar://problem/20217490. llvm-svn: 241549
* Implement the Objective-C __kindof type qualifier.Douglas Gregor2015-07-071-0/+33
| | | | | | | | | | The __kindof type qualifier can be applied to Objective-C object (pointer) types to indicate id-like behavior, which includes implicit "downcasting" of __kindof types to subclasses and id-like message-send behavior. __kindof types provide better type bounds for substitutions into unspecified generic types, which preserves more type information. llvm-svn: 241548
* Substitute type arguments into uses of Objective-C interface members.Douglas Gregor2015-07-071-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When messaging a method that was defined in an Objective-C class (or category or extension thereof) that has type parameters, substitute the type arguments for those type parameters. Similarly, substitute into property accesses, instance variables, and other references. This includes general infrastructure for substituting the type arguments associated with an ObjCObject(Pointer)Type into a type referenced within a particular context, handling all of the substitutions required to deal with (e.g.) inheritance involving parameterized classes. In cases where no type arguments are available (e.g., because we're messaging via some unspecialized type, id, etc.), we substitute in the type bounds for the type parameters instead. Example: @interface NSSet<T : id<NSCopying>> : NSObject <NSCopying> - (T)firstObject; @end void f(NSSet<NSString *> *stringSet, NSSet *anySet) { [stringSet firstObject]; // produces NSString* [anySet firstObject]; // produces id<NSCopying> (the bound) } When substituting for the type parameters given an unspecialized context (i.e., no specific type arguments were given), substituting the type bounds unconditionally produces type signatures that are too strong compared to the pre-generics signatures. Instead, use the following rule: - In covariant positions, such as method return types, replace type parameters with “id” or “Class” (the latter only when the type parameter bound is “Class” or qualified class, e.g, “Class<NSCopying>”) - In other positions (e.g., parameter types), replace type parameters with their type bounds. - When a specialized Objective-C object or object pointer type contains a type parameter in its type arguments (e.g., NSArray<T>*, but not NSArray<NSString *> *), replace the entire object/object pointer type with its unspecialized version (e.g., NSArray *). llvm-svn: 241543
* Handle Objective-C type arguments.Douglas Gregor2015-07-071-0/+4
| | | | | | | | | | | | | | | | | | | | | Objective-C type arguments can be provided in angle brackets following an Objective-C interface type. Syntactically, this is the same position as one would provide protocol qualifiers (e.g., id<NSCopying>), so parse both together and let Sema sort out the ambiguous cases. This applies both when parsing types and when parsing the superclass of an Objective-C class, which can now be a specialized type (e.g., NSMutableArray<T> inherits from NSArray<T>). Check Objective-C type arguments against the type parameters of the corresponding class. Verify the length of the type argument list and that each type argument satisfies the corresponding bound. Specializations of parameterized Objective-C classes are represented in the type system as distinct types. Both specialized types (e.g., NSArray<NSString *> *) and unspecialized types (NSArray *) are represented, separately. llvm-svn: 241542
* Parsing, semantic analysis, and AST for Objective-C type parameters.Douglas Gregor2015-07-071-0/+30
| | | | | | | | | | | | | | | | | | | | Produce type parameter declarations for Objective-C type parameters, and attach lists of type parameters to Objective-C classes, categories, forward declarations, and extensions as appropriate. Perform semantic analysis of type bounds for type parameters, both in isolation and across classes/categories/extensions to ensure consistency. Also handle (de-)serialization of Objective-C type parameter lists, along with sundry other things one must do to add a new declaration to Clang. Note that Objective-C type parameters are typedef name declarations, like typedefs and C++11 type aliases, in support of type erasure. Part of rdar://problem/6294649. llvm-svn: 241541
* Account for calling convention specifiers in function definitions in IR test ↵David Blaikie2015-06-294-6/+6
| | | | | | | | | | | | | cases Several tests wouldn't pass when executed on an armv7a_pc_linux triple due to the non-default arm_aapcs calling convention produced on the function definitions in the IR output. Account for this with the application of a little regex. Patch by Ying Yi. llvm-svn: 240971
* [ObjC] Add NSValue support for objc_boxed_expressionsAlex Denisov2015-06-261-0/+13
| | | | | | | | | | | | | Patch extends ObjCBoxedExpr to accept records (structs and unions): typedef struct __attribute__((objc_boxable)) _Color { int r, g, b; } Color; Color color; NSValue *boxedColor = @(color); // [NSValue valueWithBytes:&color objCType:@encode(Color)]; llvm-svn: 240761
* Commit some test changes somehow missed in r239789.Richard Smith2015-06-162-4/+4
| | | | llvm-svn: 239791
* Implementing C99 partial re-initialization behavior (DR-253)Yunzhong Gao2015-06-101-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | Based on previous discussion on the mailing list, clang currently lacks support for C99 partial re-initialization behavior: Reference: http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-April/029188.html Reference: http://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_253.htm This patch attempts to fix this problem. Given the following code snippet, struct P1 { char x[6]; }; struct LP1 { struct P1 p1; }; struct LP1 l = { .p1 = { "foo" }, .p1.x[2] = 'x' }; // this example is adapted from the example for "struct fred x[]" in DR-253; // currently clang produces in l: { "\0\0x" }, // whereas gcc 4.8 produces { "fox" }; // with this fix, clang will also produce: { "fox" }; Differential Review: http://reviews.llvm.org/D5789 llvm-svn: 239446
* [OPENMP] -fopenmp enables OpenMP support (fix for http://llvm.org/PR23492)Alexey Bataev2015-05-201-2/+2
| | | | | | | -fopenmp turns on OpenMP support and links libiomp5 as OpenMP library. Also there is -fopenmp={libiomp5|libgomp} option that allows to override effect of -fopenmp and link libgomp library (if -fopenmp=libgomp is specified). Differential Revision: http://reviews.llvm.org/D9736 llvm-svn: 237769
* Add the test case from PR 14044 to ensure it doesn't regress.Kaelyn Takata2015-05-081-0/+12
| | | | | | | The test started working at some point, presumably fixed through the delayed typo correction work. llvm-svn: 236883
* DebugInfo: Metadata constructs now start with DI*Duncan P. N. Exon Smith2015-04-291-1/+1
| | | | | | | | | | LLVM r236120 renamed debug info IR constructs to use a `DI` prefix, now that the `DIDescriptor` hierarchy has been gone for about a week. This commit was generated using the rename-md-di-nodes.sh upgrade script attached to PR23080, followed by running clang-format-diff.py on the `lib/` portion of the patch. llvm-svn: 236121
* Use raw_pwrite_stream in clang.Rafael Espindola2015-04-141-2/+2
| | | | | | This is a small improvement to -emit-pth and allows llvm to start requiring it. llvm-svn: 234897
* Bring r234620 back now that llvm is fixed.Rafael Espindola2015-04-131-0/+7
| | | | | | | | | | LLVM can now detect if a fd is seekable on windows. Original commit message: Actually check if lseek works instead of using a filename based heuristic. llvm-svn: 234738
* Revert r234620 and others, "Actually check if lseek works instead of using a ↵NAKAMURA Takumi2015-04-131-10/+0
| | | | | | | | | | filename based heuristic." It was affected by r234615, which was reverted in r234721. r234620, "Actually check if lseek works instead of using a filename based heuristic." r234621, "Testcase for the previous commit." r234718, "Suppress clang/test/PCH/emit-pth.c on win32, for now while investigating." llvm-svn: 234730
* Suppress clang/test/PCH/emit-pth.c on win32, for now while investigating.NAKAMURA Takumi2015-04-131-0/+3
| | | | | | MSVCRT's _lseek(SEEK_CUR) doesn't return -1 for raw_ostream::SupportSeeking. llvm-svn: 234718
* Testcase for the previous commit.Rafael Espindola2015-04-101-0/+7
| | | | | | Sorry, fogot to "git add" the previous time. llvm-svn: 234621
* Run dos2unix on test/PCH/cxx1y-lambdas.mmReid Kleckner2015-04-011-58/+58
| | | | llvm-svn: 233834
* Try to unbreak the Windows buildbots.Filipe Cabecinhas2015-03-031-1/+1
| | | | llvm-svn: 231170
* DebugInfo: Move new hierarchy into place (clang)Duncan P. N. Exon Smith2015-03-031-1/+3
| | | | | | | Update testcases for LLVM change in r231082 to use the new debug info hierarchy. llvm-svn: 231083
* Remove shell requirements from tests that use 'cd'Reid Kleckner2015-03-021-1/+0
| | | | | | | | Modules and Tooling tests in particular tend to want to change the cwd, so we were missing test coverage in this area on Windows. It should now be easier to write such portable tests. llvm-svn: 231029
* Use Itanium triple in test using -WpaddingReid Kleckner2015-02-251-4/+7
| | | | | | | | | -Wpadding is not implemented in the Microsoft record layout builder. This test only passes on Windows because PCH forces us to use the Itanium record layout builder. I'm about to fix that, so change the test to not rely on that ridiculous behavior. llvm-svn: 230524
* Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."Adrian Prantl2015-02-2517-17/+1
| | | | llvm-svn: 230454
* Fix bots failing on an explicit tripleReid Kleckner2015-02-251-0/+3
| | | | | | Why do we need a registered target for this? llvm-svn: 230450
* MS ABI: Add triple to test relying on key functionsReid Kleckner2015-02-251-3/+3
| | | | llvm-svn: 230447
* Wrap clang module files in a Mach-O, ELF, or COFF container.Adrian Prantl2015-02-2517-1/+17
| | | | | | | | | | | | | | | | | 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. This reapplies r230044 with a fixed configure+make build and updated dependencies and testcase requirements. Over the last iteration this version adds - missing target requirements for testcases that specify an x86 triple, - a missing clangCodeGen.a dependency to libClang.a in the make build. rdar://problem/19104245 llvm-svn: 230423
* Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."Adrian Prantl2015-02-241-1/+0
| | | | | | | This reverts commit r230305. Off to fix another round of missing dependencies on various platforms. llvm-svn: 230309
* Wrap clang module files in a Mach-O, ELF, or COFF container.Adrian Prantl2015-02-241-0/+1
| | | | | | | | | | | | | | 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. Take 3. llvm-svn: 230305
* Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."Adrian Prantl2015-02-211-1/+0
| | | | | | | | This reverts commit 230099. The Linux configure+make build variant still needs some work. llvm-svn: 230103
* Wrap clang module files in a Mach-O, ELF, or COFF container.Adrian Prantl2015-02-201-0/+1
| | | | | | | | | | | | | | 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. Take 2. llvm-svn: 230089
* Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."Adrian Prantl2015-02-201-1/+0
| | | | | | | | This reverts commit r230067. Investigating another batch of problems found by the bots. llvm-svn: 230073
* Wrap clang module files in a Mach-O, ELF, or COFF container.Adrian Prantl2015-02-201-0/+1
| | | | | | | | | | | | | | 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
* Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."Adrian Prantl2015-02-201-1/+0
| | | | | | | | | This reverts commit r230044 while dealing with buildbot breakage. Conflicts: test/Modules/module_container.m llvm-svn: 230052
OpenPOWER on IntegriCloud