Saleem Abdulrasool [Fri, 5 Apr 2019 18:00:49 +0000 (18:00 +0000)]
lit: make rm python 3 friendly (NFC)
Add some alterations for python 3 compatibility.
llvm-svn: 357789
Zachary Turner [Fri, 5 Apr 2019 17:59:26 +0000 (17:59 +0000)]
[PDB Docs] Finish documentation for PDB Info Stream.
The information about the named stream map and feature codes
was not present. This patch adds it.
llvm-svn: 357788
Jonas Devlieghere [Fri, 5 Apr 2019 17:57:42 +0000 (17:57 +0000)]
Add .noindex to the gitignore
The .noindex suffix is used on macOS to prevent Spotlight from indexing
its contents. These folders contain test output from dotest.py and
should be ignored when dotest is run from the LLDB source directory.
llvm-svn: 357787
Jonas Devlieghere [Fri, 5 Apr 2019 17:57:40 +0000 (17:57 +0000)]
[testsuite] Split Objective-C data formatter
The testcase for objective-c data formatters is very big as it checks a
bunch of stuff. This is annoying when using the lit test driver, because
it prevents us from running the different cases in parallel. As a
result, it's always one of the last few tests that complete. This patch
splits the test into multiple files that share a common base class. This
way lit can run the different tests in parallel.
Differential revision: https://reviews.llvm.org/D60300
llvm-svn: 357786
Zachary Turner [Fri, 5 Apr 2019 17:12:37 +0000 (17:12 +0000)]
[PDB Docs] Add info about the hash adjustment buffer.
This necessitates adding a document describing the serialized
hash table format. This document is currently empty, although
it will be filled out in followup patches.
llvm-svn: 357784
Nico Weber [Fri, 5 Apr 2019 17:05:54 +0000 (17:05 +0000)]
gn build: Merge 357768 and 357770
llvm-svn: 357783
Sanjay Patel [Fri, 5 Apr 2019 17:00:57 +0000 (17:00 +0000)]
[InstCombine] add tests for fdiv+fmul; NFC
llvm-svn: 357782
Nico Weber [Fri, 5 Apr 2019 16:57:34 +0000 (16:57 +0000)]
gn build: Merge r357719
llvm-svn: 357781
Sanjay Patel [Fri, 5 Apr 2019 16:52:57 +0000 (16:52 +0000)]
[InstCombine] add tests for sqrt+fdiv+fmul; NFC
Examples based on recent llvm-dev thread. These are specific
patterns of more general enhancements that would solve these.
llvm-svn: 357780
Evgeny Mankov [Fri, 5 Apr 2019 16:51:10 +0000 (16:51 +0000)]
[CUDA][Windows] Last fix for the clang Bug 38811 "Clang fails to compile with CUDA-9.x on Windows" (https://bugs.llvm.org/show_bug.cgi?id=38811).
[IMPORTANT]
With that last fix, CUDA has just started being compiling by clang on Windows after nearly a year and two clang’s major releases (7 and 8).
As long as the last LLVM release, in which clang was compiling CUDA on Windows successfully, was 6.0.1, this fix and two previous have to be included into upcoming 7.1.0 and 8.0.1 releases.
[How to repro]
clang++.exe -x cuda "c:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.0\0_Simple\simplePrintf\simplePrintf.cu" -I"c:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.0\common\inc" --cuda-gpu-arch=sm_50 --cuda-path="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0" -L"c:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\lib\x64" -lcudart.lib -v
[Output]
In file included from C:\GIT\LLVM\trunk-for-submits\llvm-64-release-vs2017-15.9.9\dist\lib\clang\9.0.0\include\__clang_cuda_runtime_wrapper.h:327:
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0/include\crt/math_functions.hpp:390:11: error: no matching function for call to '__isinfl'
return (__isinfl(a) != 0);
^~~~~~~~
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0/include\crt/math_functions.hpp:2662:14: note: candidate function not viable: call to __host__ function from __device__ function
__func__(int __isinfl(long double a))
^
In file included from <built-in>:1:
In file included from C:\GIT\LLVM\trunk-for-submits\llvm-64-release-vs2017-15.9.9\dist\lib\clang\9.0.0\include\__clang_cuda_runtime_wrapper.h:327:
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0/include\crt/math_functions.hpp:438:11: error: no matching function for call to '__isnanl'
return (__isnanl(a) != 0);
^~~~~~~~
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0/include\crt/math_functions.hpp:2672:14: note: candidate function not viable: call to __host__ function from __device__ function
__func__(int __isnanl(long double a))
^
In file included from <built-in>:1:
In file included from C:\GIT\LLVM\trunk-for-submits\llvm-64-release-vs2017-15.9.9\dist\lib\clang\9.0.0\include\__clang_cuda_runtime_wrapper.h:327:
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0/include\crt/math_functions.hpp:486:11: error: no matching function for call to '__finitel'
return (__finitel(a) != 0);
^~~~~~~~~
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0/include\crt/math_functions.hpp:2652:14: note: candidate function not viable: call to __host__ function from __device__ function
__func__(int __finitel(long double a))
^
3 errors generated when compiling for sm_50.
[Solution]
Add missing long double device functions' declarations. Provide only declarations to prevent any use of long double on the device side, because CUDA does not support long double on the device side.
[Testing]
{Windows 10, Ubuntu 16.04.5}/{Visual C++ 2017 15.9.9, gcc+ 5.4.0}/CUDA {8.0, 9.0, 9.1, 9.2, 10.0, 10.1}
Reviewed by: Artem Belevich
Differential Revision: http://reviews.llvm.org/D60220
llvm-svn: 357779
Saleem Abdulrasool [Fri, 5 Apr 2019 16:48:00 +0000 (16:48 +0000)]
lit: support long paths on Windows
Use ctypes to call into SHFileOperationW with the extended NT path to allow us
to remove paths which exceed 261 characters on Windows. This functionality is
exercised by swift's test suite.
llvm-svn: 357778
Zachary Turner [Fri, 5 Apr 2019 16:43:42 +0000 (16:43 +0000)]
Add documentation for PDB TPI/IPI Stream.
llvm-svn: 357777
Sanjay Patel [Fri, 5 Apr 2019 16:42:21 +0000 (16:42 +0000)]
[InstCombine] add test to show reassociation that creates a denormal constant; NFC
llvm-svn: 357776
Louis Dionne [Fri, 5 Apr 2019 16:33:37 +0000 (16:33 +0000)]
[libc++] Fix error flags and exceptions propagated from input stream operations
Summary:
This is a re-application of r357533 and r357531. They had been reverted
because we thought the commits broke the LLDB data formatters, but it
turns out this was because only r357531 had been included in the CI
run.
Before this patch, we would only ever throw an exception if the badbit
was set on the stream. The Standard is currently very unclear on how
exceptions should be propagated and what error flags should be set by
the input stream operations. This commit changes libc++ to behave under
a different (but valid) interpretation of the Standard. This interpretation
of the Standard matches what other implementations are doing.
This effectively implements the wording in p1264r0. It hasn't been voted
into the Standard yet, however there is wide agreement that the fix is
correct and it's just a matter of time before the fix is standardized.
PR21586
PR15949
rdar://problem/
15347558
Reviewers: mclow.lists, EricWF
Subscribers: christof, dexonsmith, cfe-commits
Differential Revision: https://reviews.llvm.org/D49863
llvm-svn: 357775
Stephen Tozer [Fri, 5 Apr 2019 16:32:25 +0000 (16:32 +0000)]
Revert "[llvm-readobj] Improve error message for --string-dump"
This reverts commit
681b0798dbbc6b3500c9930977ec8a274b142acb.
Reverted due to causing build failures: llvm-svn: 357772
llvm-svn: 357774
Fangrui Song [Fri, 5 Apr 2019 16:16:23 +0000 (16:16 +0000)]
Change some dyn_cast to more apropriate isa. NFC
llvm-svn: 357773
Stephen Tozer [Fri, 5 Apr 2019 16:15:50 +0000 (16:15 +0000)]
[llvm-readobj] Improve error message for --string-dump
Fixes bug 40630: https://bugs.llvm.org/show_bug.cgi?id=40630
This patch changes the error message when the section specified by
--string-dump cannot be found by including the name of the section in
the error message and changing the prefix text to not imply that the
file itself was invalid. As part of this change some uses of
std::error_code have been replaced with the llvm Error class to better
encapsulate the error info (rather than passing File strings around),
and the WithColor class replaces string literal error prefixes.
Differential Revision: https://reviews.llvm.org/D59946
llvm-svn: 357772
Stephen Tozer [Fri, 5 Apr 2019 15:59:07 +0000 (15:59 +0000)]
[format] Add correct punctuation to comment
Test commit that adds a grammatically correct full stop to a single
comment.
llvm-svn: 357771
Sam McCall [Fri, 5 Apr 2019 15:22:20 +0000 (15:22 +0000)]
[Tooling] add a Heuristic field indicating that a CompileCommand was guessed.
Summary:
Use cases:
- a tool that dumps the heuristic used for each header in a project can
be used to evaluate changes to the heuristic
- we want to expose this information to users in clangd as it affects
accuracy/reliability of editor features
- express interpolation tests more directly
Reviewers: ilya-biryukov, klimek
Subscribers: ioeric, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D60194
llvm-svn: 357770
Guillaume Chatelet [Fri, 5 Apr 2019 15:18:59 +0000 (15:18 +0000)]
Add an option do not dump the generated object on disk
Reviewers: courbet
Subscribers: llvm-commits, bdb
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60317
llvm-svn: 357769
Yitzhak Mandelbaum [Fri, 5 Apr 2019 15:14:05 +0000 (15:14 +0000)]
[LibTooling] Add Transformer, a library for source-to-source transformations.
Summary: Adds a basic version of Transformer, a library supporting the concise specification of clang-based source-to-source transformations. A full discussion of the end goal can be found on the cfe-dev list with subject "[RFC] Easier source-to-source transformations with clang tooling".
Reviewers: ilya-biryukov
Reviewed By: ilya-biryukov
Subscribers: ioeric, ABataev, mgorny, jfb, jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D59376
llvm-svn: 357768
Clement Courbet [Fri, 5 Apr 2019 15:03:25 +0000 (15:03 +0000)]
[ExpandMemCmp][NFC] Add tests for `memcmp(p, q, n) < 0` case.
llvm-svn: 357767
Simon Pilgrim [Fri, 5 Apr 2019 14:56:21 +0000 (14:56 +0000)]
[SelectionDAG] Add fcmp UNDEF handling to SelectionDAG::FoldSetCC
Second half of PR40800, this patch adds DAG undef handling to fcmp instructions to match the behavior in llvm::ConstantFoldCompareInstruction, this permits constant folding of vector comparisons where some elements had been reduced to UNDEF (by SimplifyDemandedVectorElts etc.).
This involves a lot of tweaking to reduced tests as bugpoint loves to reduce fcmp arguments to undef........
Differential Revision: https://reviews.llvm.org/D60006
llvm-svn: 357765
Yitzhak Mandelbaum [Fri, 5 Apr 2019 14:05:03 +0000 (14:05 +0000)]
[LibTooling] Add "SourceCode" library for functions relating to source-code manipulation.
Summary:
Introduces a utility library in Refactoring/ to collect routines related to
source-code manipulation. In this change, we move "extended-range" functions
from the FixIt library (in clangTooling) to this new library.
We need to use this functionality in Refactoring/ and cannot access it if it
resides in Tooling/, because that would cause clangToolingRefactor to depend on
clangTooling, which would be a circular dependency.
Reviewers: ilya-biryukov, ioeric
Reviewed By: ilya-biryukov
Subscribers: mgorny, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D60269
llvm-svn: 357764
Matt Arsenault [Fri, 5 Apr 2019 14:03:07 +0000 (14:03 +0000)]
GlobalISel: Add another overload of buildUnmerge
It's annoying to have to create an array of the result type,
particularly when you don't care about the size of the value.
llvm-svn: 357763
Matt Arsenault [Fri, 5 Apr 2019 14:03:04 +0000 (14:03 +0000)]
AMDGPU/GlobalISel: Fix non-power-of-2 select
llvm-svn: 357762
Don Hinton [Fri, 5 Apr 2019 13:59:24 +0000 (13:59 +0000)]
[llvm] Add isa_and_nonnull
Summary:
Add new ``isa_and_nonnull<>`` operator that works just like
the ``isa<>`` operator, except that it allows for a null pointer as an
argument (which it then returns false).
Reviewers: lattner, aaron.ballman, greened
Reviewed By: lattner
Subscribers: hubert.reinterpretcast, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60291
llvm-svn: 357761
Sanjay Patel [Fri, 5 Apr 2019 13:32:17 +0000 (13:32 +0000)]
[DAGCombiner][x86] scalarize splatted vector FP ops
There are a variety of vector patterns that may be profitably reduced to a
scalar op when scalar ops are performed using a subset (typically, the
first lane) of the vector register file.
For x86, this is true for float/double ops and element 0 because
insert/extract is just a sub-register rename.
Other targets should likely enable the hook in a similar way.
Differential Revision: https://reviews.llvm.org/D60150
llvm-svn: 357760
Petar Jovanovic [Fri, 5 Apr 2019 12:58:15 +0000 (12:58 +0000)]
[TextAPI] Fix off-by-one error in the bit index extraction loop
The loop in findNextSetBit() runs one pass more than it should.
On 64-bit architectures this does not cause a problem, but 32-bit
architectures mask the shift count to 5 bits which limits the number of
shifts inside a range of 0 to 31. Shifting by 32 has the same effect as
shifting by 0, so if the first bit in the set is 1, the function will return
with Index different from EndIndexVal. Because of that, range-based for
loops iterating thorough architectures will continue until hitting a 0 in
the set, resulting in n additional iterations, where n is equal to the
number of consecutive 1 bits at the start the set.
Ultimately TBDv1.WriteFile and TBDv2.WriteFile will output additional
architectures causing a failure in the unit tests.
Patch by Milos Stojanovic.
Differential Revision: https://reviews.llvm.org/D60198
llvm-svn: 357759
Fangrui Song [Fri, 5 Apr 2019 12:52:04 +0000 (12:52 +0000)]
[Symbolize] Replace map<SymbolDesc, StringRef> with sorted vector
llvm-svn: 357758
Simon Pilgrim [Fri, 5 Apr 2019 11:34:30 +0000 (11:34 +0000)]
[X86][AVX] Add PR34584 masked store test cases
llvm-svn: 357757
Simon Pilgrim [Fri, 5 Apr 2019 11:22:28 +0000 (11:22 +0000)]
[X86] Add SSE/AVX1/AVX2 masked trunc+store tests
llvm-svn: 357756
Pavel Labath [Fri, 5 Apr 2019 09:56:55 +0000 (09:56 +0000)]
modify-python-lldb.py: Insert initialization code with swig instead
This is the last functional change to the generated python module being
done by modify-python-lldb.py. The remaining code just deals with
reformatting of comments.
llvm-svn: 357755
Pavel Labath [Fri, 5 Apr 2019 08:43:54 +0000 (08:43 +0000)]
Fix r357749 for big-endian architectures
We need to read the strings from the minidump files as little-endian,
regardless of the host byte order.
I definitely remember thinking about this case while writing the patch
(and in fact, I have implemented that for the "write" case), but somehow
I have ended up not implementing the byte swapping when reading the
data. This adds the necessary byte-swapping and should hopefully fix
test failures on big-endian bots.
llvm-svn: 357754
Rainer Orth [Fri, 5 Apr 2019 08:42:21 +0000 (08:42 +0000)]
[Sanitizers] Provide __internal_dup on Solaris
Both LLVM 8.0.0 and current trunk fail to link libclang_rt.ubsan.standalone-*.so
on Solaris 11/x86 with GCC 8.1.0:
Undefined first referenced
symbol in file
Scanning dependencies of target clang_rt.asan_cxx-x86_64
__sanitizer::internal_dup(int) ../sanitizer_common/CMakeFiles/RTSanitizerCommon.i386.dir/sanitizer_posix.cc.o
ld: fatal: symbol referencing errors
collect2: error: ld returned 1 exit status
make[2]: *** [projects/compiler-rt/lib/ubsan/CMakeFiles/clang_rt.ubsan_standalone-dynamic-i386.dir/build.make:233: lib/clang/9.0.0/lib/sunos/libclang_rt.ubsan_standalone-i386.so] Error 1
Fixed by providing an implementation, which allowed the i386-pc-solaris2.11 build
to finish.
Differential Revision: https://reviews.llvm.org/D60045
llvm-svn: 357753
Roger Ferrer Ibanez [Fri, 5 Apr 2019 08:40:57 +0000 (08:40 +0000)]
[RISCV] Implement adding a displacement to a BlockAddress
Recent change rL357393 uses MachineInstrBuilder::addDisp to add a based on a
BlockAddress but this case was not implemented.
This patch adds the missing case and a test for RISC-V that exercises the new
case.
Differential Revision: https://reviews.llvm.org/D60136
llvm-svn: 357752
Rainer Orth [Fri, 5 Apr 2019 08:40:08 +0000 (08:40 +0000)]
[Sanitizers] Fix sanitizer_linux_libcdep.cc compilation on Solaris
Both LLVM 8.0.0 and current trunk fail to compile on Solaris 11/x86 with
GCC 8.1.0:
/vol/llvm/src/llvm/dist/projects/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc: In function ‘void __sanitizer::ReExec()’:
/vol/llvm/src/llvm/dist/projects/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc:831:14: error: ‘getexecname’ was not declared in this scope
pathname = getexecname();
^~~~~~~~~~~
/vol/llvm/src/llvm/dist/projects/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc:831:14: note: suggested alternative: ‘gethostname’
pathname = getexecname();
^~~~~~~~~~~
gethostname
This is easily fixed by including <stdlib.h> which declares that function.
With that patch, compilation continues.
Differential Revision: https://reviews.llvm.org/D60044
llvm-svn: 357751
Pavel Labath [Fri, 5 Apr 2019 08:26:58 +0000 (08:26 +0000)]
Fix MSVC build for r357749
MSVC found the bare "make_unique" invocation ambiguous (between std::
and llvm:: versions). Explicitly qualifying the call with llvm:: should
hopefully fix it.
llvm-svn: 357750
Pavel Labath [Fri, 5 Apr 2019 08:06:26 +0000 (08:06 +0000)]
Minidump: Add support for reading/writing strings
Summary:
Strings in minidump files are stored as a 32-bit length field, giving
the length of the string in *bytes*, which is followed by the
appropriate number of UTF16 code units. The string is also supposed to
be null-terminated, and the null-terminator is not a part of the length
field. This patch:
- adds support for reading these strings out of the minidump file (this
implementation does not depend on proper null-termination)
- adds support for writing them to a minidump file
- using the previous two pieces implements proper (de)serialization of
the CSDVersion field of the SystemInfo stream. Previously, this was
only read/written as hex, and no attempt was made to access the
referenced string -- now this string is read and written correctly.
The changes are tested via yaml2obj|obj2yaml round-trip as well as a
unit test which checks the corner cases of the string deserialization
logic.
Reviewers: jhenderson, zturner, clayborg
Subscribers: llvm-commits, aprantl, markmentovai, amccarth, lldb-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59775
llvm-svn: 357749
Pavel Labath [Fri, 5 Apr 2019 07:56:39 +0000 (07:56 +0000)]
MinidumpParser: use minidump parser in llvm/Object
This patch removes the lower layers of the minidump parsing code from
the MinidumpParser class, and replaces it with the minidump parser in
llvm.
Not all functionality is already avaiable in the llvm class, but it is
enough for us to be able to stop enumerating streams manually, and rely
on the minidump directory parsing code from the llvm class.
This also removes some checked-in binaries which were used to test error
handling in the parser, as the error handling is now done (and tested)
in llvm. Instead I just add one test that ensures we correctly propagate
the errors reported by the llvm parser. The input for this test can be
written in yaml instead of a checked-in binary.
llvm-svn: 357748
Pavel Labath [Fri, 5 Apr 2019 07:56:26 +0000 (07:56 +0000)]
TestVCCode_step: replace assertTrue with more specific assertions
When this test fails (flakes) all we get is an error message like "False
is not True". This replaces patterns like assertTrue(a == b) with
assertEqual(a, b), so we get a better error message (and hopefully a
hint as to why the test is flaky).
llvm-svn: 357747
Piotr Sobczak [Fri, 5 Apr 2019 07:44:09 +0000 (07:44 +0000)]
[SelectionDAG] Compute known bits of CopyFromReg
Summary:
Teach SelectionDAG how to compute known bits of ISD::CopyFromReg if
the virtual reg used has one def only.
This can be particularly useful when calling isBaseWithConstantOffset()
with the ISD::CopyFromReg argument, as more optimizations may get enabled
in the result.
Also add a missing truncation on X86, found by testing of this patch.
Change-Id: Id1c9fceec862d118c54a5b53adf72ada5d6daefa
Reviewers: bogner, craig.topper, RKSimon
Reviewed By: RKSimon
Subscribers: lebedev.ri, nemanjai, jvesely, nhaehnle, javed.absar, jsji, jdoerfert, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59535
llvm-svn: 357745
Pavel Labath [Fri, 5 Apr 2019 07:28:52 +0000 (07:28 +0000)]
PDBFPO: Use references instead of pointers, where possible
Summary:
The code was passing pointers around, expecting they would be not null.
In c++ it is possible to convey this notion explicitly by using a
reference instead.
Not all uses of pointers could be converted to references (e.g. one
can't store references in a container), but this will at least make it
locally obvious that code is dealing with nonnull pointers.
Reviewers: aleksandr.urakov, amccarth
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D60271
llvm-svn: 357744
Craig Topper [Fri, 5 Apr 2019 06:32:50 +0000 (06:32 +0000)]
[X86] Promote i16 SRA instructions to i32
We already promote SRL and SHL to i32.
This will introduce sign extends sometimes which might be harder to deal with than the zero we use for promoting SRL. I ran this through some of our internal benchmark lists and didn't see any major regressions.
I think there might be some DAG combine improvement opportunities in the test changes here.
Differential Revision: https://reviews.llvm.org/D60278
llvm-svn: 357743
Serguei Katkov [Fri, 5 Apr 2019 05:41:08 +0000 (05:41 +0000)]
[FastISel] Fix crash for gc.relocate lowring
Lowering safepoint checks that all gc.relocaes observed in safepoint
must be lowered. However Fast-Isel is able to skip dead gc.relocate.
To resolve this issue we just ignore dead gc.relocate in the check.
Reviewers: reames
Reviewed By: reames
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D60184
llvm-svn: 357742
Julian Lettner [Fri, 5 Apr 2019 02:05:57 +0000 (02:05 +0000)]
[TSan][libdispatch] Make test work on Linux, pt. 2
llvm-svn: 357741
Alex Lorenz [Fri, 5 Apr 2019 01:48:11 +0000 (01:48 +0000)]
[test] Specify an explicit darwin version in a triple in
`test/Driver/debug-options.c` to ensure that the driver
selects the DWARF 2 version as intended by the test.
Fixes the `test/Driver/debug-options.c` test regression on GreenDragon
on macOS that started failing after r357713.
llvm-svn: 357740
Peter Collingbourne [Fri, 5 Apr 2019 01:31:40 +0000 (01:31 +0000)]
ELF: Simplify. NFCI.
Differential Revision: https://reviews.llvm.org/D60299
llvm-svn: 357739
Rui Ueyama [Fri, 5 Apr 2019 01:30:09 +0000 (01:30 +0000)]
Remove redundant parameters. NFC.
llvm-svn: 357738
Sam Clegg [Fri, 5 Apr 2019 00:35:12 +0000 (00:35 +0000)]
[WebAssembly] Include function in wasm table when used in R_WASM_TABLE_INDEX_REL_SLEB
This should have been part of rL357710 but was overlooked because
in our test code the function in question was also used in other
relocations that caused it to be added to the table anyway.
Differential Revision: https://reviews.llvm.org/D60296
llvm-svn: 357737
Eric Christopher [Thu, 4 Apr 2019 23:34:38 +0000 (23:34 +0000)]
NFC: Move API uses of MD5::MD5Result to Optional rather than a pointer.
Differential Revision: https://reviews.llvm.org/D60290
llvm-svn: 357736
David Callahan [Thu, 4 Apr 2019 23:30:47 +0000 (23:30 +0000)]
Include invoke'd functions for recursive extract
Summary: When recursively extracting a function from a bit code file, include functions mentioned in InvokeInst as well as CallInst
Reviewers: loladiro, espindola, volkan
Reviewed By: loladiro
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60231
llvm-svn: 357735
Nick Lewycky [Thu, 4 Apr 2019 23:09:40 +0000 (23:09 +0000)]
An unreachable block may have a route to a reachable block, don't fast-path return that it can't.
A block reachable from the entry block can't have any route to a block that's not reachable from the entry block (if it did, that route would make it reachable from the entry block). That is the intended performance optimization for isPotentiallyReachable. For the case where we ask whether an unreachable from entry block has a route to a reachable from entry block, we can't conclude one way or the other. Fix a bug where we claimed there could be no such route.
The fix in rL357425 ironically reintroduced the very bug it was fixing but only when a DominatorTree is provided. This fixes the remaining bug.
llvm-svn: 357734
Juergen Ributzka [Thu, 4 Apr 2019 22:56:50 +0000 (22:56 +0000)]
[TextAPI] Prefix all architecture enums to fix the build on i386.
Summary: This changes the Architecture enum to use a prefix (AK_) to prevent the
preprocessor from replacing i386 with 1 when building llvm/clang for i386.
Reviewers: steven_wu, lhames, mstorsjo
Reviewed By: mstorsjo
Subscribers: hiraditya, jkorous, dexonsmith, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60241
llvm-svn: 357733
Max Moroz [Thu, 4 Apr 2019 22:55:18 +0000 (22:55 +0000)]
[libFuzzer] Another follow up fix for Data Flow scripts in Py3.
Reviewers: Dor1s
Reviewed By: Dor1s
Subscribers: delcypher, #sanitizers, llvm-commits
Tags: #llvm, #sanitizers
Differential Revision: https://reviews.llvm.org/D60289
llvm-svn: 357732
Evandro Menezes [Thu, 4 Apr 2019 22:40:06 +0000 (22:40 +0000)]
[IR] Refactor attribute methods in Function class (NFC)
Rename the functions that query the optimization kind attributes.
Differential revision: https://reviews.llvm.org/D60287
llvm-svn: 357731
Max Moroz [Thu, 4 Apr 2019 22:21:27 +0000 (22:21 +0000)]
[libFuzzer] Fix output format in data flow merge script after Py3 change.
Reviewers: Dor1s
Reviewed By: Dor1s
Subscribers: delcypher, #sanitizers, llvm-commits
Tags: #llvm, #sanitizers
Differential Revision: https://reviews.llvm.org/D60288
llvm-svn: 357730
Julian Lettner [Thu, 4 Apr 2019 21:55:40 +0000 (21:55 +0000)]
[TSan][libdispatch] Make test work on Linux
llvm-svn: 357729
Reid Kleckner [Thu, 4 Apr 2019 21:47:15 +0000 (21:47 +0000)]
Remove unneeded ymath.h include from int_math.h
This avoids a conflict between stdbool.h, which defines bool to _Bool in
xkeycheck.h. From what I can tell, ymath.h is an internal header, and
the intention is that users should include math.h directly instead. It
doesn't appear to provide declarations of anything required for our
builtins. This include was added back in r249513 from 2015, and it's
possible that ymath.h provided something this code needed at the time,
but today it does not.
llvm-svn: 357728
Julian Lettner [Thu, 4 Apr 2019 21:25:56 +0000 (21:25 +0000)]
[TSan][libdispatch] Stricter checks via `--implicit-check-not`
`--implicit-check-not='ThreadSanitizer'` checks in the entire output
while `// CHECK-NOT: ThreadSanitizer` only checks after (before) the
previous (next) match.
llvm-svn: 357727
Max Moroz [Thu, 4 Apr 2019 21:20:36 +0000 (21:20 +0000)]
[libFuzzer] Make DataFlow scripts Python3 compatible.
Summary:
Python2 will hit end of life soon: https://pythonclock.org/
This change also makes the integration with OSS-Fuzz a bit simpler:
https://github.com/google/oss-fuzz/issues/1632
Reviewers: morehouse, kcc
Reviewed By: morehouse
Subscribers: delcypher, #sanitizers, llvm-commits
Tags: #llvm, #sanitizers
Differential Revision: https://reviews.llvm.org/D60282
llvm-svn: 357726
Reid Kleckner [Thu, 4 Apr 2019 21:08:02 +0000 (21:08 +0000)]
[winasan] Fix strrchr interception with vs2019 CRT
strrchr in vs2019 CRT begins with unrecognized instructions.
VCRUNTIME140!strrchr:
4533c9 xor r9d, r9d
4c8bc1 mov r8, rcx
Patch by Christopher Reid!
Differential Revision: https://reviews.llvm.org/D60217
llvm-svn: 357725
Nico Weber [Thu, 4 Apr 2019 21:06:41 +0000 (21:06 +0000)]
Make SourceManager::createFileID(UnownedTag, ...) take a const llvm::MemoryBuffer*
Requires making the llvm::MemoryBuffer* stored by SourceManager const,
which in turn requires making the accessors for that return const
llvm::MemoryBuffer*s and updating all call sites.
The original motivation for this was to use it and fix the TODO in
CodeGenAction.cpp's ConvertBackendLocation() by using the UnownedTag
version of createFileID, and since llvm::SourceMgr* hands out a const
llvm::MemoryBuffer* this is required. I'm not sure if fixing the TODO
this way actually works, but this seems like a good change on its own
anyways.
No intended behavior change.
Differential Revision: https://reviews.llvm.org/D60247
llvm-svn: 357724
Scott Linder [Thu, 4 Apr 2019 20:35:57 +0000 (20:35 +0000)]
Fix some MCTargetOptions Doxygen comments (NFC)
llvm-svn: 357723
Jonathan Peyton [Thu, 4 Apr 2019 20:35:29 +0000 (20:35 +0000)]
[OpenMP] Fix hang on Windows
Debug dump on large machine shows when many OpenMP threads (401 in total)
sleep on a barrier, one of the innermost nesting levels sleeps
on a child's b_arrived flag whose value is equal to 4 and is equal to
checker value. i.e., (1) sleep bit is 0, and (2) done_check() would
return true if called.
It is unclear how this might happen. It could be Windows Server 2016's
error of EnterCriticalSection / LeaveCriticalSection, or
error of WaitForSingleObject / SetEvent / ResetEvent, or
error in the library which is very difficult to find.
As a workaround, change INFINITE wait to timed wait, so that each
thread awakens each 5 seconds (the timeout was chosen arbitrary to not
disturb other threads much), check flag condition under the lock, and
either go to sleep again or stop sleeping as a result of the check.
Patch by Andrey Churbanov
Differential Revision: https://reviews.llvm.org/D59793
llvm-svn: 357722
David Goldman [Thu, 4 Apr 2019 20:13:22 +0000 (20:13 +0000)]
Special case ObjCPropertyDecl for printing
ObjCPropertyDecl should use the category interface as a context similar to what is done for methods.
Previously category methods would be printed as `::property`; now they are printed as `Class::property`.
llvm-svn: 357720
Nico Weber [Thu, 4 Apr 2019 20:08:04 +0000 (20:08 +0000)]
check-clang-tools: Actually build and run XPC test
The CMake variable controlling if XPC code is built is called
CLANGD_BUILD_XPC but three places unintentionally checked the
non-existent variable CLANGD_BUILD_XPC_SUPPORT instead, which (due to
being nonexistent, and due to cmake) always silently evaluated to false.
Luckily the test still seems to pass, despite never running after being
added almost 3 months ago in r351280.
Differential Revision: https://reviews.llvm.org/D60120
llvm-svn: 357719
James Y Knight [Thu, 4 Apr 2019 19:05:48 +0000 (19:05 +0000)]
Revert [X86] When using Win64 ABI, exit with error if SSE is disabled for varargs
It unnecessarily breaks previously-working code which used varargs,
but didn't pass any float/double arguments (such as EDK2).
Also revert the fixup on top of that:
Revert [X86] Fix a test from r357317
This reverts r357317 (git commit
d413f41de6baf500e5d20c638375447e18777db2)
This reverts r357380 (git commit
7af32444b9b17719ebabb6bee6eb52465acc8507)
llvm-svn: 357718
Alexey Bataev [Thu, 4 Apr 2019 18:58:17 +0000 (18:58 +0000)]
[OPENMP]Add codegen for task reduction vars with allocate clause, NFC.
Added test for the task reduction variables with the allocate clause.
llvm-svn: 357717
Reid Kleckner [Thu, 4 Apr 2019 18:45:05 +0000 (18:45 +0000)]
Appease STLs where std::atomic<void*> lacks a constexpr default ctor
MSVC 2019 casts the pointer to a pointer-sized integer, which is a
reinterpret_cast, which is invalid in a constexpr context, so I have to
remove the LLVM_REQUIRES_CONSTANT_INITIALIZATION annotation for now.
llvm-svn: 357716
Sam Clegg [Thu, 4 Apr 2019 18:40:51 +0000 (18:40 +0000)]
[WebAssembly] Apply data relocations at runtime in shared objects
See: https://github.com/WebAssembly/tool-conventions/blob/master/DynamicLinking.md
Data section relocations in wasm shared libraries are applied by the
library itself at static constructor time. This change adds a new
synthetic function that applies relocations to relevant memory locations
on startup.
Differential Revision: https://reviews.llvm.org/D59278
llvm-svn: 357715
Reid Kleckner [Thu, 4 Apr 2019 18:30:07 +0000 (18:30 +0000)]
Ensure that ManagedStatic is constant initialized in MSVC 2017 & 2019
Fixes PR41367.
This effectively relands r357655 with a workaround for MSVC 2017.
I tried various approaches with unions, but I ended up going with this
ifdef approach because it lets us write the proper C++11 code that we
want to write, with a separate workaround that we can delete when we
drop MSVC 2017 support.
This also adds LLVM_REQUIRE_CONSTANT_INITIALIZATION, which wraps
[[clang::require_constant_initialization]]. This actually detected a
minor issue when using clang-cl where clang wasn't able to use the
constexpr constructor in MSVC's STL, so I switched back to using the
default ctor of std::atomic<void*>.
llvm-svn: 357714
Stephen Hines [Thu, 4 Apr 2019 18:17:46 +0000 (18:17 +0000)]
Verify that Android targets generate DWARF 4 by default.
Summary:
In the future, Android releases will support DWARF 5, but we need to
ensure that older targets only have DWARF 4 generated for them. This
patch inserts that verification for all Android releases now. The patch
also fixes 2 minor mistakes (a mistakenly moved RUN line, and the
missing G_DWARF2 check label).
Reviewers: aprantl
Reviewed By: aprantl
Subscribers: chh, pirama, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D60238
llvm-svn: 357713
Alexey Bataev [Thu, 4 Apr 2019 18:06:53 +0000 (18:06 +0000)]
[OPENMP]Add codegen for linear vars with allocate clause, NFC.
Added test for the linear variables with the allocate clause.
llvm-svn: 357712
Martin Storsjo [Thu, 4 Apr 2019 17:50:14 +0000 (17:50 +0000)]
Move the alias definition of unw_getcontext to within !defined(__USING_SJLJ_EXCEPTIONS__)
For builds with SJLJ, there is no __unw_getcontext symbol. On Windows,
the weak alias macro also expands to a dllexport directive, which fails
if the symbol doesn't exist.
Differential Revision: https://reviews.llvm.org/D60251
llvm-svn: 357711
Sam Clegg [Thu, 4 Apr 2019 17:43:50 +0000 (17:43 +0000)]
[WebAssembly] Add new explicit relocation types for PIC relocations
See https://github.com/WebAssembly/tool-conventions/pull/106
Differential Revision: https://reviews.llvm.org/D59907
llvm-svn: 357710
Don Hinton [Thu, 4 Apr 2019 17:35:41 +0000 (17:35 +0000)]
[llvm-objcopy] [llvm-symbolizer] Fix failing tests
Summary: Fix failing tests that matched substrings in path.
Reviewers: evgeny777, mattd, espindola, alexshap, rupprecht, jhenderson
Reviewed By: jhenderson
Subscribers: Bulletmagnet, emaste, arichardson, jakehehrlich, MaskRay, rupprecht, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60170
llvm-svn: 357709
Alexey Bataev [Thu, 4 Apr 2019 17:28:22 +0000 (17:28 +0000)]
[OPENMP]Fix lookup of the user-defined reductions in C.
Fixed the regression of the lookup of user-defined reductions for C.
llvm-svn: 357708
Julian Lettner [Thu, 4 Apr 2019 17:25:43 +0000 (17:25 +0000)]
[TSan][libdispatch] Specify libdispatch header dir for lit tests
Specify libdispatch header dir (include path) for lit tests. This is the
last missing piece in order to run the libdispatch tests on Linux even
when libdispatch is installed in a custom path instead of a default
(system) location.
llvm-svn: 357707
Adrian Prantl [Thu, 4 Apr 2019 15:48:40 +0000 (15:48 +0000)]
llvm-dwarfdump: Support alternative architecture names in the -arch filter
<rdar://problem/
47918606>
llvm-svn: 357706
Eric Fiselier [Thu, 4 Apr 2019 15:37:10 +0000 (15:37 +0000)]
Handle TLS values in sym_check
llvm-svn: 357705
Sanjay Patel [Thu, 4 Apr 2019 14:46:13 +0000 (14:46 +0000)]
[x86] eliminate unnecessary broadcast of horizontal op
This is another pattern that comes up if we more aggressively
scalarize FP ops.
llvm-svn: 357703
Alex Bradbury [Thu, 4 Apr 2019 14:36:07 +0000 (14:36 +0000)]
[RISCV] Fix rL357699 by adding missing zero-length files
svn add doesn't play very nicely here...
llvm-svn: 357702
Michal Gorny [Thu, 4 Apr 2019 14:21:38 +0000 (14:21 +0000)]
[llvm] [cmake] Add additional headers only if they exist
Modify the add_header_files_for_glob() function to only add files
that do exist, rather than all matches of the glob. This fixes CMake
error when one of the include directories (which happen to include
/usr/include) contain broken symlinks.
Differential Revision: https://reviews.llvm.org/D59632
llvm-svn: 357701
Nico Weber [Thu, 4 Apr 2019 14:19:45 +0000 (14:19 +0000)]
Updating Chromium's Java import order
Adding in androidx as another import group.
Differential Revision: https://reviews.llvm.org/D60203
Patch from Sam Maier <smaier@chromium.org>!
llvm-svn: 357700
Alex Bradbury [Thu, 4 Apr 2019 14:18:26 +0000 (14:18 +0000)]
[RISCV] Collect library directories and triples for riscv64 triple too
When setting up library and tools paths when detecting an accompanying GCC
installation only riscv32 was handled. As a consequence when targetting
riscv64 neither the linker nor libraries would be found. This adds handling
and tests for riscv64.
Differential Revision: https://reviews.llvm.org/D53392
Patch by Edward Jones.
llvm-svn: 357699
Lewis Revill [Thu, 4 Apr 2019 14:13:37 +0000 (14:13 +0000)]
[RISCV] Support assembling TLS add and associated modifiers
This patch adds support in the MC layer for parsing and assembling the
4-operand add instruction needed for TLS addressing. This also involves
parsing the %tprel_hi, %tprel_lo and %tprel_add operand modifiers.
Differential Revision: https://reviews.llvm.org/D55341
llvm-svn: 357698
Joseph Tremoulet [Thu, 4 Apr 2019 14:13:28 +0000 (14:13 +0000)]
[COFF] Fix delay import directory iterator
Summary:
Take the Index into account in `getDelayImportTable`, otherwise we
always return the entry for the first delay DLL reference.
Reviewers: ruiu
Reviewed By: ruiu
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60081
llvm-svn: 357697
Nico Weber [Thu, 4 Apr 2019 14:08:35 +0000 (14:08 +0000)]
Fix clangd-fuzzer build
r357102 made clangd-fuzzer no longer compile, but before
r357654 / r357694 we didn't notice. Fix the compile.
Also add a dep on FuzzMutate which I forgot to do in r357654.
llvm-svn: 357696
Krasimir Georgiev [Thu, 4 Apr 2019 14:04:26 +0000 (14:04 +0000)]
[clang-format] Preserve include blocks in ObjC Google style
Summary:
r357567 started to regroup include block for Google style; it was meant to apply
only for C++. This patch reverts this for ObjC.
Reviewers: ioeric
Reviewed By: ioeric
Subscribers: thakis, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D60263
llvm-svn: 357695
Nico Weber [Thu, 4 Apr 2019 13:54:01 +0000 (13:54 +0000)]
Use a cmake check for linux that actually works.
llvm-svn: 357694
Alex Bradbury [Thu, 4 Apr 2019 13:51:41 +0000 (13:51 +0000)]
[RISCV][NFC] s/riscv32-linux-unknown-elf/riscv32-unknown-linux-gnu in test/Driver/riscv32-toolchain.c
riscv32-linux-unknown-elf was a weird thing to test for as it doesn't match
the triple used in any common RISC-V toolchain distributions (e.g.
riscv-gnu-toolchain scripts produce riscv{32,64}-unknown-linux-gnu).
llvm-svn: 357693
Nico Weber [Thu, 4 Apr 2019 13:37:15 +0000 (13:37 +0000)]
Try to suppress nodiscard_extension failures with Xcode 9
See https://crbug.com/949509 for the error message.
llvm-svn: 357692
Pavel Labath [Thu, 4 Apr 2019 13:23:25 +0000 (13:23 +0000)]
Breakpad: Refine record classification code
Previously we would classify all STACK records into a single bucket.
This is not really helpful, because there are three distinct types of
records beginning with the token "STACK" (STACK CFI INIT, STACK CFI,
STACK WIN). To be consistent with how we're treating other records, we
should classify these as three different record types.
It also implements the logic to put "STACK CFI INIT" and "STACK CFI"
records into the same "section" of the breakpad file, as they are meant
to be read together (similar to how FUNC and LINE records are treated).
The code which performs actual parsing of these records will come in a
separate patch.
llvm-svn: 357691
Sam McCall [Thu, 4 Apr 2019 13:09:02 +0000 (13:09 +0000)]
[clangd] Test #import directive go-to-definition. NFC
llvm-svn: 357690
Sam McCall [Thu, 4 Apr 2019 12:56:03 +0000 (12:56 +0000)]
[clangd] Stop passing around PCHContainerOperations, just create it in place. NFC
llvm-svn: 357689
Jonas Paulsson [Thu, 4 Apr 2019 12:12:35 +0000 (12:12 +0000)]
[SystemZ] Bugfix in isFusableLoadOpStorePattern()
This function is responsible for checking the legality of fusing an instance
of load -> op -> store into a single operation. In the SystemZ backend the
check was incomplete and a test case emerged with a cycle in the instruction
selection DAG as a result.
Instead of using the NodeIds to determine node relationships,
hasPredecessorHelper() now is used just like in the X86 backend. This handled
the failing tests and as well gave a few additional transformations on
benchmarks.
The SystemZ isFusableLoadOpStorePattern() is now a very near copy of the X86
function, and it seems this could be made a utility function in common code
instead.
Review: Ulrich Weigand
https://reviews.llvm.org/D60255
llvm-svn: 357688
George Rimar [Thu, 4 Apr 2019 11:49:54 +0000 (11:49 +0000)]
[yaml2obj] - Check we correctly set the sh_info field of .symtab section.
initSymtabSectionHeader has the following line:
SHeader.sh_info = findLocalsNum(Symbols) + 1;
As was mentioned in a review comments for D60122,
it is never tested. The patch adds a test.
Differential revision: https://reviews.llvm.org/D60192
llvm-svn: 357687
Sam McCall [Thu, 4 Apr 2019 11:34:18 +0000 (11:34 +0000)]
[CodeComplete] Fix crash when completing ObjC block parameter with a broken type
Summary:
The fix isn't great, but it's hard to fix properly because the completion
code sensibly uses ParmVarDecl to represent parameters, but the AST-building
code sensibly doesn't synthesize them if the type is broken.
Also this case is apparently really rare, so it's probably not worth bending
over backwards for.
Reviewers: ilya-biryukov
Subscribers: javed.absar, kristof.beyls, arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D60258
llvm-svn: 357686
Simon Pilgrim [Thu, 4 Apr 2019 11:12:30 +0000 (11:12 +0000)]
Revert rL357655 and rL357656 from llvm/trunk:
Fix minor innaccuracy in previous comment on ManagedStaticBase
........
Make ManagedStatic constexpr constructible
Apparently it needs member initializers so that it can be constructed in
a constexpr context. I explained my investigation of this in PR41367.
........
Causes vs2017 debug llvm-tblgen to fail with "Unknown command line argument" errors - similar to the vs2019 error discussed on PR41367 without the patch....
llvm-svn: 357685