]> granicus.if.org Git - clang/log
clang
6 years ago[PassManager/Sanitizer] Enable usage of ported AddressSanitizer passes with -fsanitiz...
Leonard Chan [Wed, 17 Oct 2018 15:38:22 +0000 (15:38 +0000)]
[PassManager/Sanitizer] Enable usage of ported AddressSanitizer passes with -fsanitize=address

Enable usage of `AddressSanitizer` and `AddressModuleSanitizer` ported from the
legacy to the new PassManager.

This patch depends on https://reviews.llvm.org/D52739.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344699 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoNFC: Remove trailing space from CodeGenModule.cpp
Takuto Ikuta [Wed, 17 Oct 2018 04:29:56 +0000 (04:29 +0000)]
NFC: Remove trailing space from CodeGenModule.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344668 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[python] [tests] Disable on known-broken arches
Michal Gorny [Wed, 17 Oct 2018 03:05:39 +0000 (03:05 +0000)]
[python] [tests] Disable on known-broken arches

Disable the Python binding tests on AArch64, Hexagon and SystemZ
following reports on test failures.  The first two yield different
results, possibly indicating test case problems.  The last one seems
to have broken FFI in Python.

While at it, refactor the code to make adding future test restrictions
easier.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344666 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU: add __builtin_amdgcn_update_dpp
Yaxun Liu [Wed, 17 Oct 2018 02:32:26 +0000 (02:32 +0000)]
AMDGPU: add __builtin_amdgcn_update_dpp

Emit llvm.amdgcn.update.dpp for both __builtin_amdgcn_mov_dpp and
__builtin_amdgcn_update_dpp. The first argument to
llvm.amdgcn.update.dpp will be undef for __builtin_amdgcn_mov_dpp.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344665 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[analyzer] [www] Minor improvements to the text in open_projects
George Karpenkov [Wed, 17 Oct 2018 01:15:53 +0000 (01:15 +0000)]
[analyzer] [www] Minor improvements to the text in open_projects

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344664 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[analyzer] [www] Updated a list of open projects
George Karpenkov [Wed, 17 Oct 2018 01:06:20 +0000 (01:06 +0000)]
[analyzer] [www] Updated a list of open projects

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344663 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoDisable code object version 3 for HIP toolchain
Yaxun Liu [Tue, 16 Oct 2018 17:36:23 +0000 (17:36 +0000)]
Disable code object version 3 for HIP toolchain

AMDGPU backend will switch to code object version 3 by default.
Since HIP runtime is not ready, disable it until the runtime is ready.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344630 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SystemZ] Actually enable -mzvector keywords
Ulrich Weigand [Tue, 16 Oct 2018 14:57:20 +0000 (14:57 +0000)]
[SystemZ] Actually enable -mzvector keywords

It appears when initially committing the support for the IBM Z vector
extension language, one critical line was lost, causing the specific
keywords __vector, __bool, and vec_step to not actually be enabled.
(Note that this does not affect "vector" and "bool"!)

Unfortunately, this was not caught by any tests either.  (All existing
Z vector tests just use the regular "vector" and "bool" keywords ...)

Fixed by adding the missing line and updating the tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344611 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[driver][mips] Support MIPS R6 target triples
Simon Atanasyan [Tue, 16 Oct 2018 14:29:27 +0000 (14:29 +0000)]
[driver][mips] Support MIPS R6 target triples

This change adds support for the following MIPS target triples:
  mipsisa32r6-linux-gnu
  mipsisa32r6el-linux-gnu
  mipsisa64r6-linux-gnuabi64
  mipsisa64r6el-linux-gnuabi64
  mipsisa64r6-linux-gnuabin32
  mipsisa64r6el-linux-gnuabin32

Patch by Yun Qiang Su.

Differential revision: https://reviews.llvm.org/D50850

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344608 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[driver][mips] Adjust target triple's environment accordingly to provided ABI name
Simon Atanasyan [Tue, 16 Oct 2018 10:19:06 +0000 (10:19 +0000)]
[driver][mips] Adjust target triple's environment accordingly to provided ABI name

For MIPS we need to adjust not only architecture name accordingly to ABI
provided by the `-mabi` command line option, but also modify triple's
environment. For example, for `mips-linux-gnu` triple and `-mabi=n32`
option a correct final triple is `mips64-linux-gnuabin32`.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344603 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix buildbots - update clang-interpreter to use Legacy ORC classes introduced in...
Simon Pilgrim [Tue, 16 Oct 2018 09:21:58 +0000 (09:21 +0000)]
Fix buildbots - update clang-interpreter to use Legacy ORC classes introduced in rL344572.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344598 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ARM][AArch64] Pass through endian flags to assembler and linker.
Peter Smith [Tue, 16 Oct 2018 09:21:17 +0000 (09:21 +0000)]
[ARM][AArch64] Pass through endian flags to assembler and linker.

The big-endian arm32 Linux builds are currently failing when the
-mbig-endian flag is used but the binutils default on the system is little
endian. This also holds when -mlittle-endian is used and the binutils
default is big endian.

The patch always passes through -EL or -BE to the assembler and linker,
taking into account the target and the -mbig-endian and -mlittle-endian
flag.

Fixes pr38770

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344597 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago Add target requirement to profile remap test.
Yvan Roux [Tue, 16 Oct 2018 08:47:36 +0000 (08:47 +0000)]
 Add target requirement to profile remap test.

 Fix bots which don't have x86_64 target built (ARM/AArch64).

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344593 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[mips] Group similar commands in the test case. NFC
Simon Atanasyan [Tue, 16 Oct 2018 05:18:36 +0000 (05:18 +0000)]
[mips] Group similar commands in the test case. NFC

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344583 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[OPENMP][NVPTX]Increment iterator only when it is used, NFC.
Alexey Bataev [Tue, 16 Oct 2018 00:09:06 +0000 (00:09 +0000)]
[OPENMP][NVPTX]Increment iterator only when it is used, NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344574 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[mips] Fix handling of GNUABIN32 environment in a target triple
Simon Atanasyan [Mon, 15 Oct 2018 22:43:23 +0000 (22:43 +0000)]
[mips] Fix handling of GNUABIN32 environment in a target triple

The `GNUABIN32` environment in a target triple implies using the N32
ABI. This patch adds support for this environment and switches on N32
ABI if necessary.

Patch by Patch by YunQiang Su.

Differential revision: https://reviews.llvm.org/D51464

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344570 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Driver] Support direct split DWARF emission for Fuchsia
Petr Hosek [Mon, 15 Oct 2018 21:30:32 +0000 (21:30 +0000)]
[Driver] Support direct split DWARF emission for Fuchsia

This enables the driver support for direct split DWARF emission for
Fuchsia in addition to Linux.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344556 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[analyzer] Add doxygen comments for the new CXXAllocatorCall APIs.
Artem Dergachev [Mon, 15 Oct 2018 18:01:34 +0000 (18:01 +0000)]
[analyzer] Add doxygen comments for the new CXXAllocatorCall APIs.

Forgot to squeeze this into r344539.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344540 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[analyzer] Teach CallEvent about C++17 aligned operator new().
Artem Dergachev [Mon, 15 Oct 2018 17:53:18 +0000 (17:53 +0000)]
[analyzer] Teach CallEvent about C++17 aligned operator new().

In C++17, when class C has large alignment value, a special case of
overload resolution rule kicks in for expression new C that causes the aligned
version of operator new() to be called. The aligned new has two arguments:
size and alignment. However, the new-expression has only one "argument":
the construct-expression for C(). This causes a false positive in
core.CallAndMessage's check for matching number of arguments and number
of parameters.

Update CXXAllocatorCall, which is a CallEvent sub-class for operator new calls
within new-expressions, so that the number of arguments always matched
the number of parameters.

rdar://problem/44738501

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344539 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[analyzer] NFC: RetainCountChecker: Don't dump() symbols into program point tags.
Artem Dergachev [Mon, 15 Oct 2018 17:47:56 +0000 (17:47 +0000)]
[analyzer] NFC: RetainCountChecker: Don't dump() symbols into program point tags.

We don't need a separate node for every symbol, because whenever the first
symbol leaks, a bug is emitted, the analysis is sinked, and the checker
callback immediately returns due to State variable turning into null,
so we never get to see the second leaking symbol.

Additionally, we are no longer able to break normal analysis while experimenting
with debug dumps.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344538 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[python] [tests] Disable python binding tests under LLVM_USE_SANITIZER=Address
Artem Dergachev [Mon, 15 Oct 2018 17:43:23 +0000 (17:43 +0000)]
[python] [tests] Disable python binding tests under LLVM_USE_SANITIZER=Address

They don't work yet.

Patch by Dan Liew!

rdar://problem/45242886

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344537 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert 344389 "Revert r344375 "[Driver] check for exit code from SIGPIPE""
Nick Desaulniers [Mon, 15 Oct 2018 17:39:00 +0000 (17:39 +0000)]
Revert 344389 "Revert r344375 "[Driver] check for exit code from SIGPIPE""

Summary:
Add preprocessor guards for UNIX.

This reverts commit r344389.

Reviewers: rnk, majnemer, jfb

Reviewed By: rnk

Subscribers: cfe-commits, pirama, srhines

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344536 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Fixed Point Arithmetic] FixedPointCast
Leonard Chan [Mon, 15 Oct 2018 16:07:02 +0000 (16:07 +0000)]
[Fixed Point Arithmetic] FixedPointCast

This patch is a part of https://reviews.llvm.org/D48456 in an attempt to
split them up. This contains the code for casting between fixed point types
and other fixed point types.

The method for converting between fixed point types is based off the convert()
method in APFixedPoint.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344530 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert "[CodeGenCXX] Treat 'this' as noalias in constructors"
Sean Fertile [Mon, 15 Oct 2018 15:43:00 +0000 (15:43 +0000)]
Revert "[CodeGenCXX] Treat 'this' as noalias in constructors"

This reverts commit https://reviews.llvm.org/rL344150 which causes
MachineOutliner related failures on the ppc64le multistage buildbot.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344526 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[CodeComplete] Make sure keyword 'template' is added even when code pattern is disabled.
Eric Liu [Mon, 15 Oct 2018 12:37:23 +0000 (12:37 +0000)]
[CodeComplete] Make sure keyword 'template' is added even when code pattern is disabled.

Reviewers: sammccall, hokein

Subscribers: arphaman, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344509 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[TI removal] Make `getTerminator()` return a generic `Instruction`.
Chandler Carruth [Mon, 15 Oct 2018 10:42:50 +0000 (10:42 +0000)]
[TI removal] Make `getTerminator()` return a generic `Instruction`.

This removes the primary remaining API producing `TerminatorInst` which
will reduce the rate at which code is introduced trying to use it and
generally make it much easier to remove the remaining APIs across the
codebase.

Also clean up some of the stragglers that the previous mechanical update
of variables missed.

Users of LLVM and out-of-tree code generally will need to update any
explicit variable types to handle this. Replacing `TerminatorInst` with
`Instruction` (or `auto`) almost always works. Most of these edits were
made in prior commits using the perl one-liner:
```
perl -i -ple 's/TerminatorInst(\b.* = .*getTerminator\(\))/Instruction\1/g'
```

This also my break some rare use cases where people overload for both
`Instruction` and `TerminatorInst`, but these should be easily fixed by
removing the `TerminatorInst` overload.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344504 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Hexagon] Update tests account for non-hardcoded linker name.
Sid Manning [Sun, 14 Oct 2018 17:51:36 +0000 (17:51 +0000)]
[Hexagon] Update tests account for non-hardcoded linker name.

Tests should not assume the linker's name, CLANG_DEFAULT_LINKER could
change it.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344482 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoTry harder to fix test/Driver/cl-showfilenames.c
Hans Wennborg [Sat, 13 Oct 2018 22:22:03 +0000 (22:22 +0000)]
Try harder to fix test/Driver/cl-showfilenames.c

Follow-up to r344462.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344469 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoMove some helpers from the global namespace into anonymous ones.
Benjamin Kramer [Sat, 13 Oct 2018 22:18:22 +0000 (22:18 +0000)]
Move some helpers from the global namespace into anonymous ones.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344468 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[analyzer] Improved cmake configuration for Z3
Enrico Steffinlongo [Sat, 13 Oct 2018 19:45:48 +0000 (19:45 +0000)]
[analyzer] Improved cmake configuration for Z3

Summary:
Enhanced support for Z3 in the cmake configuration of clang; now it is possible to specify any arbitrary Z3 install prefix (CLANG_ANALYZER_Z3_PREFIX) to cmake with lib (or bin) and include folders. Before the patch only in cmake default locations
were searched (https://cmake.org/cmake/help/v3.4/command/find_path.html).

Specifying any CLANG_ANALYZER_Z3_PREFIX will force also CLANG_ANALYZER_BUILD_Z3 to ON.

Removed also Z3 4.5 version requirement since it was not checked, and now Clang works with Z3 4.7

Reviewers: NoQ, george.karpenkov, mikhail.ramalho

Reviewed By: george.karpenkov

Subscribers: rnkovacs, NoQ, esteffin, george.karpenkov, delcypher, ddcc, mgorny, xazax.hun, szepet, a.sidorin, Szelethus

Tags: #clang

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344464 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[analyzer] Small SMT API improvement
Enrico Steffinlongo [Sat, 13 Oct 2018 19:42:10 +0000 (19:42 +0000)]
[analyzer] Small SMT API improvement

Summary: Removed const qualifier from reset method of SMTSolver and Z3Solver objects.

Reviewers: mikhail.ramalho, george.karpenkov, NoQ, ddcc

Reviewed By: NoQ

Subscribers: xazax.hun, szepet, a.sidorin, Szelethus

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344463 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRe-commit r344234 "clang-cl: Add /showFilenames option (PR31957)"
Hans Wennborg [Sat, 13 Oct 2018 19:13:14 +0000 (19:13 +0000)]
Re-commit r344234 "clang-cl: Add /showFilenames option (PR31957)"

The test was failing on e.g. PPC which can't target Windows. Fix by
requiring X86 target in the test. Also, make sure the output goes to a
temporary directory, since CWD may not be writable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344462 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Analyzer] Iterator Checker - Part 10: Tests for iterators passed as parameter
Adam Balogh [Sat, 13 Oct 2018 10:24:48 +0000 (10:24 +0000)]
[Analyzer] Iterator Checker - Part 10: Tests for iterators passed as parameter

In earlier Clang Static Analyzer versions `check::Bind() was not invoked for
parameter passing, so we needed a trick which is not needed anymore. However
add the tests to ensure its working.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344443 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[OPENMP][NVPTX]Reduce memory usage in target region.
Alexey Bataev [Fri, 12 Oct 2018 20:19:59 +0000 (20:19 +0000)]
[OPENMP][NVPTX]Reduce memory usage in target region.

Additional reduction of the global memory usage in the target regions
without parallel regions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344413 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MinGW] Allow using LTO when lld is used as linker
Martin Storsjo [Fri, 12 Oct 2018 20:15:51 +0000 (20:15 +0000)]
[MinGW] Allow using LTO when lld is used as linker

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344412 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[python] [tests] Re-add once again, this time without Windows
Michal Gorny [Fri, 12 Oct 2018 20:03:54 +0000 (20:03 +0000)]
[python] [tests] Re-add once again, this time without Windows

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344411 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert rL344365: [tests] Readd Python binding tests to check-all
Simon Pilgrim [Fri, 12 Oct 2018 19:46:40 +0000 (19:46 +0000)]
Revert rL344365: [tests] Readd Python binding tests to check-all

Windows buildbots are still not happy

Now that both issues found out during the last iteration have been
fixed, reenable the Python binding tests on buildbots.
........

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344408 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[clang-format] Fix BraceWrapping AfterFunction for ObjC methods
Ben Hamilton [Fri, 12 Oct 2018 19:43:01 +0000 (19:43 +0000)]
[clang-format] Fix BraceWrapping AfterFunction for ObjC methods

Summary:
> clang-format --version
> clang-format version 7.0.0 (tags/RELEASE_700/final)
> echo "@implementation Foo\n- (void)foo:(id)bar\n{\n}\n@end\n" |clang-format -style='{BreakBeforeBraces: Custom, BraceWrapping: {AfterFunction: true}}'
```
@implementation Foo
- (void)foo:(id)bar {
}
@end
```

with patch:

> bin/clang-format --version
> clang-format version 8.0.0 (trunk 344285)
> echo "@implementation Foo\n- (void)foo:(id)bar\n{\n}\n@end\n" |bin/clang-format -style='{BreakBeforeBraces: Custom, BraceWrapping: {AfterFunction: true}}'
```
@implementation Foo
- (void)foo:(id)bar
{
}
@end
```

Contributed by hultman@.

Reviewers: benhamilton, jolesiak, klimek, Wizard

Reviewed By: benhamilton

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344406 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix a clang::driver::ArgStringList usage I missed in rL344398. NFCI.
Simon Pilgrim [Fri, 12 Oct 2018 19:14:43 +0000 (19:14 +0000)]
Fix a clang::driver::ArgStringList usage I missed in rL344398. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344400 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoConsistently make llvm::opt::ArgStringList usage explicit to try and appease MSVC...
Simon Pilgrim [Fri, 12 Oct 2018 18:55:36 +0000 (18:55 +0000)]
Consistently make llvm::opt::ArgStringList usage explicit to try and appease MSVC 2015 buildbots. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344398 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert r344375 "[Driver] check for exit code from SIGPIPE"
Reid Kleckner [Fri, 12 Oct 2018 18:08:11 +0000 (18:08 +0000)]
Revert r344375 "[Driver] check for exit code from SIGPIPE"

This doesn't build on Windows.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344389 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Doc] fix second error in UsersManual
Jonas Toth [Fri, 12 Oct 2018 17:57:18 +0000 (17:57 +0000)]
[Doc] fix second error in UsersManual

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344388 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Doc] fix BB, add code-block type
Jonas Toth [Fri, 12 Oct 2018 17:44:01 +0000 (17:44 +0000)]
[Doc] fix BB, add code-block type

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344382 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Driver] check for exit code from SIGPIPE
Nick Desaulniers [Fri, 12 Oct 2018 17:22:46 +0000 (17:22 +0000)]
[Driver] check for exit code from SIGPIPE

Summary:
D53000 adds a special exit code for SIGPIPE (writing to a closed
reader), and rather than print a fatal warning, skips printing the
error.  This can be seen commonly from piping into head, tee, or
split.

Fixes PR25349, rdar://problem/14285346, b/77310947.

Reviewers: jfb

Reviewed By: jfb

Subscribers: cfe-commits, thakis, srhines

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344375 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[CodeGen] Handle extern references to OBJC_CLASS_$_*
Erik Pilkington [Fri, 12 Oct 2018 17:22:10 +0000 (17:22 +0000)]
[CodeGen] Handle extern references to OBJC_CLASS_$_*

Some ObjC users declare a extern variable named OBJC_CLASS_$_Foo, then use it's
address as a Class. I.e., one could define isInstanceOfF:

BOOL isInstanceOfF(id c) {
  extern void OBJC_CLASS_$_F;
  return [c class] == (Class)&OBJC_CLASS_$_F;
}

This leads to asserts in clang CodeGen if there is an @implementation of F in
the same TU as an instance of this pattern, because CodeGen assumes that a
variable named OBJC_CLASS_$_* has the right type. This commit fixes the problem
by RAUWing the old (incorrectly typed) global with a new global, then removing
the old global.

rdar://45077269

Differential revision: https://reviews.llvm.org/D53154

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344373 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Driver] Add defaults for Android ARM FPUs.
Dan Albert [Fri, 12 Oct 2018 17:06:31 +0000 (17:06 +0000)]
[Driver] Add defaults for Android ARM FPUs.

Summary:
Android mandates that devices have at least vfpv3-d16 until
Marshmallow and NEON after that. Still honor the user's decision, but
raise the defaults for Android targets.

Reviewers: srhines, pirama, javed.absar, kristof.beyls, peter.smith

Reviewed By: peter.smith

Subscribers: peter.smith, rengolin, kristof.beyls, chrib, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344367 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[tests] Readd Python binding tests to check-all
Michal Gorny [Fri, 12 Oct 2018 16:55:44 +0000 (16:55 +0000)]
[tests] Readd Python binding tests to check-all

Now that both issues found out during the last iteration have been
fixed, reenable the Python binding tests on buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344365 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[python] [tests] Remove cdb lookup failure test
Michal Gorny [Fri, 12 Oct 2018 16:55:39 +0000 (16:55 +0000)]
[python] [tests] Remove cdb lookup failure test

Remove the test checking for compilation db lookup failure.
Since r342228, JSONCompilationDatabasePlugin infers compile commands for
missing files, therefore making the lookup always succeed.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344364 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoMake YAML quote forward slashes.
Zachary Turner [Fri, 12 Oct 2018 16:31:20 +0000 (16:31 +0000)]
Make YAML quote forward slashes.

If you have the string /usr/bin, prior to this patch it would not
be quoted by our YAML serializer.  But a string like C:\src would
be, due to the presence of a backslash.  This makes the quoting
rules of basically every single file path different depending on
the path syntax (posix vs. Windows).

While technically not required by the YAML specification to quote
forward slashes, when the behavior of paths is inconsistent it
makes it difficult to portably write FileCheck lines that will
work with either kind of path.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344359 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert "Make YAML quote forward slashes."
Zachary Turner [Fri, 12 Oct 2018 16:31:08 +0000 (16:31 +0000)]
Revert "Make YAML quote forward slashes."

This reverts commit b86c16ad8c97dadc1f529da72a5bb74e9eaed344.

This is being reverted because I forgot to write a useful
commit message, so I'm going to resubmit it with an actual
commit message.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344358 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoMake YAML quote forward slashes.
Zachary Turner [Fri, 12 Oct 2018 16:24:09 +0000 (16:24 +0000)]
Make YAML quote forward slashes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344357 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[OPENMP][NVPTX]Reduce memory usage in orphaned functions.
Alexey Bataev [Fri, 12 Oct 2018 16:04:20 +0000 (16:04 +0000)]
[OPENMP][NVPTX]Reduce memory usage in orphaned functions.

if the function has globalized variables and called in context of
target/teams/distribute regions, it does not need to globalize 32
copies of the same variables for memory coalescing, it is enough to
have just one copy, because there is parallel region.
Patch does this by adding call for `__kmpc_parallel_level` function and
checking its return value. If the code sees that the parallel level is
0, then only one variable is allocated, not 32.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344356 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix MSVC 2015 ambiguous symbol warning introduced by rL344337. NFCI.
Simon Pilgrim [Fri, 12 Oct 2018 15:16:25 +0000 (15:16 +0000)]
Fix MSVC 2015 ambiguous symbol warning introduced by rL344337. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344352 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRemove top-level using declaration from header files, as these aliases leak.
Sam McCall [Fri, 12 Oct 2018 12:21:29 +0000 (12:21 +0000)]
Remove top-level using declaration from header files, as these aliases leak.

Reviewers: ilya-biryukov

Subscribers: arphaman, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344337 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Tooling] Expose ExecutorName option.
Eric Liu [Fri, 12 Oct 2018 11:47:36 +0000 (11:47 +0000)]
[Tooling] Expose ExecutorName option.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344335 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix Wdocumentation warning. NFCI.
Simon Pilgrim [Fri, 12 Oct 2018 10:34:03 +0000 (10:34 +0000)]
Fix Wdocumentation warning. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344333 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[analyzer] Fix a bug in unexplored_first_location_queue iteration order.
George Karpenkov [Fri, 12 Oct 2018 00:52:13 +0000 (00:52 +0000)]
[analyzer] Fix a bug in unexplored_first_location_queue iteration order.

Pointed out by Artem in post-commit review for https://reviews.llvm.org/D53058

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344322 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoUpdate user's manual documentation of profile remapping file to match
Richard Smith [Thu, 11 Oct 2018 23:48:11 +0000 (23:48 +0000)]
Update user's manual documentation of profile remapping file to match
llvm-cxxmap documentation.

Add a hint as to how to perform off-line profile data remapping.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344319 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[analyzer] Experiment with an iteration order only based on location, and not using...
George Karpenkov [Thu, 11 Oct 2018 22:59:59 +0000 (22:59 +0000)]
[analyzer] Experiment with an iteration order only based on location, and not using the stack frame

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344313 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[analyzer] Avoid unneeded invalidation in RetainCountChecker
George Karpenkov [Thu, 11 Oct 2018 22:59:38 +0000 (22:59 +0000)]
[analyzer] Avoid unneeded invalidation in RetainCountChecker

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344312 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[analyzer] Retain count checker for OSObject: recognize OSDynamicCast
George Karpenkov [Thu, 11 Oct 2018 22:59:16 +0000 (22:59 +0000)]
[analyzer] Retain count checker for OSObject: recognize OSDynamicCast

For now, tresting the cast as a no-op, and disregarding the case where
the output becomes null due to the type mismatch.

rdar://45174557

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344311 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert "[Driver] Default Android toolchains to libc++."
Dan Albert [Thu, 11 Oct 2018 21:28:42 +0000 (21:28 +0000)]
Revert "[Driver] Default Android toolchains to libc++."

Breaks some of the Android bots because they aren't expecting to need
to explicitly set -stdlib.

This reverts commit 031072f5048654b01a40f639633de1ff4e2f3dc8.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344297 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Driver] Default Android toolchains to libc++.
Dan Albert [Thu, 11 Oct 2018 20:58:43 +0000 (20:58 +0000)]
[Driver] Default Android toolchains to libc++.

Reviewers: srhines, pirama, EricWF

Reviewed By: srhines

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344296 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Driver] Default to `-z now` and `-z relro` on Android.
Dan Albert [Thu, 11 Oct 2018 20:57:54 +0000 (20:57 +0000)]
[Driver] Default to `-z now` and `-z relro` on Android.

Summary:
RTLD_LAZY is not supported on Android (though failing to use `-z now`
will work since it is assumed by the loader).

RelRO is required.

Reviewers: srhines, pirama

Reviewed By: srhines

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344295 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Driver] Fix --hash-style choice for Android.
Dan Albert [Thu, 11 Oct 2018 20:39:32 +0000 (20:39 +0000)]
[Driver] Fix --hash-style choice for Android.

Summary:
Android supports GNU style hashes as of Marshmallow, so we should be
generating both styles for pre-M targets and GNU hashes for newer
targets.

Reviewers: srhines, pirama

Reviewed By: srhines

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344293 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[python] [tests] Fix calling tests on Windows
Michal Gorny [Thu, 11 Oct 2018 20:26:55 +0000 (20:26 +0000)]
[python] [tests] Fix calling tests on Windows

Fix passing arguments to the Python test command to use 'env' builtin
CMake command, in order to fix compatibility with Windows.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344288 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[HIP] Remove unused irif bitcode from test
Aaron Enye Shi [Thu, 11 Oct 2018 19:52:32 +0000 (19:52 +0000)]
[HIP] Remove unused irif bitcode from test

This is part of previous commit [HIP] Replace irif library with hip.amdgcn.bc

Reviewers: yaxunl

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344285 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[HIP] Replace irif library with hip.amdgcn.bc
Aaron Enye Shi [Thu, 11 Oct 2018 19:41:54 +0000 (19:41 +0000)]
[HIP] Replace irif library with hip.amdgcn.bc

No longer use irif amdgcn library, instead we will use the previous fence functions from new hip.amdgcn.bc bitcode library. Update hip-device-libs.hip test as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344281 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert "clang-cl: Add /showFilenames option (PR31957)"
Sean Fertile [Thu, 11 Oct 2018 18:40:35 +0000 (18:40 +0000)]
Revert "clang-cl: Add /showFilenames option (PR31957)"

This reverts https://reviews.llvm.org/rL344234 which is causing failures on
several bots due to invalid llvm.linker.options.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344276 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[OPENMP][NVPTX]Reduce memory use for globalized vars in
Alexey Bataev [Thu, 11 Oct 2018 18:30:31 +0000 (18:30 +0000)]
[OPENMP][NVPTX]Reduce memory use for globalized vars in
target/teams/distribute regions.

Previously introduced globalization scheme that uses memory coalescing
scheme may increase memory usage fr the variables that are devlared in
target/teams/distribute contexts. We don't need 32 copies of such
variables, just 1. Patch reduces memory use in this case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344273 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert "[Lex] TokenConcatenation now takes const Preprocessor"
Eric Liu [Thu, 11 Oct 2018 17:50:04 +0000 (17:50 +0000)]
Revert "[Lex] TokenConcatenation now takes const Preprocessor"

This reverts commit r344262. This was an unintentional commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344267 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoclang-cl: set output of lit-test to a tmp file after r344234
Eric Liu [Thu, 11 Oct 2018 17:49:20 +0000 (17:49 +0000)]
clang-cl: set output of lit-test to a tmp file after r344234

Some test frameworks do not allow output file in CWD.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344266 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[python] [tests] Retab CMakeLists.txt for consistency (NFC)
Michal Gorny [Thu, 11 Oct 2018 17:45:35 +0000 (17:45 +0000)]
[python] [tests] Retab CMakeLists.txt for consistency (NFC)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344263 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Lex] TokenConcatenation now takes const Preprocessor
Eric Liu [Thu, 11 Oct 2018 17:35:29 +0000 (17:35 +0000)]
[Lex] TokenConcatenation now takes const Preprocessor

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344262 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[tests] Remove Python tests from check-all due to breakage
Michal Gorny [Thu, 11 Oct 2018 17:25:05 +0000 (17:25 +0000)]
[tests] Remove Python tests from check-all due to breakage

Remove the Python tests from default target in order to fix two
kinds of breakage uncovered by enabling them: one failing test on Linux,
and problem with the test command on Windows.  Both to be addressed
in followup revisions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344260 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoImprove -Wshadow warnings with enumerators.
Aaron Ballman [Thu, 11 Oct 2018 16:40:18 +0000 (16:40 +0000)]
Improve -Wshadow warnings with enumerators.

Addresses PR24718 by checking for enumerators that shadow other enumerators. Catches issues like:

enum E1{e1};
void f(void) {
  enum E2{e1};
}

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344259 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[tests] Include Python binding tests in CMake rules
Michal Gorny [Thu, 11 Oct 2018 16:32:54 +0000 (16:32 +0000)]
[tests] Include Python binding tests in CMake rules

Add a new CMake rule check-clang-python to run the Python bindings'
test suite, and include it in check-all.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344258 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoSome improvements to the OpenBSD driver.
Brad Smith [Thu, 11 Oct 2018 16:13:44 +0000 (16:13 +0000)]
Some improvements to the OpenBSD driver.

- OpenBSD has switched to compiler_rt / libcxx
- Fix sysroot and lib path handling
- Some cleaning up

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344257 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAdd support for 'dynamic_allocators' clause on 'requires' directive. Differential...
Patrick Lyster [Thu, 11 Oct 2018 14:41:10 +0000 (14:41 +0000)]
Add support for 'dynamic_allocators' clause on 'requires' directive. Differential Revision: https://reviews.llvm.org/D53079

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344249 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Tooling] Move CompilationDatabasePlugin to the Registry header, where it's useful...
Sam McCall [Thu, 11 Oct 2018 13:42:53 +0000 (13:42 +0000)]
[Tooling] Move CompilationDatabasePlugin to the Registry header, where it's useful. NFC

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344247 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Sema][OpenCL] Improve diagnostics for not viable overloadable function candidates
Andrew Savonichev [Thu, 11 Oct 2018 13:35:34 +0000 (13:35 +0000)]
[Sema][OpenCL] Improve diagnostics for not viable overloadable function candidates

Summary:
Allowed extension name (that ought to be disabled) printing in the note message.

This diagnostic was proposed here: https://reviews.llvm.org/D51341

Reviewers: Anastasia, yaxunl

Reviewed By: Anastasia

Subscribers: cfe-commits, asavonic, bader

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344246 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert r344241 as it broke multiple bots.
Aaron Ballman [Thu, 11 Oct 2018 12:57:29 +0000 (12:57 +0000)]
Revert r344241 as it broke multiple bots.

http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/10814
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/20613

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344244 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[analyzer][UninitializedObjectChecker] Reports Loc fields pointing to themselves
Kristof Umann [Thu, 11 Oct 2018 11:58:53 +0000 (11:58 +0000)]
[analyzer][UninitializedObjectChecker] Reports Loc fields pointing to themselves

I've added a new functionality, the checker is now able to
detect and report fields pointing to themselves. I figured
this would fit well into the checker as there's no reason
for a pointer to point to itself instead of being nullptr.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344242 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[tests] Include Python binding tests in CMake rules
Michal Gorny [Thu, 11 Oct 2018 11:58:14 +0000 (11:58 +0000)]
[tests] Include Python binding tests in CMake rules

Add a new CMake rule check-clang-python to run the Python bindings'
test suite, and include it in check-all.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344241 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[python] [tests] Support overriding library path via environment
Michal Gorny [Thu, 11 Oct 2018 11:58:07 +0000 (11:58 +0000)]
[python] [tests] Support overriding library path via environment

Support a new CLANG_LIBRARY_PATH environment variable for the Python
binding tests.  This variable can be used to force the bindings to load
libclang.* from a specific directory.

I plan to use this when integrating Python binding tests with the CMake
build system.  Currently, those tests load libclang.so from default
search paths, so I would have to rely on platform-specific mechanics
such as LD_LIBRARY_PATH.  Instead of copying the whole logic necessary
to handle platform differences into yet another place, it's easier to
just add a dedicated variable for this purpose.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344240 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoclang-cl: Add /showFilenames option (PR31957)
Hans Wennborg [Thu, 11 Oct 2018 10:04:15 +0000 (10:04 +0000)]
clang-cl: Add /showFilenames option (PR31957)

Add a /showFilenames option for users who want clang to echo the
currently compiled filename. MSVC does this echoing by default, and it's
useful for showing progress in build systems that doesn't otherwise
provide any progress report, such as MSBuild.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344234 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[clang][ubsan] Split Implicit Integer Truncation Sanitizer into unsigned and signed...
Roman Lebedev [Thu, 11 Oct 2018 09:09:50 +0000 (09:09 +0000)]
[clang][ubsan] Split Implicit Integer Truncation Sanitizer into unsigned and signed checks

Summary:
As per IRC disscussion, it seems we really want to have more fine-grained `-fsanitize=implicit-integer-truncation`:
* A check when both of the types are unsigned.
* Another check for the other cases (either one of the types is signed, or both of the types is signed).

This is clang part.
Compiler-rt part is D50902.

Reviewers: rsmith, vsk, Sanitizers

Reviewed by: rsmith

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344230 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[WebAssembly] Saturating float-to-int builtins
Thomas Lively [Thu, 11 Oct 2018 00:07:55 +0000 (00:07 +0000)]
[WebAssembly] Saturating float-to-int builtins

Summary: Depends on D53007 and D53004.

Reviewers: aheejin, dschuff

Subscribers: sbc100, jgravelle-google, sunfish, kristina, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344205 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoUpdate documentation to indicate that profile remapping support is only
Richard Smith [Wed, 10 Oct 2018 23:33:18 +0000 (23:33 +0000)]
Update documentation to indicate that profile remapping support is only
implemented for the new pass manager so far.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344201 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAdd a flag to remap manglings when reading profile data information.
Richard Smith [Wed, 10 Oct 2018 23:13:35 +0000 (23:13 +0000)]
Add a flag to remap manglings when reading profile data information.

This can be used to preserve profiling information across codebase
changes that have widespread impact on mangled names, but across which
most profiling data should still be usable. For example, when switching
from libstdc++ to libc++, or from the old libstdc++ ABI to the new ABI,
or even from a 32-bit to a 64-bit build.

The user can provide a remapping file specifying parts of mangled names
that should be treated as equivalent (eg, std::__1 should be treated as
equivalent to std::__cxx11), and profile data will be treated as
applying to a particular function if its name is equivalent to the name
of a function in the profile data under the provided equivalences. See
the documentation change for a description of how this is configured.

Remapping is supported for both sample-based profiling and instruction
profiling. We do not support remapping indirect branch target
information, but all other profile data should be remapped
appropriately.

Support is only added for the new pass manager. If someone wants to also
add support for this for the old pass manager, doing so should be
straightforward.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344199 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AST] Use -fvisibility value when ignoring -fv-i-h* inline static locals
Reid Kleckner [Wed, 10 Oct 2018 21:59:56 +0000 (21:59 +0000)]
[AST] Use -fvisibility value when ignoring -fv-i-h* inline static locals

Summary:
In r340386 we added code to give static locals in inline functions
default visibility. Instead, we should use the "default" visibility
passed on the command line, which could be hidden or protected, as GCC
does.

Some code bases use both -fvisibility=hidden and
-fvisibility-inlines-hidden to hide inline functions of classes that are
explicitly marked with default visibility.

Fixes PR39236

Reviewers: hans, thakis

Subscribers: eraman, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344190 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[clang] Fix failing attribute test on Windows
Louis Dionne [Wed, 10 Oct 2018 17:37:37 +0000 (17:37 +0000)]
[clang] Fix failing attribute test on Windows

The test added in r344146 was failing because the ABI on Windows is
different, and that test includes ABI-specific details. The test now
harcodes which ABI to use so we can rely on those details.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344159 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Sema] Fix a multiple definition bug with friends and templates
Erik Pilkington [Wed, 10 Oct 2018 17:17:51 +0000 (17:17 +0000)]
[Sema] Fix a multiple definition bug with friends and templates

The problem was that MergeFunctionDecl sometimes needs the injected template
arguments of a FunctionTemplateDecl, but is called before adding the new
template to the redecl chain. This leads to multiple common pointers in the same
redecl chain, each with their own identical instantiation. Fix this by merging
the the common state before inserting the new template into the redecl chain.

rdar://44810129

Differential revision: https://reviews.llvm.org/D53046

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344157 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[CodeGenCXX] Treat 'this' as noalias in constructors
Anton Bikineev [Wed, 10 Oct 2018 16:14:51 +0000 (16:14 +0000)]
[CodeGenCXX] Treat 'this' as noalias in constructors

This is currently a clang extension and a resolution
of the defect report in the C++ Standard.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344150 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[OpenCL] Fixed address space cast in C style cast of C++ parsing
Anastasia Stulova [Wed, 10 Oct 2018 16:05:22 +0000 (16:05 +0000)]
[OpenCL] Fixed address space cast in C style cast of C++ parsing

C style cast in OpenCL C++ was ignoring the address space
conversions from OpenCL C and as a result accepting incorrect
code to compile. This commit adds special function for checking
correctness of address spaces that is shared between C and C++
casts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344148 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Hexagon] Use GetLinkerPath instead of hard-coded string.
Sid Manning [Wed, 10 Oct 2018 15:37:03 +0000 (15:37 +0000)]
[Hexagon] Use GetLinkerPath instead of hard-coded string.

Add GetLinkerPath and set the default to "hexagon-link".
Use GetLinkerPath instead of the hard-coded string.

This change will allow -fuse-ld to function correctly.

Differential revision: https://reviews.llvm.org/D53038

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344147 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[clang] Properly apply attributes on explicit instantiations of static data members
Louis Dionne [Wed, 10 Oct 2018 15:32:29 +0000 (15:32 +0000)]
[clang] Properly apply attributes on explicit instantiations of static data members

Summary: https://llvm.org/PR39118

Reviewers: aaron.ballman, rnk

Subscribers: dexonsmith, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344146 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoLift VFS from clang to llvm (NFC)
Jonas Devlieghere [Wed, 10 Oct 2018 13:27:25 +0000 (13:27 +0000)]
Lift VFS from clang to llvm (NFC)

This patch moves the virtual file system form clang to llvm so it can be
used by more projects.

Concretely the patch:
 - Moves VirtualFileSystem.{h|cpp} from clang/Basic to llvm/Support.
 - Moves the corresponding unit test from clang to llvm.
 - Moves the vfs namespace from clang::vfs to llvm::vfs.
 - Formats the lines affected by this change, mostly this is the result of
   the added llvm namespace.

RFC on the mailing list:
http://lists.llvm.org/pipermail/llvm-dev/2018-October/126657.html

Differential revision: https://reviews.llvm.org/D52783

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344140 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[CodeComplete] Fix crash when completing params function declarations.
Sam McCall [Wed, 10 Oct 2018 10:51:48 +0000 (10:51 +0000)]
[CodeComplete] Fix crash when completing params function declarations.

Summary:
In a decl like `int AA(BB cc)` where BB isn't defined, we end up trying to
parse `BB cc` as an expression (vexing parse) and end up triggering the
parser's "recovery-in-function" completion with no actual function
scope.

This patch avoids the assumption that such a scope exists in this context.

Reviewers: kadircet

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344133 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MinGW] Fix passing a sanitizer lib name as dependent lib
Martin Storsjo [Wed, 10 Oct 2018 09:01:00 +0000 (09:01 +0000)]
[MinGW] Fix passing a sanitizer lib name as dependent lib

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344125 91177308-0d34-0410-b5e6-96231b3b80d8