Commit Graph

75634 Commits

Author SHA1 Message Date
Ulrich Weigand 2927071750 [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.

llvm-svn: 344611
2018-10-16 14:57:20 +00:00
Simon Atanasyan eaab2b77e1 [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

llvm-svn: 344608
2018-10-16 14:29:27 +00:00
Simon Atanasyan e60eae4256 [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`.

llvm-svn: 344603
2018-10-16 10:19:06 +00:00
Simon Pilgrim c858748c9b Fix buildbots - update clang-interpreter to use Legacy ORC classes introduced in rL344572.
llvm-svn: 344598
2018-10-16 09:21:58 +00:00
Peter Smith e75b6d78e0 [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

llvm-svn: 344597
2018-10-16 09:21:17 +00:00
Yvan Roux 84b52a2ff8 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

llvm-svn: 344593
2018-10-16 08:47:36 +00:00
Simon Atanasyan 28d467a809 [mips] Group similar commands in the test case. NFC
llvm-svn: 344583
2018-10-16 05:18:36 +00:00
Alexey Bataev 93a38d60be [OPENMP][NVPTX]Increment iterator only when it is used, NFC.
llvm-svn: 344574
2018-10-16 00:09:06 +00:00
Simon Atanasyan db81c7b9c9 [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

llvm-svn: 344570
2018-10-15 22:43:23 +00:00
Petr Hosek d3265358b4 [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

llvm-svn: 344556
2018-10-15 21:30:32 +00:00
Artem Dergachev 4c9eb0fac4 [analyzer] Add doxygen comments for the new CXXAllocatorCall APIs.
Forgot to squeeze this into r344539.

llvm-svn: 344540
2018-10-15 18:01:34 +00:00
Artem Dergachev fcf107d411 [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

llvm-svn: 344539
2018-10-15 17:53:18 +00:00
Artem Dergachev 65b4d7ddd9 [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

llvm-svn: 344538
2018-10-15 17:47:56 +00:00
Artem Dergachev 38b21d91ff [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

llvm-svn: 344537
2018-10-15 17:43:23 +00:00
Nick Desaulniers 9d0df31bed 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

llvm-svn: 344536
2018-10-15 17:39:00 +00:00
Leonard Chan 99bda375a1 [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

llvm-svn: 344530
2018-10-15 16:07:02 +00:00
Sean Fertile d900dd0c23 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.

llvm-svn: 344526
2018-10-15 15:43:00 +00:00
Eric Liu b87c6eba2e [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

llvm-svn: 344509
2018-10-15 12:37:23 +00:00
Chandler Carruth e303c87e19 [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.

llvm-svn: 344504
2018-10-15 10:42:50 +00:00
Sid Manning 61471cc090 [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

llvm-svn: 344482
2018-10-14 17:51:36 +00:00
Hans Wennborg 72e5d93190 Try harder to fix test/Driver/cl-showfilenames.c
Follow-up to r344462.

llvm-svn: 344469
2018-10-13 22:22:03 +00:00
Benjamin Kramer c55e997556 Move some helpers from the global namespace into anonymous ones.
llvm-svn: 344468
2018-10-13 22:18:22 +00:00
Enrico Steffinlongo 11b6cedb8e [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

llvm-svn: 344464
2018-10-13 19:45:48 +00:00
Enrico Steffinlongo a72a15a5c7 [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

llvm-svn: 344463
2018-10-13 19:42:10 +00:00
Hans Wennborg 2fe010473d 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.

llvm-svn: 344462
2018-10-13 19:13:14 +00:00
Adam Balogh 45ca9b705c [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

llvm-svn: 344443
2018-10-13 10:24:48 +00:00
Alexey Bataev 4ac58d1a4b [OPENMP][NVPTX]Reduce memory usage in target region.
Additional reduction of the global memory usage in the target regions
without parallel regions.

llvm-svn: 344413
2018-10-12 20:19:59 +00:00
Martin Storsjo 4b75df2cca [MinGW] Allow using LTO when lld is used as linker
Differential Revision: https://reviews.llvm.org/D53195

llvm-svn: 344412
2018-10-12 20:15:51 +00:00
Michal Gorny 22297d935a [python] [tests] Re-add once again, this time without Windows
llvm-svn: 344411
2018-10-12 20:03:54 +00:00
Simon Pilgrim 99e4d74e4a 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.
........

llvm-svn: 344408
2018-10-12 19:46:40 +00:00
Ben Hamilton 97034a36cc [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

llvm-svn: 344406
2018-10-12 19:43:01 +00:00
Simon Pilgrim c39a217412 Fix a clang::driver::ArgStringList usage I missed in rL344398. NFCI.
llvm-svn: 344400
2018-10-12 19:14:43 +00:00
Simon Pilgrim 0e50d4c47b Consistently make llvm::opt::ArgStringList usage explicit to try and appease MSVC 2015 buildbots. NFCI.
llvm-svn: 344398
2018-10-12 18:55:36 +00:00
Reid Kleckner 3185977105 Revert r344375 "[Driver] check for exit code from SIGPIPE"
This doesn't build on Windows.

llvm-svn: 344389
2018-10-12 18:08:11 +00:00
Jonas Toth 20ab6954a4 [Doc] fix second error in UsersManual
llvm-svn: 344388
2018-10-12 17:57:18 +00:00
Jonas Toth 30f6c63107 [Doc] fix BB, add code-block type
llvm-svn: 344382
2018-10-12 17:44:01 +00:00
Nick Desaulniers c7a3e4a478 [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

llvm-svn: 344375
2018-10-12 17:22:46 +00:00
Erik Pilkington 92d8a29ca0 [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

llvm-svn: 344373
2018-10-12 17:22:10 +00:00
Dan Albert d0fbef9c75 [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

llvm-svn: 344367
2018-10-12 17:06:31 +00:00
Michal Gorny e67b68f341 [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.

llvm-svn: 344365
2018-10-12 16:55:44 +00:00
Michal Gorny 4fc27bd937 [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

llvm-svn: 344364
2018-10-12 16:55:39 +00:00
Zachary Turner 9f169afab2 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

llvm-svn: 344359
2018-10-12 16:31:20 +00:00
Zachary Turner 9c544199cf 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.

llvm-svn: 344358
2018-10-12 16:31:08 +00:00
Zachary Turner ec234052a6 Make YAML quote forward slashes.
llvm-svn: 344357
2018-10-12 16:24:09 +00:00
Alexey Bataev 9bfe91da3d [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.

llvm-svn: 344356
2018-10-12 16:04:20 +00:00
Simon Pilgrim 0a3bb81974 Fix MSVC 2015 ambiguous symbol warning introduced by rL344337. NFCI.
llvm-svn: 344352
2018-10-12 15:16:25 +00:00
Sam McCall 5da4d75877 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

llvm-svn: 344337
2018-10-12 12:21:29 +00:00
Eric Liu f5617dce1f [Tooling] Expose ExecutorName option.
llvm-svn: 344335
2018-10-12 11:47:36 +00:00
Simon Pilgrim e02d09d3db Fix Wdocumentation warning. NFCI.
llvm-svn: 344333
2018-10-12 10:34:03 +00:00
George Karpenkov fd6ccd83cd [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

llvm-svn: 344322
2018-10-12 00:52:13 +00:00