Rafael Espindola [Thu, 30 Mar 2017 14:02:08 +0000 (14:02 +0000)]
Use FileCheck instead of [.
llvm-svn: 299081
Alex Lorenz [Thu, 30 Mar 2017 13:48:33 +0000 (13:48 +0000)]
[ARC][ObjC++] Use ObjC semantic rules for comparisons between a pointer and
an ObjC object pointer
When ARC is enabled in Objective-C++, comparisons between a pointer and
Objective-C object pointer typically result in errors like this:
"invalid operands to a binary expression". This error message can be quite
confusing as it doesn't provide a solution to the problem, unlike the non-C++
diagnostic: "implicit conversion of Objective-C pointer type 'id' to C pointer
type 'void *' requires a bridged cast" (it also provides fix-its). This commit
forces comparisons between pointers and Objective-C object pointers in ARC to
use the Objective-C semantic rules to ensure that a better diagnostic is
reported.
rdar://
31103857
Differential Revision: https://reviews.llvm.org/D31177
llvm-svn: 299080
Nirav Dave [Thu, 30 Mar 2017 13:41:44 +0000 (13:41 +0000)]
Move NumRegParameters Module Flag. NFCI.
llvm-svn: 299079
Alex Lorenz [Thu, 30 Mar 2017 13:33:51 +0000 (13:33 +0000)]
[Sema][ObjC] Avoid the "type of property does not match type of accessor"
warning for methods that resemble the setters of readonly properties
rdar://
30415679
llvm-svn: 299078
Rafael Espindola [Thu, 30 Mar 2017 13:33:22 +0000 (13:33 +0000)]
Add LIT_USE_INTERNAL_SHELL to compiler-rt tests.
I am working on improving our internal bot infrastructure. One thing
that is unique to the ps4 is that we want to run the posix tests, but
have to execute them on windows.
We currently have a local hack to use a shell on windows, but it is
pretty much impossible to get all all the tools to play nice with all
the heuristics for what is a path and what is a command line option.
This adds support LIT_USE_INTERNAL_SHELL and I will then try to fix
the tests that fail with it but adding the missing features.
llvm-svn: 299077
Rafael Espindola [Thu, 30 Mar 2017 13:22:30 +0000 (13:22 +0000)]
Use count instead of grep -c.
Using count is more common in llvm and avoids a subshell.
llvm-svn: 299076
Andrew Ng [Thu, 30 Mar 2017 13:17:25 +0000 (13:17 +0000)]
Test commit.
Correct assertion messages in MachineOperand for some of the setters.
llvm-svn: 299075
Simon Pilgrim [Thu, 30 Mar 2017 13:10:33 +0000 (13:10 +0000)]
Spelling mistakes in comments. NFCI.
Based on corrections mentioned in patch for clang for PR27635
llvm-svn: 299074
Haojian Wu [Thu, 30 Mar 2017 13:07:38 +0000 (13:07 +0000)]
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
Simon Pilgrim [Thu, 30 Mar 2017 12:59:53 +0000 (12:59 +0000)]
Spelling mistakes in comments. NFCI.
Based on corrections mentioned in patch for clang for PR27635
llvm-svn: 299072
Jonathan Coe [Thu, 30 Mar 2017 12:59:41 +0000 (12:59 +0000)]
[clang-tidy] fix docs in hicpp checks
Fix for sphinx-doc warnings in r299068.
llvm-svn: 299071
Jonathan Coe [Thu, 30 Mar 2017 12:31:02 +0000 (12:31 +0000)]
[clang-tidy] fix for linker errors in hicpp checks
Speculative fix for linker errors in r299068.
llvm-svn: 299070
Simon Pilgrim [Thu, 30 Mar 2017 12:30:15 +0000 (12:30 +0000)]
Spelling mistakes in comments. NFCI.
llvm-svn: 299069
Jonathan Coe [Thu, 30 Mar 2017 11:57:54 +0000 (11:57 +0000)]
[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
Kristof Beyls [Thu, 30 Mar 2017 11:06:25 +0000 (11:06 +0000)]
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
Kristof Beyls [Thu, 30 Mar 2017 10:47:41 +0000 (10:47 +0000)]
Another attempt fix the Windows builds
By changing more detail::... to llvm::detail::...
llvm-svn: 299065
Kristof Beyls [Thu, 30 Mar 2017 10:14:40 +0000 (10:14 +0000)]
Attempt to fix the Windows builds by using llvm::detail::... instead of detail::...
llvm-svn: 299064
Daniel Sanders [Thu, 30 Mar 2017 09:36:33 +0000 (09:36 +0000)]
[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
Kristof Beyls [Thu, 30 Mar 2017 09:31:59 +0000 (09:31 +0000)]
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
Maxim Ostapenko [Thu, 30 Mar 2017 07:25:33 +0000 (07:25 +0000)]
[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
Kristof Beyls [Thu, 30 Mar 2017 07:24:49 +0000 (07:24 +0000)]
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
Craig Topper [Thu, 30 Mar 2017 05:49:03 +0000 (05:49 +0000)]
[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
Craig Topper [Thu, 30 Mar 2017 05:48:58 +0000 (05:48 +0000)]
[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
Mehdi Amini [Thu, 30 Mar 2017 05:21:33 +0000 (05:21 +0000)]
libc++ testing: fix invalid python syntax
llvm-svn: 299057
Mehdi Amini [Thu, 30 Mar 2017 05:07:18 +0000 (05:07 +0000)]
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
Mehdi Amini [Thu, 30 Mar 2017 04:51:19 +0000 (04:51 +0000)]
libc++ config testing: `use_system_cxx_lib` can be a bool
Fix the libc++ Green Dragon bot.
llvm-svn: 299055
Mehdi Amini [Thu, 30 Mar 2017 04:47:19 +0000 (04:47 +0000)]
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
Mehdi Amini [Thu, 30 Mar 2017 04:45:33 +0000 (04:45 +0000)]
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
Mehdi Amini [Thu, 30 Mar 2017 04:40:56 +0000 (04:40 +0000)]
Do not pass an explicit reexported symbol list when building libc++ dylib if also defining new/delete
llvm-svn: 299052
Kostya Serebryany [Thu, 30 Mar 2017 04:22:20 +0000 (04:22 +0000)]
[libFuzzer] remove a stale flag from tests, run value-profile-strncmp.test longer (hopefully, will fix the OSX bot)
llvm-svn: 299051
Dean Michael Berris [Thu, 30 Mar 2017 03:50:56 +0000 (03:50 +0000)]
[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
Dean Michael Berris [Thu, 30 Mar 2017 03:18:48 +0000 (03:18 +0000)]
[XRay][compiler-rt] Only run tests using llvm-xray in x86_64 for now
Followup on D31454.
llvm-svn: 299049
Dean Michael Berris [Thu, 30 Mar 2017 02:48:50 +0000 (02:48 +0000)]
[XRay][compiler-rt] XFAIL the FDR mode tests on aarch64-42vma
Followup on D31454.
llvm-svn: 299048
Zvi Rackover [Thu, 30 Mar 2017 01:42:57 +0000 (01:42 +0000)]
[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
Kostya Serebryany [Thu, 30 Mar 2017 01:27:20 +0000 (01:27 +0000)]
[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
Reid Kleckner [Thu, 30 Mar 2017 01:12:08 +0000 (01:12 +0000)]
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
Dean Michael Berris [Thu, 30 Mar 2017 01:05:09 +0000 (01:05 +0000)]
[XRay][clang] Use llvm::to_string instead of std::string
This should unbreak some bots.
Follow-up on D30388.
llvm-svn: 299044
Kuba Mracek [Thu, 30 Mar 2017 00:41:09 +0000 (00:41 +0000)]
[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
Dean Michael Berris [Thu, 30 Mar 2017 00:35:58 +0000 (00:35 +0000)]
[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
Dean Michael Berris [Thu, 30 Mar 2017 00:29:36 +0000 (00:29 +0000)]
[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
Jason Molenda [Thu, 30 Mar 2017 00:23:46 +0000 (00:23 +0000)]
Mask out EXC_SYSCALL exceptions as well.
<rdar://problem/
31335814>
llvm-svn: 299040
Eric Christopher [Wed, 29 Mar 2017 23:34:27 +0000 (23:34 +0000)]
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
Eric Christopher [Wed, 29 Mar 2017 23:34:20 +0000 (23:34 +0000)]
Add the -grecord-gcc-switches option and pass the flags down on the compile unit.
Patch by Zhizhou Yang
llvm-svn: 299037
Kostya Serebryany [Wed, 29 Mar 2017 22:59:28 +0000 (22:59 +0000)]
[sanitizers] Fix get_groups interceptor in sanitizer (https://reviews.llvm.org/D31332, patch by Martin Liška)
llvm-svn: 299036
Reid Kleckner [Wed, 29 Mar 2017 22:51:22 +0000 (22:51 +0000)]
[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
Sanjay Patel [Wed, 29 Mar 2017 21:58:52 +0000 (21:58 +0000)]
[CodeGen] clean up and add tests for scalar and-of-setcc; NFC
https://bugs.llvm.org/show_bug.cgi?id=32401
llvm-svn: 299034
Adam Nemet [Wed, 29 Mar 2017 21:54:24 +0000 (21:54 +0000)]
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
Francis Ricci [Wed, 29 Mar 2017 21:49:47 +0000 (21:49 +0000)]
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
Francis Ricci [Wed, 29 Mar 2017 21:49:13 +0000 (21:49 +0000)]
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
Davide Italiano [Wed, 29 Mar 2017 21:34:58 +0000 (21:34 +0000)]
[X86IselLowering] Remove extraneous semicolon. NFCI.
Unbreaks the build with GCC -Werror.
llvm-svn: 299030
Adam Nemet [Wed, 29 Mar 2017 21:24:19 +0000 (21:24 +0000)]
Revert "Use FPContractModeKind universally"
This reverts commit r299027.
It's causing a test failure in clang's CodeGenCUDE/fp-contract.cu
llvm-svn: 299029
Pavel Labath [Wed, 29 Mar 2017 21:01:14 +0000 (21:01 +0000)]
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
Adam Nemet [Wed, 29 Mar 2017 20:39:49 +0000 (20:39 +0000)]
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
Huihui Zhang [Wed, 29 Mar 2017 20:23:56 +0000 (20:23 +0000)]
revert test commit r299024
llvm-svn: 299026
Rui Ueyama [Wed, 29 Mar 2017 20:15:29 +0000 (20:15 +0000)]
Remove parameter names from template instantiations to make them compact. NFC.
llvm-svn: 299025
Huihui Zhang [Wed, 29 Mar 2017 20:10:45 +0000 (20:10 +0000)]
test commit, add blank line
llvm-svn: 299024
Kamil Rytarowski [Wed, 29 Mar 2017 19:52:24 +0000 (19:52 +0000)]
Add NetBSD path for Debugging Information in Separate Files
Summary:
NetBSD stores debug information files in the `/usr/libdata/debug` path.
This change fixes debugging distribution executables, e.g. `look`(1):
```
$ lldb /usr/bin/look
(lldb) target create "/usr/bin/look"
Current executable set to '/usr/bin/look' (x86_64).
(lldb) b main
Breakpoint 1: where = look`main + 22 at look.c:107, address = 0x0000000000000da6
(lldb) r
Process 23473 launched: '/usr/bin/look' (x86_64)
Process 23473 stopped
* thread #1, stop reason = breakpoint 1.1
frame #0: 0x0000000186600da6 look`main(argc=1, argv=0x00007f7fffc7c488) at look.c:107
104
105 string = NULL;
106 file = _PATH_WORDS;
-> 107 termchar = '\0';
108 while ((ch = getopt(argc, argv, "dft:")) != -1)
109 switch(ch) {
110 case 'd':
(lldb)
```
There is no `/usr/lib/debug` path on NeBSD, so remove it from search.
Sponsored by <The NetBSD Foundation>
Reviewers: jingham, emaste, kettenis, labath, joerg
Reviewed By: labath
Subscribers: aprantl, #lldb
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D31461
llvm-svn: 299023
Davide Italiano [Wed, 29 Mar 2017 19:39:46 +0000 (19:39 +0000)]
[DAGCombiner] Remove else after return. NFCI.
llvm-svn: 299022
Rui Ueyama [Wed, 29 Mar 2017 19:35:44 +0000 (19:35 +0000)]
Revert r298815: Do not use assert to report broken input files.
This reverts commit because this really shouldn't happen unless
there's a bug in LLD.
llvm-svn: 299021
Sean Callanan [Wed, 29 Mar 2017 19:32:59 +0000 (19:32 +0000)]
Move the definition of SBListener::GetSP() to SBListener.cpp.
This is the requirement for all functions in the public API,
to eliminate weak symbol definitions.
llvm-svn: 299020
Adrian McCarthy [Wed, 29 Mar 2017 19:27:08 +0000 (19:27 +0000)]
Re-land: "Make NativeExeSymbol a concrete subclass of NativeRawSymbol [PDB]"
This should work on all platforms now that r299006 has landed. Tested locally
on Windows and Linux.
This moves exe symbol-specific method implementations out of NativeRawSymbol
into a concrete subclass. Also adds implementations for hasCTypes and
hasPrivateSymbols and a simple test to ensure the native reader can access the
summary information for the executable from the PDB.
Original Differential Revision: https://reviews.llvm.org/D31059
llvm-svn: 299019
Rafael Espindola [Wed, 29 Mar 2017 19:26:26 +0000 (19:26 +0000)]
Add ifunc support to ModuleSymbolTable.
Do that by creating a global_values, which is similar to
global_objects, but also iterates over aliases and ifuncs.
llvm-svn: 299018
Matthew Simpson [Wed, 29 Mar 2017 18:23:08 +0000 (18:23 +0000)]
[InstCombine] Correct the check for vector GEPs
Some of the GEP combines (e.g., descaling) can't handle vector GEPs. We have an
existing check that attempts to bail out if given a vector GEP. However, the
check only tests the GEP's pointer operand. A GEP results in a vector of
pointers if at least one of its operands is vector-typed (e.g., its pointer
operand could be a scalar, but its index could be a vector). We should just
check the type of the GEP itself. This should fix PR32414.
Reference: https://bugs.llvm.org/show_bug.cgi?id=32414
Differential Revision: https://reviews.llvm.org/D31470
llvm-svn: 299017
Filipe Cabecinhas [Wed, 29 Mar 2017 18:17:22 +0000 (18:17 +0000)]
Add allocator_frees_and_returns_null_on_realloc_zero=false flag for compatibility with allocators which allow a realloc(p, 0) and don't free the pointer.
Summary:
I know of two implementations that do this (ASan is not protecting against accessing the returned memory for now, just like malloc(0)):
SIE libc on the PS4
dlmalloc has a flag for this
This allows us to properly support this behaviour.
Reviewers: vsk, kcc
Subscribers: llvm-commits, kubamracek
Differential Revision: https://reviews.llvm.org/D31295
llvm-svn: 299016
Brian Kelley [Wed, 29 Mar 2017 18:16:38 +0000 (18:16 +0000)]
[Objective-C] Miscellaneous -fobjc-weak Fixes
Summary: After examining the remaining uses of LangOptions.ObjCAutoRefCount, found a some additional places to also check for ObjCWeak not covered by previous test cases. Added a test file to verify all the code paths that were changed.
Reviewers: rsmith, doug.gregor, rjmccall
Reviewed By: rjmccall
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D31007
llvm-svn: 299015
Brian Kelley [Wed, 29 Mar 2017 18:09:02 +0000 (18:09 +0000)]
[Objective-C] Fix "weak-unavailable" warning with -fobjc-weak
Summary: clang should produce the same errors Objective-C classes that cannot be assigned to weak pointers under both -fobjc-arc and -fobjc-weak. Check for ObjCWeak along with ObjCAutoRefCount when analyzing pointer conversions. Add an -fobjc-weak pass to the existing arc-unavailable-for-weakref test cases to verify the behavior is the same.
Reviewers: rsmith, doug.gregor, rjmccall
Reviewed By: rjmccall
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D31006
llvm-svn: 299014
Sanjay Patel [Wed, 29 Mar 2017 18:08:01 +0000 (18:08 +0000)]
[DAGCombiner] unify type checks and add asserts; NFCI
We had a mix of type checks and usage that wasn't very clear.
llvm-svn: 299013
Graydon Hoare [Wed, 29 Mar 2017 17:58:41 +0000 (17:58 +0000)]
Unbreak windows bot.
llvm-svn: 299012
Brian Kelley [Wed, 29 Mar 2017 17:55:11 +0000 (17:55 +0000)]
[Objective-C] Fix "repeated use of weak" warning with -fobjc-weak
Summary: -Warc-repeated-use-of-weak should produce the same warnings with -fobjc-weak as it does with -objc-arc. Also check for ObjCWeak along with ObjCAutoRefCount when recording the use of an evaluated weak variable. Add a -fobjc-weak run to the existing arc-repeated-weak test case and adapt it slightly to work in both modes.
Reviewers: rsmith, doug.gregor, jordan_rose, rjmccall
Reviewed By: rjmccall
Subscribers: arphaman, rjmccall, cfe-commits
Differential Revision: https://reviews.llvm.org/D31005
llvm-svn: 299011
Brian Kelley [Wed, 29 Mar 2017 17:40:35 +0000 (17:40 +0000)]
[Objective-C] Fix __weak type traits with -fobjc-weak
Summary: Similar to ARC, in ObjCWeak Objective-C object pointers qualified with a weak lifetime are not POD or trivial types. Update the type trait code to reflect this. Copy and adapt the arc-type-traits.mm test case to verify correctness.
Reviewers: rsmith, doug.gregor, rjmccall
Reviewed By: rjmccall
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D31004
llvm-svn: 299010
Graydon Hoare [Wed, 29 Mar 2017 17:33:09 +0000 (17:33 +0000)]
[PCH] Attach instance's dependency collectors to PCH external AST sources.
Summary:
When a PCH is included via -include-pch, clang should treat the
current TU as dependent on the sourcefile that the PCH was generated from.
This is currently _partly_ accomplished by InitializePreprocessor calling
AddImplicitIncludePCH to synthesize an implicit #include of the sourcefile,
into the preprocessor's Predefines buffer.
For FrontendActions such as PreprocessOnlyAction (which is, curiously, what the
driver winds up running one of in response to a plain clang -M) this is
sufficient: the preprocessor cranks over its Predefines and emits a dependency
reference to the initial sourcefile.
For other FrontendActions (for example -emit-obj or -fsyntax-only) the
Predefines buffer is reset to the suggested predefines buffer from the PCH, so
the dependency edge is lost. The result is that clang emits a .d file in those
cases that lacks a reference to the .h file responsible for the input (and in
Swift's case, our .swiftdeps file winds up not including a reference to the
source file for a PCH bridging header.)
This patch fixes the problem by taking a different tack: ignoring the
Predefines buffer (which seems a bit like a hack anyways) and directly
attaching the CompilerInstance's DependencyCollectors (and legacy
DependencyFileGenerator) to the ASTReader for the external AST.
This approach is similar to the one chosen in earlier consultation with Bruno
and Ben, and I think it's the least-bad solution, given several options.
Reviewers: bruno, benlangmuir, doug.gregor
Reviewed By: bruno, doug.gregor
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D31378
llvm-svn: 299009
Brian Kelley [Wed, 29 Mar 2017 17:31:42 +0000 (17:31 +0000)]
[Objective-C] C++ Classes with __weak Members non-POD Types when using -fobjc-weak
Summary: When adding an Objective-C retainable type member to a C++ class, also check the LangOpts.ObjCWeak flag and the lifetime qualifier so __weak qualified Objective-C pointer members cause the class to be a non-POD type with non-trivial special members, so the compiler always emits the necessary runtime calls for copying, moving, and destroying the weak member. Otherwise, Objective-C++ classes with weak Objective-C pointer members compiled with -fobjc-weak exhibit undefined behavior if the C++ class is classified as a POD type.
Reviewers: rsmith, benlangmuir, doug.gregor, rjmccall
Reviewed By: rjmccall
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D31003
llvm-svn: 299008
Brian Kelley [Wed, 29 Mar 2017 17:18:05 +0000 (17:18 +0000)]
Test Commit
Remove trailing whitespace.
llvm-svn: 299007
Adrian McCarthy [Wed, 29 Mar 2017 17:11:27 +0000 (17:11 +0000)]
llvm-pdbdump: If we don't change the color, don't reset the color.
The -output-color option was successful at suppressing color changes, but
was still allowing color resets.
Differential Revision: https://reviews.llvm.org/D31468
llvm-svn: 299006
Weiming Zhao [Wed, 29 Mar 2017 16:59:09 +0000 (16:59 +0000)]
[Builtins] Mark mulsc3_test as UNSUPPORTED for armhf; NFC
The same test fails on clang-cmake-armv7-a15-full biuld bot
but passes the clang-cmake-thumbv7-a15-full.
For now, we mark it as UNSUPPORTED for armhf target.
Bug 32457 tracks it.
llvm-svn: 299005
Simon Pilgrim [Wed, 29 Mar 2017 15:41:58 +0000 (15:41 +0000)]
[X86] Tidied up comment - we don't custom lower add/sub i64 on i686 anymore. NFCI.
llvm-svn: 299004
Sanjay Patel [Wed, 29 Mar 2017 15:37:33 +0000 (15:37 +0000)]
[DAGCombiner] reduce code duplication by rearranging checks; NFCI
llvm-svn: 299002
Daniel Sanders [Wed, 29 Mar 2017 15:37:18 +0000 (15:37 +0000)]
[tablegen][globalisel] Convert the SelectionDAG importer to a tree walking approach. NFC
Summary:
But don't actually inspect the tree any deeper than we already do. This
change is NFC but the next one will enable full traversal of the
source/destination patterns.
Depends on D30535
Reviewers: t.p.northover, qcolombet, aditya_nandakumar, rovka, ab
Subscribers: igorb, dberris, llvm-commits, kristof.beyls
Differential Revision: https://reviews.llvm.org/D30536
llvm-svn: 299001
Simon Pilgrim [Wed, 29 Mar 2017 15:27:24 +0000 (15:27 +0000)]
Spelling mistakes in comments. NFCI.
llvm-svn: 299000
Sven van Haastregt [Wed, 29 Mar 2017 15:25:06 +0000 (15:25 +0000)]
[MachineVerifier] Drop a spurious const
As of r298987 the argument is a value that we std::move, so it
shouldn't be const anymore.
llvm-svn: 298999
George Rimar [Wed, 29 Mar 2017 15:23:28 +0000 (15:23 +0000)]
[ELF] - Prepare GnuHashTableSection<ELFT> for detemplation.
This patch changes GnuHashTableSection implementation
to avoid depend on uintX_t and other ELFT stuff, reducing amount of
changes for following patch(es).
Differential revision: https://reviews.llvm.org/D31184
llvm-svn: 298998
Weiming Zhao [Wed, 29 Mar 2017 14:55:51 +0000 (14:55 +0000)]
[Compiler-RT][Builtins] Remove XFAIL for mulsc3; NFC
It was XFAILed in r298974. However, the problem was not exposed on
the buildbot because hardfp flag was not passed during the test.
We can fix the CMAKE to pass the same flag as building the lib to the
RUN line to see if the problem is still there. For now, we remove the
XFAIL.
llvm-svn: 298997
Filipe Cabecinhas [Wed, 29 Mar 2017 14:42:27 +0000 (14:42 +0000)]
Cleanup in preparation for D30703. NFCI
Make the enumerators follow the coding convention and start with OW_...
llvm-svn: 298996
Rafael Espindola [Wed, 29 Mar 2017 14:27:38 +0000 (14:27 +0000)]
Fix GettingStarted.rst statement.
Patch by Wei-Ren Chen!
llvm-svn: 298995
Rafael Espindola [Wed, 29 Mar 2017 14:20:38 +0000 (14:20 +0000)]
Remove unused argument.
llvm-svn: 298994
Simon Pilgrim [Wed, 29 Mar 2017 13:00:00 +0000 (13:00 +0000)]
[X86][AVX2] Prevent unary interleaving patterns from calling lowerVectorShuffleAsSplitOrBlend (PR32453)
llvm-svn: 298993
Egor Churaev [Wed, 29 Mar 2017 12:09:39 +0000 (12:09 +0000)]
Reapplied r298976 [OpenCL] Added parsing for OpenCL vector types.
llvm-svn: 298992
Simon Pilgrim [Wed, 29 Mar 2017 12:09:25 +0000 (12:09 +0000)]
[AMDGPU] Tidy up computeKnownBitsForTargetNode/ComputeNumSignBitsForTargetNode arguments. NFCI.
Based on comment in D31249.
llvm-svn: 298991
Simon Pilgrim [Wed, 29 Mar 2017 10:47:18 +0000 (10:47 +0000)]
[X86][MMX] Added generic sitofp test to compare against existing cvtdq2ps test.
llvm-svn: 298989
Simon Pilgrim [Wed, 29 Mar 2017 10:44:51 +0000 (10:44 +0000)]
[X86] Removed old comment. NFCI.
No longer makes sense as the previous opcode mnemonic it was referring to is long gone.
llvm-svn: 298988
Sven van Haastregt [Wed, 29 Mar 2017 09:08:25 +0000 (09:08 +0000)]
[MachineVerifier] Avoid reference to nullptr
Instantiation of the MachineVerifierPass through
PassInfo::getNormalCtor would yield a segfault since the default
constructor of the MachineVerifierPass takes a reference to nullptr.
Patch by Simone Pellegrini.
Differential Revision: https://reviews.llvm.org/D31387
llvm-svn: 298987
Eric Christopher [Wed, 29 Mar 2017 07:40:44 +0000 (07:40 +0000)]
Move the x86 cpu feature rtm from Haswell to Skylake matching clang commit r298956.
llvm-svn: 298986
Craig Topper [Wed, 29 Mar 2017 07:31:56 +0000 (07:31 +0000)]
[AVX-512] Remove explicit KMOVWrk from isel patterns. COPY_TO_REGCLASS to GR32 is enough.
llvm-svn: 298985
Craig Topper [Wed, 29 Mar 2017 06:55:28 +0000 (06:55 +0000)]
[AVX-512] Remove explicit KMOVWrk/KMOVWKr instructions from patterns where we can just use COPY_TO_REGCLASS instead.
This will result in a KMOVW or KMOVD being emitted during register allocation. And in at least some cases this might allow the register coalescer to remove the copy all together.
llvm-svn: 298984
Dean Michael Berris [Wed, 29 Mar 2017 06:10:12 +0000 (06:10 +0000)]
[XRay] Update FDR log reader to be aware of buffer sizes per thread.
Summary:
It is problematic for this reader that it expects to read data from
several threads, but the header or message format does not define
framing. Since the buffers are reused, we can't rely on skipping
zeroed out data as a synchronization method either.
There is an argument that this is not version compatible with the format
the reader expected previously. I argue that since the writer wrote garbage
past the end of buffer record, there is no currently working reader to
compromise.
The corresponding writer change is posted to D31384.
Reviewers: dberris, pelikan
Reviewed By: dberris
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31385
llvm-svn: 298983
Dean Michael Berris [Wed, 29 Mar 2017 05:56:37 +0000 (05:56 +0000)]
[XRay] [compiler-rt] Write buffer length to FDR log before writing buffer.
Summary:
Currently the FDR log writer, upon flushing, dumps a sequence of buffers from
its freelist to disk. A reader can read the first buffer up to an EOB record,
but then it is unclear how far ahead to scan to find the next threads traces.
There are a few ways to handle this problem.
1. The reader has externalized knowledge of the buffer size.
2. The size of buffers is in the file header or otherwise encoded in the log.
3. Only write out the portion of the buffer with records. When released, the
buffers are marked with a size.
4. The reader looks for memory that matches a pattern and synchronizes on it.
2 and 3 seem the most flexible and 2 does not rule 3 out.
This is an implementation of 2.
In addition, the function handler for fdr more aggressively checks for
finalization and makes an attempt to release its buffer.
Reviewers: pelikan, dberris
Reviewed By: dberris
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31384
llvm-svn: 298982
Egor Churaev [Wed, 29 Mar 2017 05:40:45 +0000 (05:40 +0000)]
Reverted r298976 [OpenCL] Added parsing for OpenCL vector types.
llvm-svn: 298978
Dean Michael Berris [Wed, 29 Mar 2017 05:19:24 +0000 (05:19 +0000)]
[XRay][compiler-rt] Add an end-to-end test for FDR Logging
Summary:
This change exercises the end-to-end functionality defined in the FDR
logging implementation. We also prepare for being able to run traces
generated by the FDR logging implementation from being analysed with the
llvm-xray command that comes with the LLVM distribution.
This also unblocks D31385, D31384, and D31345.
Reviewers: kpw, pelikan
Subscribers: llvm-commits, mgorny
Differential Revision: https://reviews.llvm.org/D31452
llvm-svn: 298977
Egor Churaev [Wed, 29 Mar 2017 05:08:18 +0000 (05:08 +0000)]
[OpenCL] Added parsing for OpenCL vector types.
Reviewers: cfe-commits, Anastasia
Reviewed By: Anastasia
Subscribers: yaxunl, bader
Differential Revision: https://reviews.llvm.org/D31183
llvm-svn: 298976
Dean Michael Berris [Wed, 29 Mar 2017 04:55:45 +0000 (04:55 +0000)]
[XRay][tools] Handle "no subcommand" case for llvm-xray
Summary:
Currently the llvm-xray commandline tool fails to handle the case for
when no subcommand is provided in a graceful manner. This fixes that to
print the help message explaining the subcommands and the available
options.
Reviewers: pcc, pelikan
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31409
llvm-svn: 298975