Commit Graph

68921 Commits

Author SHA1 Message Date
Galina Kistanova e37ad5a79e Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.
llvm-svn: 304645
2017-06-03 06:27:16 +00:00
Galina Kistanova a65d5785d8 Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.
llvm-svn: 304644
2017-06-03 06:26:27 +00:00
Galina Kistanova 39edaaa65c Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.
llvm-svn: 304643
2017-06-03 06:25:47 +00:00
Galina Kistanova d321611bfb Added LLVM_FALLTHROUGH to address warning: this statement may fall through + formatted. NFC.
llvm-svn: 304642
2017-06-03 06:25:29 +00:00
Galina Kistanova de7e22123a Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.
llvm-svn: 304641
2017-06-03 06:23:51 +00:00
Galina Kistanova 83b8a6c170 Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.
llvm-svn: 304640
2017-06-03 06:23:19 +00:00
Kostya Serebryany e425aada63 [sanitizer-coverage] one more flavor of coverage: -fsanitize-coverage=inline-8bit-counters. Experimental so far, not documenting yet. (clang part)
llvm-svn: 304631
2017-06-03 01:36:23 +00:00
Eric Fiselier de7943b947 [coroutines] Fix rebuilding of dependent coroutine parameters
Summary:
We were not handling correctly rebuilding of parameter and were not creating copies for them.
Now we will always rebuild parameter moves in TreeTransform's TransformCoroutineBodyStmt.

Reviewers: rsmith, GorNishanov

Reviewed By: rsmith

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D33797

llvm-svn: 304620
2017-06-03 00:22:18 +00:00
Richard Trieu d064d1b6e8 Revert r304592
r304592 - [ODRHash] Add support for TemplateArgument types.
Possibly causing one of the errors in modules build bot.

llvm-svn: 304618
2017-06-03 00:11:23 +00:00
Richard Smith f8ba3fd8e6 Fix assertion failure if we can't deduce a template argument for a variable
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
2017-06-02 22:53:06 +00:00
Richard Trieu 24c302b915 [ODRHash] Add support for TemplateArgument types.
llvm-svn: 304592
2017-06-02 20:35:29 +00:00
Alexey Bader 037dbe9535 [OpenCL] Harden function pointer diagnostics.
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
2017-06-02 18:08:58 +00:00
Benjamin Kramer ee021d54d7 [Modules] Fix use after scope.
Found by asan.

llvm-svn: 304568
2017-06-02 17:30:24 +00:00
Alex Lorenz bbf4f7091f ASTPrinter: Objective-C method declarations don't need a space after
the return type

rdar://32332039

llvm-svn: 304553
2017-06-02 15:02:59 +00:00
Alex Lorenz 01bf58d6ec Tie the macOS tests in test/Integration to the latest macOS SDK
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
2017-06-02 11:26:35 +00:00
Alex Lorenz 0bafa02709 Avoid calling report_fatal_error in the destructor of raw_fd_ostream
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
2017-06-02 10:36:56 +00:00
NAKAMURA Takumi c226303d3e clang/test/CodeGenCXX/unaligned-member-qualifier.cpp: Satisfy x86_thiscallcc.
llvm-svn: 304535
2017-06-02 09:53:05 +00:00
Roger Ferrer Ibanez b4aef7963e Remove file that I forgot to remove as part of rL304523
llvm-svn: 304524
2017-06-02 07:21:27 +00:00
Roger Ferrer Ibanez fd9384a229 Mangle __unaligned in Itanium ABI
__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
2017-06-02 07:14:34 +00:00
Richard Trieu 5fb874a484 Minor fixes to for-loop warning.
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
2017-06-02 04:24:46 +00:00
Richard Smith 040e12662a Support lazy stat'ing of files referenced by module maps.
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
2017-06-02 01:55:39 +00:00
Vedant Kumar a44a6ac81f Revert "[AArch64] Add ARMv8.2-A FP16 vefctor intrinsics"
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
2017-06-02 01:22:14 +00:00
Akira Hatanaka 13b333108e [Sema] Improve -Wstrict-prototypes diagnostic message for blocks.
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
2017-06-02 01:07:08 +00:00
Richard Smith 4b46f72c7f PR32848: There isn't necessarily a FileChanged or FileSkipped for every 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
2017-06-02 01:05:44 +00:00
Tim Shen a70ed1d693 [ThinLTO] Add x86 requires to thin_link_bitcode. NFC.
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
2017-06-02 00:08:58 +00:00
Davide Italiano 77378e42b3 [CodeGen] Surround assertion with parentheses.
This should placate GCC's -Wparentheses.

llvm-svn: 304499
2017-06-01 23:55:18 +00:00
Tim Shen 50fedec147 [ThinLTO] Wire up ThinLTO and new PM
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
2017-06-01 23:27:51 +00:00
Abderrazek Zaafrani a44e5f601d [AArch64] Add ARMv8.2-A FP16 vefctor intrinsics
llvm-svn: 304493
2017-06-01 23:22:29 +00:00
Vedant Kumar 7f2e3d1eba Relax test to try and appease builders. NFC.
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
2017-06-01 22:27:39 +00:00
Galina Kistanova 53ab424c0b Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.
llvm-svn: 304481
2017-06-01 21:29:45 +00:00
Galina Kistanova 387ab8b6da Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.
llvm-svn: 304479
2017-06-01 21:28:26 +00:00
Galina Kistanova 474f2ceff1 Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.
llvm-svn: 304478
2017-06-01 21:26:38 +00:00
Galina Kistanova 1aead4f56e Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.
llvm-svn: 304477
2017-06-01 21:23:52 +00:00
Galina Kistanova 6ef911c417 Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.
llvm-svn: 304475
2017-06-01 21:21:49 +00:00
Galina Kistanova d819d5bd68 Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.
llvm-svn: 304473
2017-06-01 21:19:06 +00:00
Galina Kistanova 7767425168 Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.
llvm-svn: 304472
2017-06-01 21:15:34 +00:00
Keno Fischer 41d4b4e588 [CGDebugInfo] Finalize SubPrograms when we're done with them
`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
2017-06-01 21:14:03 +00:00
Simon Pilgrim a5dbbc6ead Don't assume that a store source is a vector type just because the destination is (PR26099)
llvm-svn: 304465
2017-06-01 20:13:34 +00:00
Richard Smith c784e96eac Escape filenames in module map line marker directives, to unbreak Windows build bots.
llvm-svn: 304464
2017-06-01 20:10:35 +00:00
Vedant Kumar 85a83c2ced [Modules] Handle sanitizer feature mismatches when importing modules
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
2017-06-01 20:01:01 +00:00
Vedant Kumar a125eb55cb [ubsan] Add a check for pointer overflow UB
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
2017-06-01 19:22:18 +00:00
David Blaikie e16745f4e6 Add compatibility alias for -Wno-#warnings
GCC uses -Wno-cpp for this, so seems reasonable to add an alias to
match.

llvm-svn: 304456
2017-06-01 19:08:34 +00:00
Piotr Padlewski 4446e508ed Fixed broken test (strict-vtable-pointers)
llvm-svn: 304455
2017-06-01 19:08:05 +00:00
Keno Fischer 4792222fb5 [SemaCXX] Add diagnostics to require_constant_initialization
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
2017-06-01 18:54:16 +00:00
Akira Hatanaka 14149bfa41 [CodeGen][ObjC] Fix assertion failure in EmitARCStoreStrongCall.
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
2017-06-01 18:41:25 +00:00
Piotr Padlewski c1d26062f7 Emit invariant.group.barrier when using union field
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
2017-06-01 18:39:34 +00:00
Simon Pilgrim fb9662ae71 Strip trailing whitespace. NFCI.
llvm-svn: 304445
2017-06-01 18:17:18 +00:00
Simon Pilgrim f940987a4e Remove late nullptr pointer test (PR32447)
IgnoreNarrowingConversion should never return nullptr, but I've added an assert just in case.

llvm-svn: 304444
2017-06-01 18:13:02 +00:00
Yaron Keren 1d498f26c6 Increase the limit for the number of DiagnosticLexKinds.td diags.
300 was reached in r304190, 400 should be enough for a while.

llvm-svn: 304411
2017-06-01 12:46:59 +00:00
Alexander Kornienko c7a0b672b8 Make the clang-cl test less restrictive.
Make the test less restrictive to allow directory layout used in our test setup.

llvm-svn: 304408
2017-06-01 11:41:21 +00:00