Commit Graph

302191 Commits

Author SHA1 Message Date
Matthias Braun 854b1af5a1 Try to fix ambiguities with C++17 headers in unittest
llvm-svn: 345689
2018-10-31 01:30:41 +00:00
Kuba Mracek cb3628bcc0 Revert r345686 due to build failures
llvm-svn: 345688
2018-10-31 01:22:48 +00:00
Wolfgang Pieb f39a9bbe72 [DWARF] Revert r345546: Refactor range list extraction and dumping
This patch caused some internal tests to break which are being investigated.

llvm-svn: 345687
2018-10-31 01:12:58 +00:00
Kuba Mracek 8fddd98185 [lldb] Introduce StackFrameRecognizer [take 2]
This patch introduces a concept of "frame recognizer" and "recognized frame". This should be an extensible mechanism that retrieves information about special frames based on ABI, arguments or other special properties of that frame, even without source code. A few examples where that could be useful could be 1) objc_exception_throw, where we'd like to get the current exception, 2) terminate_with_reason and extracting the current terminate string, 3) recognizing Objective-C frames and automatically extracting the receiver+selector, or perhaps all arguments (based on selector).

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

llvm-svn: 345686
2018-10-31 00:36:20 +00:00
Reid Kleckner 3e27306565 [asan] Remove stale -fno-exceptions flag in sanitizer_common as well
llvm-svn: 345685
2018-10-31 00:35:46 +00:00
Fangrui Song 487b4fb6d7 [llvm-objcopy] Delete a redundant override whose base is empty
llvm-svn: 345684
2018-10-31 00:31:07 +00:00
Fangrui Song a23f091ba3 Use llvm::any_of instead std::any_of. NFC
llvm-svn: 345683
2018-10-31 00:31:06 +00:00
Fangrui Song f0031fa268 Use the container form llvm::sort(C)
llvm-svn: 345682
2018-10-31 00:31:06 +00:00
Fangrui Song c0bdded1a2 Don't duplicate function/class name at the beginning of the comment. NFC
llvm-svn: 345681
2018-10-31 00:31:02 +00:00
Kuba Mracek 377f9f9b3f Revert r345678 (build failure on Linux machines).
llvm-svn: 345680
2018-10-31 00:29:17 +00:00
Matthias Braun 9fd397b423 ADT/STLExtras: Introduce llvm::empty; NFC
This is modeled after C++17 std::empty().

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

llvm-svn: 345679
2018-10-31 00:23:23 +00:00
Kuba Mracek ac0ba8c524 [lldb] Introduce StackFrameRecognizer
This patch introduces a concept of "frame recognizer" and "recognized frame". This should be an extensible mechanism that retrieves information about special frames based on ABI, arguments or other special properties of that frame, even without source code. A few examples where that could be useful could be 1) objc_exception_throw, where we'd like to get the current exception, 2) terminate_with_reason and extracting the current terminate string, 3) recognizing Objective-C frames and automatically extracting the receiver+selector, or perhaps all arguments (based on selector).

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

llvm-svn: 345678
2018-10-31 00:21:03 +00:00
Reid Kleckner 1079d7ccfe [asan] Remove flags for clang-cl before it supported EH
Also remove -Wno-undefined-inline, which needed to work around PR19898,
which was fixed.

llvm-svn: 345677
2018-10-31 00:20:41 +00:00
Reid Kleckner 0897caad30 [Win64] Handle passing i128 by value
For arguments, pass it indirectly, since the ABI doc says pretty clearly
that arguments larger than 8 bytes are passed indirectly. This makes
va_list handling easier, anyway.

When returning, GCC returns in XMM0, and we match them.

Fixes PR39492.

llvm-svn: 345676
2018-10-30 23:58:41 +00:00
Saleem Abdulrasool 91242b788a DWARFVerifier: make the verifier more comprehensive for objects
Make the code do what was mentioned in the comment: only skip the CU types.
This enables the lexical blocks to be verified as well.

llvm-svn: 345675
2018-10-30 23:45:27 +00:00
Matthias Braun a83403892a MachineOperand/MIParser: Do not print debug-use flag, infer it
The debug-use flag must be set exactly for uses on DBG_VALUEs.  This is
so obvious that it can be trivially inferred while parsing. This will
reduce noise when printing while omitting an information that has little
value to the user.

The parser will keep recognizing the flag for compatibility with old
`.mir` files.

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

llvm-svn: 345671
2018-10-30 23:28:27 +00:00
Louis Dionne bdc6deedd3 Correct ABI list change wrongly advertised as being in the 7.0 release
llvm-svn: 345670
2018-10-30 23:24:02 +00:00
Richard Trieu 161121fc9d Silence unused variable warnings. NFC
llvm-svn: 345669
2018-10-30 23:01:15 +00:00
Davide Italiano 70ad9c74ae [testsuite] Skip an already failing test on MacOS.
Due to some libcxx changes to inlining, this now also crashes,
so it gets reported as "failure" by the bot. This commit doesn't
really change the status quo, just placates the bots.

llvm-svn: 345668
2018-10-30 22:49:22 +00:00
Eric Fiselier 88be0d1baf Revert "Build with -fvisibility=hidden"
I messed it up somewhere and now the tests aren't linking.
Reverting while I investigate.

llvm-svn: 345667
2018-10-30 22:23:01 +00:00
Kamil Rytarowski 9fe6b4d522 Disable BufferOverflowAfterManyFrees for NetBSD
This test hangs in the i386 mode.

llvm-svn: 345666
2018-10-30 22:08:47 +00:00
David Bolvansky f739066e8a [ARM][NFC] Make tests immune to better div optimizations
Summary: Related to D52504

Reviewers: spatel

Reviewed By: spatel

Subscribers: javed.absar, kristof.beyls, chrib, llvm-commits

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

llvm-svn: 345665
2018-10-30 22:08:13 +00:00
Eric Fiselier 6426a8d0c8 Build with -fvisibility=hidden
Summary:
This change changes the build to use -fvisibility=hidden

The exports this patch removes are symbols that should have never been exported
by the dylib in the first place, and should all be symbols which the linker
won't de-duplicate across SO boundaries, making them safe to remove.

After this change, we should be able to apply `_LIBCPP_HIDDEN` to the versioning namespace without changing the export lists.

Reviewers: ldionne, mclow.lists

Reviewed By: ldionne

Subscribers: smeenai, mgorny, libcxx-commits

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

llvm-svn: 345664
2018-10-30 22:07:52 +00:00
Kamil Rytarowski e90a7df5a1 Mark breaking asan tests on NetBSD
Failing ones:
 - coverage-reset
 - coverage
 - dlclose-test
 - interception-in-shared-lib-test
 - stack-use-after-return
 - tsd_dtor_leak

llvm-svn: 345663
2018-10-30 22:05:49 +00:00
Konstantin Zhuravlyov 2d22d24ac4 Revert r345542: AMDGPU: Enable code object v3 by default
It breaks mesa.

llvm-svn: 345662
2018-10-30 22:02:40 +00:00
Roman Lebedev a0457c02b3 [NFC][compiler-rt] Cleanup Implicit Conversion Sanitizer tests to use sized types
Summary: As requested by @filcab in https://reviews.llvm.org/D50251#1280267

Reviewers: filcab, vsk, #sanitizers, vitalybuka

Reviewed By: filcab, #sanitizers, vitalybuka

Subscribers: vitalybuka, kubamracek, dberris, llvm-commits, filcab

Tags: #sanitizers

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

llvm-svn: 345661
2018-10-30 21:59:09 +00:00
Roman Lebedev 62debd8055 [clang][ubsan] Implicit Conversion Sanitizer - integer sign change - clang part
This is the second half of Implicit Integer Conversion Sanitizer.
It completes the first half, and finally makes the sanitizer
fully functional! Only the bitfield handling is missing.

Summary:
C and C++ are interesting languages. They are statically typed, but weakly.
The implicit conversions are allowed. This is nice, allows to write code
while balancing between getting drowned in everything being convertible,
and nothing being convertible. As usual, this comes with a price:

```
void consume(unsigned int val);

void test(int val) {
  consume(val);
  // The 'val' is `signed int`, but `consume()` takes `unsigned int`.
  // If val is negative, then consume() will be operating on a large
  // unsigned value, and you may or may not have a bug.

  // But yes, sometimes this is intentional.
  // Making the conversion explicit silences the sanitizer.
  consume((unsigned int)val);
}
```

Yes, there is a `-Wsign-conversion`` diagnostic group, but first, it is kinda
noisy, since it warns on everything (unlike sanitizers, warning on an
actual issues), and second, likely there are cases where it does **not** warn.

The actual detection is pretty easy. We just need to check each of the values
whether it is negative, and equality-compare the results of those comparisons.
The unsigned value is obviously non-negative. Zero is non-negative too.
https://godbolt.org/g/w93oj2

We do not have to emit the check *always*, there are obvious situations
where we can avoid emitting it, since it would **always** get optimized-out.
But i do think the tautological IR (`icmp ult %x, 0`, which is always false)
should be emitted, and the middle-end should cleanup it.

This sanitizer is in the `-fsanitize=implicit-conversion` group,
and is a logical continuation of D48958 `-fsanitize=implicit-integer-truncation`.
As for the ordering, i'we opted to emit the check **after**
`-fsanitize=implicit-integer-truncation`. At least on these simple 16 test cases,
this results in 1 of the 12 emitted checks being optimized away,
as compared to 0 checks being optimized away if the order is reversed.

This is a clang part.
The compiler-rt part is D50251.

Finishes fixing [[ https://bugs.llvm.org/show_bug.cgi?id=21530 | PR21530 ]], [[ https://bugs.llvm.org/show_bug.cgi?id=37552 | PR37552 ]], [[ https://bugs.llvm.org/show_bug.cgi?id=35409 | PR35409 ]].
Finishes partially fixing [[ https://bugs.llvm.org/show_bug.cgi?id=9821 | PR9821 ]].
Finishes fixing https://github.com/google/sanitizers/issues/940.

Only the bitfield handling is missing.

Reviewers: vsk, rsmith, rjmccall, #sanitizers, erichkeane

Reviewed By: rsmith

Subscribers: chandlerc, filcab, cfe-commits, regehr

Tags: #sanitizers, #clang

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

llvm-svn: 345660
2018-10-30 21:58:56 +00:00
Roman Lebedev 320e9af309 [compiler-rt][ubsan] Implicit Conversion Sanitizer - integer sign change - compiler-rt part
Summary:
This is a compiler-rt part.
The clang part is D50250.

See [[ https://bugs.llvm.org/show_bug.cgi?id=21530 | PR21530 ]], https://github.com/google/sanitizers/issues/940.

Reviewers: vsk, filcab, #sanitizers

Reviewed By: filcab, #sanitizers

Subscribers: mclow.lists, srhines, kubamracek, dberris, rjmccall, rsmith, llvm-commits, regehr

Tags: #sanitizers

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

llvm-svn: 345659
2018-10-30 21:58:54 +00:00
Louis Dionne 7bf7edec79 [libcxx] Correct link to code review for P1006
llvm-svn: 345658
2018-10-30 21:50:11 +00:00
Eric Fiselier fe13c13cc2 Make libc++'s versioning namespace customizable
Summary:
This patch makes the versioning namespace libc++ uses customizable by the user using `-DLIBCXX_ABI_NAMESPACE=__foo`. 

This allows users to build custom versions of libc++ which can be linked into binaries with other libc++ versions without causing symbol conflicts or ODR issues. 

Reviewers: mclow.lists, ldionne

Reviewed By: ldionne

Subscribers: kristina, smeenai, mgorny, phosek, libcxx-commits

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

llvm-svn: 345657
2018-10-30 21:44:53 +00:00
Marco Castelluccio c8d94f3847 [GCOV] Make test path generic so it passes on all machines
llvm-svn: 345656
2018-10-30 21:43:47 +00:00
Kamil Rytarowski 5786b9fe88 Switch getline_nohang from XFAIL to UNSUPPORTED for NetBSD
This test sometimes works, usually breaks.

llvm-svn: 345655
2018-10-30 21:41:31 +00:00
Kamil Rytarowski 9e5016a384 Mark vptr-non-unique-typeinfo as a broken test for NetBSD/i386
llvm-svn: 345654
2018-10-30 21:39:45 +00:00
Marshall Clow 537aae35dd Add link to implementation for P1006R0
llvm-svn: 345653
2018-10-30 21:27:42 +00:00
Eric Fiselier dec8cbad48 Update LLVM version used on Appveyor bot, remove MSVC 2015 bot
llvm-svn: 345652
2018-10-30 21:23:31 +00:00
Kamil Rytarowski 3b59f89a56 Mark breaking sanitizer_common tests on NetBSD
Set XFAIL with appropriate configuration for:
 - NetBSD/getgroupmembership
 - Posix/dedup_token_length_test
 - Posix/readlinkat
 - get_module_and_offset_for_pc

llvm-svn: 345651
2018-10-30 21:20:17 +00:00
Cameron McInally 2ad870e785 [FPEnv] [FPEnv] Add constrained intrinsics for MAXNUM and MINNUM
Differential Revision: https://reviews.llvm.org/D53216

llvm-svn: 345650
2018-10-30 21:01:29 +00:00
Aaron Ballman f6e3d147e9 Changing the command line parameters sent to diff for this test.
On some systems, -U 1 was being interpreted as -U -1. Trying -U1 to see if that's the universally accepted approach instead.

llvm-svn: 345649
2018-10-30 20:55:18 +00:00
Fangrui Song e0799a7268 [ELF] Fallback to sh_link=0 if neither .dynsym nor .symtab exists
Summary: .rela.plt may only contain R_*_{,I}RELATIVE relocations and not need a symbol table link. bfd/gold fallbacks to sh_link=0 in this case. Without this patch, ld.lld --strip-all caused lld to dereference a null pointer.

Reviewers: ruiu, grimar, espindola

Reviewed By: ruiu

Subscribers: emaste, arichardson, llvm-commits

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

llvm-svn: 345648
2018-10-30 20:54:54 +00:00
Sanjay Patel 4c39dfc91e [InstCombine] use 'match' to reduce code; NFC
llvm-svn: 345647
2018-10-30 20:52:25 +00:00
Erik Pilkington a7641d97a7 NFC: Merge KEYOBJC and KEYARC
We used to only define ARC keywords in -fobjc-arc mode, but now that we define
them in ObjC mode, there isn't any reason to keep them seperate.

llvm-svn: 345646
2018-10-30 20:51:28 +00:00
Reid Kleckner 96b823418d [builtins] Re-enable x86-only long double tests
Summary:
In r81552, the HAS_80_BIT_LONG_DOUBLE macro was added to the unit test
only version of int_lib.h. One month later in r85260 the duplicate
int_lib.h was removed, but the tests still passed because we don't build
with -Werror.

This is the minimal change to bring it back, and I decided to put the
configuration macro next to our 128-bit integer support macro.

Reviewers: joerg, compnerd, mstorsjo

Subscribers: llvm-commits

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

llvm-svn: 345645
2018-10-30 20:51:27 +00:00
Quentin Colombet 900678227c [InstCombine] Teach the move free before null test opti how to deal with noop casts
InstCombine features an optimization that essentially replaces:
if (a)
  free(a)
into:
free(a)

Right now, this optimization is gated by the minsize attribute and therefore
we only perform it if we can prove that we are going to be able to eliminate
the branch and the destination block.

However when casts are involved the optimization would fail to apply, because
the optimization was not smart enough to realize that it is possible to also
move the casts away from the destination block and that is harmless to the
performance since they are just noops.
E.g.,
foo(int *a)
if (a)
  free((char*)a)

Wouldn't be optimized by instcombine, because
- We would refuse to hoist the `bitcast i32* %a to i8` in the source block
- We would fail to see that `bitcast i32* %a to i8` and %a are the same value.

This patch fixes both these problems:
- It teaches the pattern matching of the comparison how to look
  through casts.
- It checks that whether the additional instruction in the destination block
  can be hoisted and are harmless performance-wise.
- It hoists all the code of the destination block in the source block.

Differential Revision: D53356

llvm-svn: 345644
2018-10-30 20:51:04 +00:00
Davide Italiano 93a64efcd3 Revert "[ASTImporter] Reorder fields after structure import is finished"
This reverts commit r345545 because it breaks some lldb tests.

llvm-svn: 345643
2018-10-30 20:46:29 +00:00
Sanjay Patel caf5f5c490 [x86] try to make test immune to better div optimization; NFCI
llvm-svn: 345642
2018-10-30 20:46:23 +00:00
Mandeep Singh Grang 71e0cc2a0b [COFF, ARM64] Make sure to forward arguments from vararg to musttail vararg
Summary:
    Thunk functions in Windows are varag functions that call a musttail function
    to pass the arguments after the fixup is done.  We need to make sure that we
    forward the arguments from the caller vararg to the callee vararg function.
    This is the same mechanism that is used for Windows on X86.

Reviewers: ssijaric, eli.friedman, TomTan, mgrang, mstorsjo, rnk, compnerd, efriedma

Reviewed By: efriedma

Subscribers: efriedma, kristof.beyls, chrib, javed.absar, llvm-commits

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

llvm-svn: 345641
2018-10-30 20:46:10 +00:00
Sanjay Patel 00935bc1ba [x86] try to make test immune to better div optimization; NFCI
llvm-svn: 345640
2018-10-30 20:44:54 +00:00
Sanjay Patel 059ebc90ee [x86] try to make test immune to better div optimization; NFCI
llvm-svn: 345639
2018-10-30 20:42:03 +00:00
Craig Topper 4104c00658 [ScalarizeMaskedMemIntrin] Limit the scope of some variables that are only used inside loops.
llvm-svn: 345638
2018-10-30 20:33:58 +00:00
Erik Pilkington fa98390b3c NFC: Remove the ObjC1/ObjC2 distinction from clang (and related projects)
We haven't supported compiling ObjC1 for a long time (and never will again), so
there isn't any reason to keep these separate. This patch replaces
LangOpts::ObjC1 and LangOpts::ObjC2 with LangOpts::ObjC.

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

llvm-svn: 345637
2018-10-30 20:31:30 +00:00