Commit Graph

281835 Commits

Author SHA1 Message Date
Alex Bradbury 7c11527b03 [RISCV] Update two RISCV codegen tests after rL323991
From the discussion in D41835 it looks possible the change will be backed out, 
but for now let's fix the RISCV tests.

llvm-svn: 324172
2018-02-03 13:02:30 +00:00
Simon Pilgrim 3d5ee7aa41 Fix MSVC signed/unsigned comparison warning. NFCI.
llvm-svn: 324171
2018-02-03 12:38:56 +00:00
Alex Bradbury 3e1478f866 [RISCV] Create a LinuxTargetInfo when targeting Linux
Previously, RISCV32TargetInfo or RISCV64TargetInfo were created 
unconditionally. Use LinuxTargetInfo<RISCV??TargetInfo> to ensure that the 
proper OS-specific defines are present.

This patch only adds logic to instantiate LinuxTargetInfo and leaves a TODO, 
as I'm reluctant to add logic for other targets (e.g. FreeBSD, RTEMS) until 
I've produced and tested at least one binary for that OS+target combo.

Thanks to @mgrang to reporting the issue.

llvm-svn: 324170
2018-02-03 11:56:11 +00:00
Michael Kruse a43ba2d84f [ScopBuilder] Make -polly-stmt-granularity=scalar-indep the default.
Splitting basic blocks into multiple statements if there are now
additional scalar dependencies gives more freedom to the scheduler, but
more statements also means higher compile-time complexity. Switch to
finer statement granularity, the additional compile time should be
limited by the number of operations quota.

The regression tests are written for the -polly-stmt-granularity=bb
setting, therefore we add that flag to those tests that break with the
new default. Some of the tests only fail because the statements are
named differently due to a basic block resulting in multiple statements,
but which are removed during simplification of statements without
side-effects. Previous commits tried to reduce this effect, but it is
not completely avoidable.

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

llvm-svn: 324169
2018-02-03 06:59:47 +00:00
Michael Kruse 217704f7a8 [ScopInfo] Allow epilogues to be the main statement of a BB.
Do not add a "_last" suffix to the statement name if there is no (other)
main statement for a basic block. In other words, it becomes the main
statement itself. This further reduces the statement naming difference
between -polly-stmt-granularity=bb and
-polly-stmt-granularity=scalar-indep.

llvm-svn: 324168
2018-02-03 05:43:00 +00:00
Artem Dergachev 393dfc468d Revert r324166 "[analyzer] Add a checker for mmap()...".
Due to Buildbot failures - most likely that's because target triples were not
specified in the tests, even though the checker behaves differently with
different target triples.

llvm-svn: 324167
2018-02-03 03:57:32 +00:00
Artem Dergachev d8b6fbc0d0 [analyzer] Add a checker for mmap()s which are both writable and executable.
This is a security check which is disabled by default but will be enabled
whenever the user consciously enables the security package. If mmap()ed memory
is both writable and executable, it makes it easier for the attacker to execute
arbitrary code when contents of this memory are compromised. Some applications
require such mmap()s though, such as different sorts of JIT.

Patch by David Carlier!

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

llvm-svn: 324166
2018-02-03 02:33:42 +00:00
Eric Fiselier f892166a1d Work around GCC constexpr initialization bug
llvm-svn: 324165
2018-02-03 01:48:21 +00:00
Eric Fiselier 9b5ff7a6bc Work around Clang bug introduced in r324062
When Clang encounters an already invalid class declaration, it can
emit incorrect diagnostics about the exception specification on
some of its members. This patch temporarily works around that
incorrect diagnostic.

The clang bug was introduced in r324062.

llvm-svn: 324164
2018-02-03 01:45:35 +00:00
Evgeniy Stepanov 5f345049f3 [hwasan] Add a paragraph on stack instrumentation.
Reviewers: kcc

Subscribers: cfe-commits

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

llvm-svn: 324163
2018-02-03 01:06:21 +00:00
George Karpenkov 4316afbb44 [analyzer] Do not infer nullability inside function-like macros, even when macro is explicitly returning NULL
We already suppress such reports for inlined functions, we should then
get the same behavior for macros.
The underlying reason is that the same macro, can be called from many
different contexts, and nullability can only be expected in _some_ of
them.
Assuming that the macro can return null in _all_ of them sometimes leads
to a large number of false positives.

E.g. consider the test case for the dynamic cast implementation in
macro: in such cases, the bug report is unwanted.

Tracked in rdar://36304776

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

llvm-svn: 324161
2018-02-03 00:55:21 +00:00
Richard Smith 6eb9b9e593 Fix crash when trying to pack-expand a GNU statement expression.
We could in principle support such pack expansion, using techniques similar to
what we do for pack expansion of lambdas, but it's not clear it's worthwhile.
For now at least, cleanly reject these cases rather than crashing.

llvm-svn: 324160
2018-02-03 00:44:57 +00:00
Jason Molenda 35eb6c856a Turn off the deprecated ALWAYS_SEARCH_USER_PATHS feature
in debugserver.  This is already set this way in the lldb
project files but not in debugserver.  Updating for
consistency.

llvm-svn: 324158
2018-02-03 00:37:46 +00:00
Sam Clegg f0d433d0c6 [WebAssembly] Refactor linker-generated symbols. NFC.
Group all synthetic symbols in the in single struct to match
the ELF linker.

This change is part of a larger change to add more linker
symbols such as `_end` and `_edata`.

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

llvm-svn: 324157
2018-02-02 22:59:56 +00:00
Jason Molenda 37713073d6 Fix a copy of a fixed length, possibly non-nul terminated, string
into a std::string so we don't run off the end of the array when
there is no nul byte in ProcessElfCore::parseLinuxNotes.  
Found with ASAN testing.

<rdar://problem/37134319> 

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

llvm-svn: 324156
2018-02-02 22:48:45 +00:00
Rui Ueyama 7a64a3d59c Simplify.
llvm-svn: 324155
2018-02-02 22:48:09 +00:00
Rui Ueyama edd4ec54d6 Update Eq so that it uses NAME just like B does. NFC.
llvm-svn: 324154
2018-02-02 22:45:47 +00:00
Eric Fiselier bfbafa541a Fix has_unique_object_representation after Clang commit r324134.
Clang previously reported an empty union as having a unique object
representation. This was incorrect and was fixed in a recent Clang commit.

This patch fixes the libc++ tests.

llvm-svn: 324153
2018-02-02 22:39:59 +00:00
Richard Smith 60707939de Fix incorrect usage of std::is_assignable.
We want to check that we can assign to an lvalue here, not a prvalue.

llvm-svn: 324152
2018-02-02 22:29:54 +00:00
Richard Smith e303e3523a Add missing direct-init / parameter-declaration-clause disambiguation when
parsing a trailing-return-type of a (function pointer) variable declaration.

llvm-svn: 324151
2018-02-02 22:24:54 +00:00
Rui Ueyama 6a8e79b8e5 Add -{no,}-check-sections flags to enable/disable section overlchecking
GNU linkers have this option.

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

llvm-svn: 324150
2018-02-02 22:24:06 +00:00
Daniel Neilson 38af2eed51 [InstCombine] Use getDestAlignment in SimplifyMemSet (NFC)
Summary:
Small NFC change to change the name of the function used getting and setting
the alignment of a memset.

llvm-svn: 324148
2018-02-02 22:03:03 +00:00
Craig Topper fae8788cfa [X86] Prefer to create a ISD::SETCC over X86ISD::PCMPEQ in combineVectorSizedSetCCEquality.
This is running pre-legalize, we should try to use target independent nodes. This will give the best opportunity for target independent optimizations.

llvm-svn: 324147
2018-02-02 21:59:46 +00:00
Rui Ueyama f46d3d1be9 Strip .note.gnu.build-id sections if --build-id is given.
Differential Revision: https://reviews.llvm.org/D42823

llvm-svn: 324146
2018-02-02 21:56:24 +00:00
Rui Ueyama aad2e328b9 Add --no-gnu-unique and --no-undefined-version for completeness.
Differential Revision: https://reviews.llvm.org/D42865

llvm-svn: 324145
2018-02-02 21:44:06 +00:00
Sanjay Patel a767ee5af0 [InstCombine] make sure tests are providing coverage for the stated pattern; NFC
Without extra instructions and uses, swapMayExposeCSEOpportunities() would change
the icmp (as seen in the check lines), so we were not actually testing patterns 
that should be handled by D41480.

llvm-svn: 324143
2018-02-02 21:40:54 +00:00
James Dennett 31a5734276 More documentation cleanup for Decl.h.
llvm-svn: 324142
2018-02-02 21:38:22 +00:00
Rui Ueyama 14f07a0ea5 Consolidate --foo and --no-foo options. NFC.
Differential Revision: https://reviews.llvm.org/D42859

llvm-svn: 324141
2018-02-02 21:25:51 +00:00
Kuba Mracek f1ddefb55f Use NULL instead of nullptr in invalid-pointer-pairs-compare-null.cc; nullptr is not available on older Darwin systems.
llvm-svn: 324136
2018-02-02 20:42:29 +00:00
Craig Topper 10aa254ecd [X86] Pass SDLoc by const reference in a few more places in X86ISelLowering.cpp. NFC
llvm-svn: 324135
2018-02-02 20:32:00 +00:00
Eric Fiselier 12a9f344c6 Make __has_unique_object_representations reject empty union types.
Summary:
Clang incorrectly reports empty unions as having a unique object representation. However, this is not correct since `sizeof(EmptyUnion) == 1` AKA it has 8 bits of padding. Therefore it should be treated the same as an empty struct and report `false`.

@erichkeane also suggested this fix should be merged into the 6.0 release branch, so the initial release of `__has_unique_object_representations` is as bug-free as possible. 

Reviewers: erichkeane, rsmith, aaron.ballman, majnemer

Reviewed By: erichkeane

Subscribers: cfe-commits, erichkeane

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

llvm-svn: 324134
2018-02-02 20:30:39 +00:00
James Dennett b8973efb3c Documentation cleanup, no functional change.
llvm-svn: 324133
2018-02-02 20:22:29 +00:00
Matt Morehouse d08e0a78c2 [clang-proto-to-cxx] Accept protobufs with missing fields.
libprotobuf-mutator accepts protobufs with missing fields, which means
clang-proto-fuzzer does as well.  clang-proto-to-cxx should match this
behavior.

llvm-svn: 324132
2018-02-02 20:22:20 +00:00
Ben Hamilton 4dc658ca52 [clang-format] New format param ObjCBinPackProtocolList
Summary:
This is an alternative approach to D42014 after some
investigation by stephanemoore@ and myself.

Previously, the format parameter `BinPackParameters` controlled both
C function parameter list bin-packing and Objective-C protocol conformance
list bin-packing.

We found in the Google style, some teams were changing
`BinPackParameters` from its default (`true`) to `false` so they could
lay out Objective-C protocol conformance list items one-per-line
instead of bin-packing them into as few lines as possible.

To allow teams to use one-per-line Objective-C protocol lists without
changing bin-packing for other areas like C function parameter lists,
this diff introduces a new LibFormat parameter
`ObjCBinPackProtocolList` to control the behavior just for ObjC
protocol conformance lists.

The new parameter is an enum which defaults to `Auto` to keep the
previous behavior (delegating to `BinPackParameters`).

Depends On D42649

Test Plan: New tests added. make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests

Reviewers: jolesiak, stephanemoore, djasper

Reviewed By: stephanemoore

Subscribers: Wizard, hokein, cfe-commits, klimek

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

llvm-svn: 324131
2018-02-02 20:15:14 +00:00
Craig Topper e7e147f52c [X86] Add avx512 command line to ptest.ll to demonstrate that 512-bit vectors are not handled by LowerVectorAllZeroTest.
llvm-svn: 324130
2018-02-02 20:12:45 +00:00
Craig Topper bd2f6e9570 Partially revert r324124 [X86] Add tests for missed opportunities to use ptest for all ones comparison.
Turns out I misunderstood the flag behavior of PTEST because I read the documentation for KORTEST which is different than PTEST/KTEST and made a bad assumption.

Keep the test rename though cause that's useful.

llvm-svn: 324129
2018-02-02 20:12:44 +00:00
Eric Fiselier 88df555d05 Emit label names according to -discard-value-names.
Summary:
Previously, Clang only emitted label names in assert builds.
However there is a CC1 option -discard-value-names that should have been used to control emission instead.
    
This patch removes the NDEBUG preprocessor block and instead allows LLVM to handle removing the names in accordance with the option.


Reviewers: erichkeane, aaron.ballman, majnemer

Reviewed By: aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 324127
2018-02-02 19:58:34 +00:00
Kuba Mracek 66ce45150f [asan] Make concurrent_overflow.cc less flaky
The "sleep(5)" sometimes times out on our bots, causing the test to fail. Let's use pthread_join.

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

llvm-svn: 324126
2018-02-02 19:49:24 +00:00
Aditya Nandakumar 58eb183128 [GISel][NFC]: Move RegisterBankInfo::getSizeInBits into TargetRegisterInfo.
llvm-svn: 324125
2018-02-02 19:42:07 +00:00
Craig Topper 9c936f88b1 [X86] Add tests for missed opportunities to use ptest for all ones comparison.
Also rename the test from pr12312.ll to ptest.ll so its more recognizable.

llvm-svn: 324124
2018-02-02 19:34:10 +00:00
Alex Denisov a07169e3cb Fix typo
llvm-svn: 324123
2018-02-02 19:20:37 +00:00
Sanjay Patel 1ea8697cdf [InstCombine] simplify logic for swapMayExposeCSEOpportunities; NFCI
llvm-svn: 324122
2018-02-02 19:08:12 +00:00
Kamil Rytarowski 78c9ac4dc5 Correct FileCheck usage in two newly added tests
llvm-svn: 324121
2018-02-02 18:48:15 +00:00
Kamil Rytarowski e6bba9bc6f Add new NetBSD interceptors: devname(3), devname_r(3)
Summary:
devname, devname_r - get device name

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, vitalybuka

Reviewed By: vitalybuka

Subscribers: kubamracek, llvm-commits, #sanitizers

Tags: #sanitizers

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

llvm-svn: 324120
2018-02-02 18:45:33 +00:00
Jim Ingham 40207d5064 Add the ability to restrict the breakpoint to a module
for run_to_{source,name}_breakpoint.

llvm-svn: 324119
2018-02-02 18:39:25 +00:00
Sanjay Patel 4ccae1cb2b [InstCombine] fix typos, formatting; NFC
llvm-svn: 324118
2018-02-02 18:39:05 +00:00
Adrian Prantl 34769d80dd Use an alternative approach to prevent Spotlight from indexing the build directory.
llvm-svn: 324115
2018-02-02 18:32:29 +00:00
George Karpenkov 78809e53cc [analyzer] [tests] Fix crash in SATestBuild.py
llvm-svn: 324114
2018-02-02 18:27:14 +00:00
Eric Liu 3a2cf8668f [Tooling] Returns non-zero status code when files are skipped.
Reviewers: hokein, bkramer

Reviewed By: bkramer

Subscribers: bkramer, klimek, cfe-commits

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

llvm-svn: 324113
2018-02-02 18:19:22 +00:00
Michael Kruse 1a745a4ef6 Run clang-format after r324003. NFC.
llvm-svn: 324112
2018-02-02 18:11:58 +00:00