Commit Graph

258485 Commits

Author SHA1 Message Date
Rafael Espindola be927f586d Use count instead of grep -c.
Using count is more common in llvm and avoids a subshell.

llvm-svn: 299076
2017-03-30 13:22:30 +00:00
Andrew Ng 84b07dbd75 Test commit.
Correct assertion messages in MachineOperand for some of the setters.

llvm-svn: 299075
2017-03-30 13:17:25 +00:00
Simon Pilgrim 9a54098385 Spelling mistakes in comments. NFCI.
Based on corrections mentioned in patch for clang for PR27635

llvm-svn: 299074
2017-03-30 13:10:33 +00:00
Haojian Wu ce27e59b3e Add `replace` interface with range in AtomicChange.
Reviewers: ioeric

Reviewed By: ioeric

Subscribers: alexshap, klimek, cfe-commits

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

llvm-svn: 299073
2017-03-30 13:07:38 +00:00
Simon Pilgrim 68168d17b9 Spelling mistakes in comments. NFCI.
Based on corrections mentioned in patch for clang for PR27635

llvm-svn: 299072
2017-03-30 12:59:53 +00:00
Jonathan Coe 53667b8dff [clang-tidy] fix docs in hicpp checks
Fix for sphinx-doc warnings in r299068.

llvm-svn: 299071
2017-03-30 12:59:41 +00:00
Jonathan Coe 7a6bff0820 [clang-tidy] fix for linker errors in hicpp checks
Speculative fix for linker errors in r299068.

llvm-svn: 299070
2017-03-30 12:31:02 +00:00
Simon Pilgrim ef4509b36e Spelling mistakes in comments. NFCI.
llvm-svn: 299069
2017-03-30 12:30:15 +00:00
Jonathan Coe 88232264ac [clang-tidy] add aliases for hicpp module
Summary: Add some hicpp checks that can be implmented as alises for existing clang-tidy checks:
hicpp-explicit-conversions
hicpp-function-size
hicpp-named-parameter
hicpp-invalid-access-moved
hicpp-member-init
hicpp-new-delete-operators
hicpp-noexcept-move
hicpp-special-member-functions
hicpp-undelegated-constructor
hicpp-use-equals-default
hicpp-use-equals-delete
hicpp-use-override

Reviewers: dberlin, jbcoe, aaron.ballman, alexfh

Reviewed By: aaron.ballman

Subscribers: JDevlieghere

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

Patch By: Jonas Toth

llvm-svn: 299068
2017-03-30 11:57:54 +00:00
Kristof Beyls 7a76b315d6 Revert "Make naming in Host.h in line with coding standards."
This reverts r299062, which caused build failures on Windows.
It also reverts the attempts to fix the windows builds in r299064 and r299065.
The introduction of namespace llvm::sys::detail makes MSVC, and seemingly also
mingw, complain about ambiguity with the existing namespace llvm::detail.
E.g.:
C:\b\slave\sanitizer-windows\llvm\include\llvm/Support/MathExtras.h(184): error C2872: 'detail': ambiguous symbol
C:\b\slave\sanitizer-windows\llvm\include\llvm/Support/PointerLikeTypeTraits.h(31): note: could be 'llvm::detail'
C:\b\slave\sanitizer-windows\llvm\include\llvm/Support/Host.h(80): note: or       'llvm::sys::detail'

In r299064 and r299065 I tried to fix these ambiguities, based on the errors
reported in the log files. It seems however that the build stops early when
this kind of error is encountered, and many build-then-fix-iterations on
Windows may be needed to fix this. Therefore reverting r299062 for now to
get the build working again on Windows.

llvm-svn: 299066
2017-03-30 11:06:25 +00:00
Kristof Beyls 1ba115a113 Another attempt fix the Windows builds
By changing more detail::... to llvm::detail::...

llvm-svn: 299065
2017-03-30 10:47:41 +00:00
Kristof Beyls 2157e9a22a Attempt to fix the Windows builds by using llvm::detail::... instead of detail::...
llvm-svn: 299064
2017-03-30 10:14:40 +00:00
Daniel Sanders c270c500b7 [globalisel][tablegen] Change Expected<bool> to Error and rename functions.
Functions that still return Expected<X> are now called createAndImport*()

Changing the return type was requested in the review comments for r299001

llvm-svn: 299063
2017-03-30 09:36:33 +00:00
Kristof Beyls ca878c943b Make naming in Host.h in line with coding standards.
Based on post-commit review comments by Chandler Carruth on
https://reviews.llvm.org/D31236. Thanks!

llvm-svn: 299062
2017-03-30 09:31:59 +00:00
Maxim Ostapenko f29aec76dd [sanitizer] Move fread and fwrite interceptors to sanitizer_common
{M, T, E}San have fread and fwrite interceptors, let's move them to sanitizer_common to enable ASan checks as well.

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

llvm-svn: 299061
2017-03-30 07:25:33 +00:00
Kristof Beyls 9e46396ecc Refactor getHostCPUName to allow testing on non-native hardware.
This refactors getHostCPUName so that for the architectures that get the
host cpu info on linux from /proc/cpuinfo, the /proc/cpuinfo parsing
logic is present in the build, even if it wasn't built on a linux system
for that architecture.

Since the code is present in the build, we can then test that code also
on other systems, i.e. we don't need to have buildbots setup for all
architectures on linux to be able to test this. Instead, developers will
test this as part of the regression test run.

As an example, a few unit tests are added to test getHostCPUName for ARM
running linux. A unit test is preferred over a lit-based test, since the
expectation is that in the future, the functionality here will grow over
what can be tested with "llc -mcpu=native".

This is a preparation step to enable implementing the range of
improvements discussed on PR30516, such as adding AArch64 support,
support for big.LITTLE systems, reducing code duplication.

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

llvm-svn: 299060
2017-03-30 07:24:49 +00:00
Craig Topper eafcbe2d10 [APInt] Remove references to integerPartWidth outside of APFloat implentation.
Turns out integerPartWidth only explicitly defines the width of the tc functions in the APInt class. Functions that aren't used by APInt implementation itself. Many places in the code base already assume APInt is made up of 64-bit pieces. Explicitly assuming 64-bit here doesn't make that situation much worse. A full audit would need to be done if it ever changes.

llvm-svn: 299059
2017-03-30 05:49:03 +00:00
Craig Topper c396c538f1 [APInt] Remove references to integerPartWidth and integerPart outside of APFloat implentation.
Turns out integerPartWidth only explicitly defines the width of the tc functions in the APInt class. Functions that aren't used by APInt implementation itself. Many places in the code base already assume APInt is made up of 64-bit pieces. Explicitly assuming 64-bit here doesn't make that situation much worse. A full audit would need to be done if it ever changes.

llvm-svn: 299058
2017-03-30 05:48:58 +00:00
Mehdi Amini e8cc73ebe7 libc++ testing: fix invalid python syntax
llvm-svn: 299057
2017-03-30 05:21:33 +00:00
Mehdi Amini 566279fad7 libc++ testing: fix assertion around `use_system_cxx_lib`
Actually fix (hopefully) the assertions about `use_system_cxx_lib`,
the previous attempt failed because I misread the error.

llvm-svn: 299056
2017-03-30 05:07:18 +00:00
Mehdi Amini 322757cae9 libc++ config testing: `use_system_cxx_lib` can be a bool
Fix the libc++ Green Dragon bot.

llvm-svn: 299055
2017-03-30 04:51:19 +00:00
Mehdi Amini 87e8e25548 Reexport operator new / delete from libc++abi
Both libc++ and libc++abi export a weak definition of operator
new/delete. On Darwin, this can often cause dirty __DATA in the
shared cache when having to switch from one to the other. Instead,
libc++ should reexport libc++abi's implementation of these symbols.

Patch by: Ted Kremenek <kremenek@apple.com>

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

llvm-svn: 299054
2017-03-30 04:47:19 +00:00
Mehdi Amini f029dcdb98 libc++ testing: allow to provide a path for `use_system_cxx_lib`
As we're trying to setup testing / bots for all shipping version of libc++
on macOS/iOS, we'll need to be able to pass a path to where to find the
dylib for each previous version of the OS.

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

llvm-svn: 299053
2017-03-30 04:45:33 +00:00
Mehdi Amini 994e17b815 Do not pass an explicit reexported symbol list when building libc++ dylib if also defining new/delete
llvm-svn: 299052
2017-03-30 04:40:56 +00:00
Kostya Serebryany 01ddc1cfd5 [libFuzzer] remove a stale flag from tests, run value-profile-strncmp.test longer (hopefully, will fix the OSX bot)
llvm-svn: 299051
2017-03-30 04:22:20 +00:00
Dean Michael Berris d7b2aafcfc [XRay][compiler-rt] Spell REQUIRES properly for x86_64-linux
Until llvm-xray starts running/supporting binaries that are not ELF64 we
only run the FDR tests on x86_64-linux. Previous changes caused the
tests to not actually run on x86_64.

Follow-up on D31454.

llvm-svn: 299050
2017-03-30 03:50:56 +00:00
Dean Michael Berris c8381a8ad4 [XRay][compiler-rt] Only run tests using llvm-xray in x86_64 for now
Followup on D31454.

llvm-svn: 299049
2017-03-30 03:18:48 +00:00
Dean Michael Berris fecffaf87a [XRay][compiler-rt] XFAIL the FDR mode tests on aarch64-42vma
Followup on D31454.

llvm-svn: 299048
2017-03-30 02:48:50 +00:00
Zvi Rackover 7569436f81 [DAGCombine] A shuffle of a splat is always the splat itself
Summary:
Add a simplification:
shuffle (splat-shuffle), undef, M --> splat-shuffle

Fixes pr32449

Patch by Sanjay Patel

Reviewers: eli.friedman, RKSimon, spatel

Reviewed By: spatel

Subscribers: llvm-commits

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

llvm-svn: 299047
2017-03-30 01:42:57 +00:00
Kostya Serebryany d7d1d517ee [libFuzzer] best effort support for -fsanitize-coverage=trace-pc instrumentation. It is less efficient and precise than -fsanitize-coverage=trace-pc-guard, but still works
llvm-svn: 299046
2017-03-30 01:27:20 +00:00
Reid Kleckner af3a4e97d8 Use 'unsigned' for enum bitfields
Fixes this clang warning on Windows:

warning: implicit truncation from 'clang::LangOptions::FPContractModeKind' to bit-field changes value from 2 to -2 [-Wbitfield-constant-conversion]
    fp_contract = LangOptions::FPC_Fast;
                ^ ~~~~~~~~~~~~~~~~~~~~~
llvm-svn: 299045
2017-03-30 01:12:08 +00:00
Dean Michael Berris 00ad3d57ad [XRay][clang] Use llvm::to_string instead of std::string
This should unbreak some bots.

Follow-up on D30388.

llvm-svn: 299044
2017-03-30 01:05:09 +00:00
Kuba Mracek 8ed2928d2c [asan] Support line numbers in StackVarDescr
When -fsanitize-address-use-after-scope is used, the instrumentation produces line numbers in stack frame descriptions. This patch make sure the ASan runtime supports this format (ParseFrameDescription needs to be able to parse "varname:line") and prepares lit tests to allow line numbers in ASan report output.

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

llvm-svn: 299043
2017-03-30 00:41:09 +00:00
Dean Michael Berris 51c1365501 [XRay][compiler-rt] Use llvm-xray in FDR mode tests
Summary:
This change allows us to do an end-to-end test of the FDR mode
implementation that uses the llvm-xray tooling to verify that what we
are both writing and reading the data in a consistent manner.

Reviewers: kpw, pelikan

Subscribers: llvm-commits

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

llvm-svn: 299042
2017-03-30 00:35:58 +00:00
Dean Michael Berris 835832d37a [XRay] Add -fxray-{always,never}-instrument= flags to clang
Summary:
The -fxray-always-instrument= and -fxray-never-instrument= flags take
filenames that are used to imbue the XRay instrumentation attributes
using a whitelist mechanism (similar to the sanitizer special cases
list). We use the same syntax and semantics as the sanitizer blacklists
files in the implementation.

As implemented, we respect the attributes that are already defined in
the source file (i.e. those that have the
[[clang::xray_{always,never}_instrument]] attributes) before applying
the always/never instrument lists.

Reviewers: rsmith, chandlerc

Subscribers: jfb, mgorny, cfe-commits

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

llvm-svn: 299041
2017-03-30 00:29:36 +00:00
Jason Molenda 2ccbac3fee Mask out EXC_SYSCALL exceptions as well.
<rdar://problem/31335814> 

llvm-svn: 299040
2017-03-30 00:23:46 +00:00
Eric Christopher 9ea300f08d If the DIUnit has flags passed on it then have DW_AT_producer be a combination of DICompileUnit::Producer and Flags.
The darwin behavior is unchanged and will continue to use DW_AT_APPLE_flags.

Patch by Zhizhou Yang

llvm-svn: 299038
2017-03-29 23:34:27 +00:00
Eric Christopher ca32517c3a Add the -grecord-gcc-switches option and pass the flags down on the compile unit.
Patch by Zhizhou Yang

llvm-svn: 299037
2017-03-29 23:34:20 +00:00
Kostya Serebryany 2203ee08dd [sanitizers] Fix get_groups interceptor in sanitizer (https://reviews.llvm.org/D31332, patch by Martin Liška)
llvm-svn: 299036
2017-03-29 22:59:28 +00:00
Reid Kleckner acd9a6f09d [codeview] Fix buggy BeginIndexMapSize assertion
This assert is just trying to test that processing each record adds
exactly one entry to the index map. The assert logic was wrong when the
first record in the type stream was a field list.

I've simplified the code by moving the LF_FIELDLIST-specific logic into
the callback for that record type.

llvm-svn: 299035
2017-03-29 22:51:22 +00:00
Sanjay Patel b8a728f993 [CodeGen] clean up and add tests for scalar and-of-setcc; NFC
https://bugs.llvm.org/show_bug.cgi?id=32401

llvm-svn: 299034
2017-03-29 21:58:52 +00:00
Adam Nemet 049a31d53d Use FPContractModeKind universally
FPContractModeKind is the codegen option flag which is already ternary (off,
on, fast).  This makes it universally the type for the contractable info
across the front-end:

* In FPOptions (i.e. in the Sema + in the expression nodes).
* In LangOpts::DefaultFPContractMode which is the option that initializes
FPOptions in the Sema.

Another way to look at this change is that before fp-contractable on/off were
the only states handled to the front-end:
 * For "on", FMA folding was performed by  the front-end
 * For "fast", we simply forwarded the flag to TargetOptions to handle it in
 LLVM

Now off/on/fast are all exposed because for fast we will generate
fast-math-flags during CodeGen.

This is toward moving fp-contraction=fast from an LLVM TargetOption to a
FastMathFlag in order to fix PR25721.

---
This is a recommit of r299027 with an adjustment to the test
CodeGenCUDA/fp-contract.cu.  The test assumed that even
though -ffp-contract=on is passed FE-based folding of FMA won't happen.

This is obviously wrong since the user is asking for this explicitly with the
option.  CUDA is different that -ffp-contract=fast is on by default.

The test used to "work" because contract=fast and contract=on were maintained
separately and we didn't fold in the FE because contract=fast was on due to
the target-default.  This patch consolidates the contract=on/fast/off state
into a ternary state hence the change in behavior.
---

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

llvm-svn: 299033
2017-03-29 21:54:24 +00:00
Francis Ricci a79b8a22b4 Move current thread data out of lsan_common on linux
Summary:
Now that we have a platform-specific non-common lsan file, use
it to store non-common lsan data.

Reviewers: kubamracek

Subscribers: llvm-commits

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

llvm-svn: 299032
2017-03-29 21:49:47 +00:00
Francis Ricci 1aa20001ed Remove failing check from platform specific darwin lsan initializer
Summary:
We currently don't have any platform specific darwin
lsan modules, don't force failure if they don't exist.

Reviewers: kubamracek

Subscribers: llvm-commits

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

llvm-svn: 299031
2017-03-29 21:49:13 +00:00
Davide Italiano e13920f407 [X86IselLowering] Remove extraneous semicolon. NFCI.
Unbreaks the build with GCC -Werror.

llvm-svn: 299030
2017-03-29 21:34:58 +00:00
Adam Nemet e940f358c8 Revert "Use FPContractModeKind universally"
This reverts commit r299027.

It's causing a test failure in clang's CodeGenCUDE/fp-contract.cu

llvm-svn: 299029
2017-03-29 21:24:19 +00:00
Pavel Labath 01a28ca7f8 Centralize libc++ test skipping logic
Summary:
This aims to replace the different decorators we've had on each libc++
test with a single solution. Each libc++ will be assigned to the
"libc++" category and a single central piece of code will decide whether
we are actually able to run libc++ test in the given configuration by
enabling or disabling the category (while giving the user the
opportunity to override this).

I started this effort because I wanted to get libc++ tests running on
android, and none of the existing decorators worked for this use case:
 - skipIfGcc - incorrect, we can build libc++ executables on android
 with gcc (in fact, after this, we can now do it on linux as well)
 - lldbutil.skip_if_library_missing - this checks whether libc++.so is
 loaded in the proces, which fails in case of a statically linked
 libc++ (this makes copying executables to the remote target easier to
 manage).

To make this work I needed to split out the pseudo_barrier code from the
force-included file, as libc++'s atomic does not play well with gcc on
linux, and this made every test fail, even though we need the code only
in the threading tests.

So far, I am only annotating one of the tests with this category. If
this does not break anything, I'll proceed to update the rest.

Reviewers: jingham, zturner, EricWF

Subscribers: srhines, lldb-commits

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

llvm-svn: 299028
2017-03-29 21:01:14 +00:00
Adam Nemet 32093a1c28 Use FPContractModeKind universally
FPContractModeKind is the codegen option flag which is already ternary (off,
on, fast).  This makes it universally the type for the contractable info
across the front-end:

* In FPOptions (i.e. in the Sema + in the expression nodes).
* In LangOpts::DefaultFPContractMode which is the option that initializes
FPOptions in the Sema.

Another way to look at this change is that before fp-contractable on/off were
the only states handled to the front-end:
 * For "on", FMA folding was performed by  the front-end
 * For "fast", we simply forwarded the flag to TargetOptions to handle it in
 LLVM

Now off/on/fast are all exposed because for fast we will generate
fast-math-flags during CodeGen.

This is toward moving fp-contraction=fast from an LLVM TargetOption to a
FastMathFlag in order to fix PR25721.

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

llvm-svn: 299027
2017-03-29 20:39:49 +00:00
Huihui Zhang d6d6a3f2ee revert test commit r299024
llvm-svn: 299026
2017-03-29 20:23:56 +00:00
Rui Ueyama 8d753caa78 Remove parameter names from template instantiations to make them compact. NFC.
llvm-svn: 299025
2017-03-29 20:15:29 +00:00