summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Revert r304592Richard Trieu2017-06-032-37/+1
| | | | | | | r304592 - [ODRHash] Add support for TemplateArgument types. Possibly causing one of the errors in modules build bot. llvm-svn: 304618
* Fix assertion failure if we can't deduce a template argument for a variableRichard Smith2017-06-022-18/+21
| | | | | | | | | | | | template partial specialization. In passing, fix the deduction-crash.cpp test to actually run all the tests. Due to a typo, the last third of the file was being skipped by the parser and some of the tests were not actually testing anything as a result. Switch from FileCheck to -verify to make the problem more obvious and prevent this happening again. llvm-svn: 304604
* [ODRHash] Add support for TemplateArgument types.Richard Trieu2017-06-022-1/+37
| | | | llvm-svn: 304592
* [OpenCL] Harden function pointer diagnostics.Alexey Bader2017-06-024-2/+14
| | | | | | | | | | | | | | Summary: Improve OpenCL type checking by rejecting function pointer types. Reviewers: Anastasia, yaxunl Reviewed By: Anastasia Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D33821 llvm-svn: 304575
* [Modules] Fix use after scope.Benjamin Kramer2017-06-021-1/+2
| | | | | | Found by asan. llvm-svn: 304568
* ASTPrinter: Objective-C method declarations don't need a space afterAlex Lorenz2017-06-024-10/+17
| | | | | | | | the return type rdar://32332039 llvm-svn: 304553
* Tie the macOS tests in test/Integration to the latest macOS SDKAlex Lorenz2017-06-024-0/+6
| | | | | | | | This change will ensure that these tests won't fail when a new SDK that utilizes new compiler features is used. See https://reviews.llvm.org/D32178 for more context. llvm-svn: 304542
* Avoid calling report_fatal_error in the destructor of raw_fd_ostreamAlex Lorenz2017-06-021-0/+2
| | | | | | | | | | | | | when saving a module timestamp file This commit doesn't include a test as it requires a test that reproduces a file write/close error that couldn't really be constructed artificially. rdar://31860650 Differential Revision: https://reviews.llvm.org/D33357 llvm-svn: 304538
* clang/test/CodeGenCXX/unaligned-member-qualifier.cpp: Satisfy x86_thiscallcc.NAKAMURA Takumi2017-06-021-4/+4
| | | | llvm-svn: 304535
* Remove file that I forgot to remove as part of rL304523Roger Ferrer Ibanez2017-06-021-20/+0
| | | | llvm-svn: 304524
* Mangle __unaligned in Itanium ABIRoger Ferrer Ibanez2017-06-024-6/+79
| | | | | | | | | | | | | | | | | | | __unaligned is not currently mangled in any way in the Itanium ABI. This causes failures when using -fms-extensions and C++ in targets using Itanium ABI. As suggested by @rsmith the simplest thing to do here is actually mangle the qualifier as a vendor extension. This patch also removes the change done in D31976 and updates its test to the new reality. This fixes https://bugs.llvm.org/show_bug.cgi?id=33080 https://bugs.llvm.org/show_bug.cgi?id=33178 Differential Revision: https://reviews.llvm.org/D33398 llvm-svn: 304523
* Minor fixes to for-loop warning.Richard Trieu2017-06-021-29/+22
| | | | | | | | | | | | | The warning for unchanged loop variables outputted a diagnostic that was dependent on iteration order from a pointer set, which is not always deterministic. Switch to a set vector, which allows fast querying and preserves ordering. Also make other minor changes in this area. Use more range-based for-loops. Remove limitation on SourceRanges that no logner exists. llvm-svn: 304519
* Support lazy stat'ing of files referenced by module maps.Richard Smith2017-06-0220-152/+546
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for a `header` declaration in a module map to specify certain `stat` information (currently, size and mtime) about that header file. This has two purposes: - It removes the need to eagerly `stat` every file referenced by a module map. Instead, we track a list of unresolved header files with each size / mtime (actually, for simplicity, we track submodules with such headers), and when attempting to look up a header file based on a `FileEntry`, we check if there are any unresolved header directives with that `FileEntry`'s size / mtime and perform deferred `stat`s if so. - It permits a preprocessed module to be compiled without the original files being present on disk. The only reason we used to need those files was to get the `stat` information in order to do header -> module lookups when using the module. If we're provided with the `stat` information in the preprocessed module, we can avoid requiring the files to exist. Unlike most `header` directives, if a `header` directive with `stat` information has no corresponding on-disk file the enclosing module is *not* marked unavailable (so that behavior is consistent regardless of whether we've resolved a header directive, and so that preprocessed modules don't get marked unavailable). We could actually do this for all `header` directives: the only reason we mark the module unavailable if headers are missing is to give a diagnostic slightly earlier (rather than waiting until we actually try to build the module / load and validate its .pcm file). Differential Revision: https://reviews.llvm.org/D33703 llvm-svn: 304515
* Revert "[AArch64] Add ARMv8.2-A FP16 vefctor intrinsics"Vedant Kumar2017-06-029-2238/+240
| | | | | | | | | | | | This reverts commit r304493. It breaks all the Darwin bots: http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental_check/37168 Failure: Failing Tests (2): Clang :: CodeGen/aarch64-v8.2a-neon-intrinsics.c Clang :: CodeGen/arm_neon_intrinsics.c llvm-svn: 304509
* [Sema] Improve -Wstrict-prototypes diagnostic message for blocks.Akira Hatanaka2017-06-024-18/+40
| | | | | | | | | | | Print "this block declaration is not a prototype" for non-prototype declarations of blocks instead of "this function declaration ...". rdar://problem/32461723 Differential Revision: https://reviews.llvm.org/D33739 llvm-svn: 304507
* PR32848: There isn't necessarily a FileChanged or FileSkipped for every ↵Richard Smith2017-06-022-4/+9
| | | | | | | | | InclusionDirective callback. In particular, you don't get one if the inclusion directive encountered an error. Don't assert in that case. llvm-svn: 304506
* [ThinLTO] Add x86 requires to thin_link_bitcode. NFC.Tim Shen2017-06-021-0/+2
| | | | | | | | | It already specifies the triples, so the intention was to test x86 for now (or then). Differential Revision: https://reviews.llvm.org/D33692 llvm-svn: 304501
* [CodeGen] Surround assertion with parentheses.Davide Italiano2017-06-011-1/+1
| | | | | | This should placate GCC's -Wparentheses. llvm-svn: 304499
* [ThinLTO] Wire up ThinLTO and new PMTim Shen2017-06-012-3/+24
| | | | | | | | | | | | Summary: This patch teaches clang to use and propagate new PM in ThinLTO. Reviewers: davide, chandlerc, tejohnson Subscribers: mehdi_amini, Prazek, inglorion, cfe-commits Differential Revision: https://reviews.llvm.org/D33692 llvm-svn: 304496
* [AArch64] Add ARMv8.2-A FP16 vefctor intrinsicsAbderrazek Zaafrani2017-06-019-240/+2238
| | | | llvm-svn: 304493
* Relax test to try and appease builders. NFC.Vedant Kumar2017-06-011-6/+6
| | | | | | | | | | I'm not sure why, but on some bots, the order of two instructions are swapped (as compared to the output on my machine). Loosen up the CHECK-NEXT directives to deal with this. Failing bot: http://lab.llvm.org:8011/builders/clang-with-lto-ubuntu/builds/3097 llvm-svn: 304486
* Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.Galina Kistanova2017-06-011-0/+2
| | | | llvm-svn: 304481
* Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.Galina Kistanova2017-06-011-0/+1
| | | | llvm-svn: 304479
* Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.Galina Kistanova2017-06-011-0/+4
| | | | llvm-svn: 304478
* Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.Galina Kistanova2017-06-011-1/+2
| | | | llvm-svn: 304477
* Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.Galina Kistanova2017-06-011-2/+3
| | | | llvm-svn: 304475
* Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.Galina Kistanova2017-06-011-0/+1
| | | | llvm-svn: 304473
* Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.Galina Kistanova2017-06-011-0/+4
| | | | llvm-svn: 304472
* [CGDebugInfo] Finalize SubPrograms when we're done with themKeno Fischer2017-06-013-4/+7
| | | | | | | | | | | | | | | | | | `GenerateVarArgsThunk` in `CGVTables` clones a function before the frontend is done emitting the compilation unit. Because of the way that DIBuilder works, this means that the attached subprogram had incomplete (temporary) metadata. Cloning such metadata is semantically disallowed, but happened to work anyway due to bugs in the cloning logic. rL304226 attempted to fix up that logic, but in the process exposed the incorrect API use here and had to be reverted. To be able to fix this, I added a new method to DIBuilder in rL304467, to allow finalizing a subprogram independently of the entire compilation unit. Use that here, in preparation of re-applying rL304226. Reviewers: aprantl, dblaikie Differential Revision: https://reviews.llvm.org/D33705 llvm-svn: 304470
* Don't assume that a store source is a vector type just because the ↵Simon Pilgrim2017-06-012-2/+14
| | | | | | destination is (PR26099) llvm-svn: 304465
* Escape filenames in module map line marker directives, to unbreak Windows ↵Richard Smith2017-06-012-4/+10
| | | | | | build bots. llvm-svn: 304464
* [Modules] Handle sanitizer feature mismatches when importing modulesVedant Kumar2017-06-017-5/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes it an error to have a mismatch between the enabled sanitizers in a CU, and in any module being imported into the CU. Only mismatches between non-modular sanitizers are treated as errors. This patch also includes non-modular sanitizers in module hashes, in order to ensure module rebuilds occur when -fsanitize=X is toggled on and off for non-modular sanitizers, and to cut down on module rebuilds when the option is toggled for modular sanitizers. This fixes a longstanding issue with implicit modules and sanitizers, which Duncan originally diagnosed. When building with implicit modules it's possible to hit a scenario where modules are built without -fsanitize=address, and are subsequently imported into CUs with -fsanitize=address enabled. This causes strange failures at runtime. The case Duncan found affects libcxx, since its vector implementation behaves differently when ASan is enabled. Implicit module builds should "just work" when -fsanitize=X is toggled on and off across multiple compiler invocations, which is what this patch does. Differential Revision: https://reviews.llvm.org/D32724 llvm-svn: 304463
* [ubsan] Add a check for pointer overflow UBVedant Kumar2017-06-017-58/+391
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Check pointer arithmetic for overflow. For some more background on this check, see: https://wdtz.org/catching-pointer-overflow-bugs.html https://reviews.llvm.org/D20322 Patch by Will Dietz and John Regehr! This version of the patch is different from the original in a few ways: - It introduces the EmitCheckedInBoundsGEP utility which inserts checks when the pointer overflow check is enabled. - It does some constant-folding to reduce instrumentation overhead. - It does not check some GEPs in CGExprCXX. I'm not sure that inserting checks here, or in CGClass, would catch many bugs. Possible future directions for this check: - Introduce CGF.EmitCheckedStructGEP, to detect overflows when accessing structures. Testing: Apart from the added lit test, I ran check-llvm and check-clang with a stage2, ubsan-instrumented clang. Will and John have also done extensive testing on numerous open source projects. Differential Revision: https://reviews.llvm.org/D33305 llvm-svn: 304459
* Add compatibility alias for -Wno-#warningsDavid Blaikie2017-06-012-0/+2
| | | | | | | GCC uses -Wno-cpp for this, so seems reasonable to add an alias to match. llvm-svn: 304456
* Fixed broken test (strict-vtable-pointers)Piotr Padlewski2017-06-011-1/+1
| | | | llvm-svn: 304455
* [SemaCXX] Add diagnostics to require_constant_initializationKeno Fischer2017-06-012-9/+74
| | | | | | | | | | | | | Summary: This hooks up the detailed diagnostics of why constant initialization was not possible if require_constant_initialization reports an error. I have updated the test to account for the new notes. Reviewed By: EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D24371 llvm-svn: 304451
* [CodeGen][ObjC] Fix assertion failure in EmitARCStoreStrongCall.Akira Hatanaka2017-06-012-1/+33
| | | | | | | | | | | | | The assertion fails because EmitValueForIvarAtOffset doesn't get the correct type of the ivar when the class the ivar belongs to is parameterized. This commit fixes the function to compute the ivar's type based on the type argument provided to the parameterized class. rdar://problem/32461723 Differential Revision: https://reviews.llvm.org/D33698 llvm-svn: 304449
* Emit invariant.group.barrier when using union fieldPiotr Padlewski2017-06-012-1/+141
| | | | | | | | | | | | | | | | Summary: We need to emit barrier if the union field is CXXRecordDecl because it might have vptrs. The testcode was wrongly devirtualized. It also proves that having different groups for different dynamic types is not sufficient. Reviewers: rjmccall, rsmith, mehdi_amini Subscribers: amharc, cfe-commits Differential Revision: https://reviews.llvm.org/D31830 llvm-svn: 304448
* Strip trailing whitespace. NFCI.Simon Pilgrim2017-06-011-147/+147
| | | | llvm-svn: 304445
* Remove late nullptr pointer test (PR32447)Simon Pilgrim2017-06-011-2/+2
| | | | | | IgnoreNarrowingConversion should never return nullptr, but I've added an assert just in case. llvm-svn: 304444
* Increase the limit for the number of DiagnosticLexKinds.td diags.Yaron Keren2017-06-011-1/+1
| | | | | | 300 was reached in r304190, 400 should be enough for a while. llvm-svn: 304411
* Make the clang-cl test less restrictive.Alexander Kornienko2017-06-011-2/+2
| | | | | | Make the test less restrictive to allow directory layout used in our test setup. llvm-svn: 304408
* Fixed warningsPiotr Padlewski2017-06-012-2/+3
| | | | llvm-svn: 304397
* [OpenCL] spir_kern by defaul: fix old test casesPekka Jaaskelainen2017-06-016-8/+8
| | | | llvm-svn: 304396
* Emit available_externally vtables opportunisticallyPiotr Padlewski2017-06-018-22/+123
| | | | | | | | | | | | | | Summary: We can emit vtable definition having inline function if they are all emitted. Reviewers: rjmccall, rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D33437 llvm-svn: 304394
* Adapt tests after making mcpu=generic the default for armv7-a and armv8-a.Kristof Beyls2017-06-013-8/+8
| | | | llvm-svn: 304391
* [OpenCL] Makes kernels use the SPIR_KERNEL CC by default.Pekka Jaaskelainen2017-06-016-11/+117
| | | | | | | | | | | | | | | | Rationale: OpenCL kernels are called via an explicit runtime API with arguments set with clSetKernelArg(), not as normal sub-functions. Return SPIR_KERNEL by default as the kernel calling convention to ensure the fingerprint is fixed such way that each OpenCL argument gets one matching argument in the produced kernel function argument list to enable feasible implementation of clSetKernelArg() with aggregates etc. In case we would use the default C calling conv here, clSetKernelArg() might break depending on the target-specific conventions; different targets might split structs passed as values to multiple function arguments etc. https://reviews.llvm.org/D33639 llvm-svn: 304389
* docs: Document LLD's cache dir argument.Peter Collingbourne2017-06-011-0/+2
| | | | llvm-svn: 304385
* CGCleanup: (NFC) add another test for r304335 - Don't try to spill static ↵Gor Nishanov2017-06-011-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | allocas Summary: Coroutine related test that used to trigger broken IR prior to r304335. ``` %x = alloca i32, align 4 store i32* %x, i32** %tmp.exprcleanup, align 4 ; <===== HERE %ref.tmp3 = alloca %struct.A, align 1 %agg.tmp5 = alloca %"struct.std::experimental::coroutines_v1::coroutine_handle.0", align 4 %tmp.exprcleanup = alloca i32*, align 4 %allocapt = bitcast i32 undef to i32 store i32 %0, i32* %.addr, align 4 ``` Fixed with r304335 Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D33750 llvm-svn: 304380
* PR33232: implement support for MSVC's __is_trivially_destructible trait.Richard Smith2017-06-014-18/+114
| | | | | | | | | | | | | | | | | Unlike the GCC-compatible __has_trivial_destructor trait, this one computes the right answer rather than performing the quirky set of checks described in GCC's documentation (https://gcc.gnu.org/onlinedocs/gcc/Type-Traits.html). MSVC also has a __has_trivial_destructor trait which is the same as its (and now Clang's) __is_trivially_destructible trait; we might want to consider changing the behavior of __has_trivial_destructor if we're targeting an MSVC platform, but I'm not doing so for now. While implementing this I found that we were incorrectly rejecting __is_destructible queries on arrays of unknown bound of incomplete types; that too is fixed, and I've added similar tests for other traits for good measure. llvm-svn: 304376
OpenPOWER on IntegriCloud