Commit Graph

313546 Commits

Author SHA1 Message Date
Nico Weber 04347d848d 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
2019-04-04 21:06:41 +00:00
Scott Linder ce2b61b299 Fix some MCTargetOptions Doxygen comments (NFC)
llvm-svn: 357723
2019-04-04 20:35:57 +00:00
Jonathan Peyton b727d384a3 [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
2019-04-04 20:35:29 +00:00
David Goldman 19d21854e9 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
2019-04-04 20:13:22 +00:00
Nico Weber e028de43cd 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
2019-04-04 20:08:04 +00:00
James Y Knight a040174418 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 d413f41de6)
This reverts r357380 (git commit 7af32444b9)

llvm-svn: 357718
2019-04-04 19:05:48 +00:00
Alexey Bataev f5daa97045 [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
2019-04-04 18:58:17 +00:00
Reid Kleckner 4312fee0a9 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
2019-04-04 18:45:05 +00:00
Sam Clegg 09137be7f8 [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
2019-04-04 18:40:51 +00:00
Reid Kleckner 41fe3a54c2 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
2019-04-04 18:30:07 +00:00
Stephen Hines 1ee8876d3d 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
2019-04-04 18:17:46 +00:00
Alexey Bataev c8490cfa8e [OPENMP]Add codegen for linear vars with allocate clause, NFC.
Added test for the linear variables with the allocate clause.

llvm-svn: 357712
2019-04-04 18:06:53 +00:00
Martin Storsjo 351ac8b1cc 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
2019-04-04 17:50:14 +00:00
Sam Clegg 2a7cac932b [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
2019-04-04 17:43:50 +00:00
Don Hinton 98e3954fe9 [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
2019-04-04 17:35:41 +00:00
Alexey Bataev 0923266be5 [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
2019-04-04 17:28:22 +00:00
Julian Lettner f7461b8c5f [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
2019-04-04 17:25:43 +00:00
Adrian Prantl ce2d45e7ba llvm-dwarfdump: Support alternative architecture names in the -arch filter
<rdar://problem/47918606>

llvm-svn: 357706
2019-04-04 15:48:40 +00:00
Eric Fiselier 9d75d88d30 Handle TLS values in sym_check
llvm-svn: 357705
2019-04-04 15:37:10 +00:00
Sanjay Patel 17648b848e [x86] eliminate unnecessary broadcast of horizontal op
This is another pattern that comes up if we more aggressively
scalarize FP ops.

llvm-svn: 357703
2019-04-04 14:46:13 +00:00
Alex Bradbury b920a7f65b [RISCV] Fix rL357699 by adding missing zero-length files
svn add doesn't play very nicely here...

llvm-svn: 357702
2019-04-04 14:36:07 +00:00
Michal Gorny 1f68002cb7 [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
2019-04-04 14:21:38 +00:00
Nico Weber ffff492128 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
2019-04-04 14:19:45 +00:00
Alex Bradbury d411677dea [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
2019-04-04 14:18:26 +00:00
Lewis Revill aa79a3fe8e [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
2019-04-04 14:13:37 +00:00
Joseph Tremoulet 9f598ac706 [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
2019-04-04 14:13:28 +00:00
Nico Weber b28b4c9036 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
2019-04-04 14:08:35 +00:00
Krasimir Georgiev 00e7ae9f80 [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
2019-04-04 14:04:26 +00:00
Nico Weber eefa343df5 Use a cmake check for linux that actually works.
llvm-svn: 357694
2019-04-04 13:54:01 +00:00
Alex Bradbury a0ce4ac0c8 [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
2019-04-04 13:51:41 +00:00
Nico Weber ea3f97d278 Try to suppress nodiscard_extension failures with Xcode 9
See https://crbug.com/949509 for the error message.

llvm-svn: 357692
2019-04-04 13:37:15 +00:00
Pavel Labath dfaafbcf4c 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
2019-04-04 13:23:25 +00:00
Sam McCall ca58078dc6 [clangd] Test #import directive go-to-definition. NFC
llvm-svn: 357690
2019-04-04 13:09:02 +00:00
Sam McCall 4e56502be2 [clangd] Stop passing around PCHContainerOperations, just create it in place. NFC
llvm-svn: 357689
2019-04-04 12:56:03 +00:00
Jonas Paulsson c56ffed304 [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
2019-04-04 12:12:35 +00:00
George Rimar 5776f66580 [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
2019-04-04 11:49:54 +00:00
Sam McCall bc7ff89964 [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
2019-04-04 11:34:18 +00:00
Simon Pilgrim 937bc02fd6 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
2019-04-04 11:12:30 +00:00
Anastasia Stulova 9b4c6b8c7b [PR41157][OpenCL] Prevent implicit init of local addr space var in C++ mode.
Prevent adding initializers implicitly to variables declared in
local address space. This happens when they get converted into
global variables and therefore theoretically have to be default
initialized in C++.

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

llvm-svn: 357684
2019-04-04 11:08:51 +00:00
Fangrui Song e2622b3e33 [Symbolize] Keep SymbolDescs with the same address and improve getNameFromSymbolTable heuristic
I'll follow up with better heuristics or tests.

llvm-svn: 357683
2019-04-04 11:08:45 +00:00
Anastasia Stulova 094c72660a [PR41276] Fixed incorrect generation of addr space cast for 'this' in C++.
Improved classification of address space cast when qualification
conversion is performed - prevent adding addr space cast for
non-pointer and non-reference types. Take address space correctly
from the pointee.

Also pass correct address space from 'this' object using
AggValueSlot when generating addrspacecast in the constructor
call.

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

llvm-svn: 357682
2019-04-04 10:48:36 +00:00
Diana Picus 153c3887e4 [ARM GlobalISel] Support DBG_VALUE
Make sure we can map and select DBG_VALUE.

llvm-svn: 357681
2019-04-04 10:24:51 +00:00
Pavel Labath e090389c4a modify-python-lldb.py: (Re)move __len__ and __iter__ support
Summary:
This patch moves the modify-python-lldb code for adding new functions to
the SBModule class into the SBModule interface file. As this is the last
class using this functionality, I also remove all support for this kind
of modifications from modify-python-lldb.py.

Reviewers: amccarth, clayborg, jingham

Subscribers: zturner, lldb-commits

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

llvm-svn: 357680
2019-04-04 10:13:59 +00:00
Simon Pilgrim 5ad10f4df9 [SLP][X86] Regenerate operandorder tests with arguments on same line. NFCI.
Stops update_test_checks.py from splitting the later arguments after the CHECKs.

llvm-svn: 357679
2019-04-04 09:31:12 +00:00
Jan Kratochvil d0157b3b07 Add dropped ManualDWARFIndex assert()
D47253 dropped this assertion.

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

llvm-svn: 357678
2019-04-04 09:24:02 +00:00
Sander de Smalen 772e4734d9 [AArch64][AsmParser] Fix .arch_extension directive parsing
This patch fixes .arch_extension directive parsing to handle a wider
range of architecture extension options. The existing parser was parsing
extensions as an identifier which breaks for extensions containing a
"-", such as the "tlb-rmi" extension.

The extension is now parsed as a string. This is consistent with the
extension parsing in the .arch and .cpu directive parsing.

Patch by Cullen Rhodes (c-rhodes)

Reviewed By: SjoerdMeijer

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

llvm-svn: 357677
2019-04-04 09:11:17 +00:00
Igor Kudrin 734a2bc737 [llvm-symbolizer] Allow more flexible usage of -e.
addr2line allows -e to be grouped with other options; it also allows it
to prefix the value. Thus, all the following usages are possible:

  * addr2line -f -e <bin> <addr>
  * addr2line -fe <bin> <addr>
  * addr2line -f e<bin> <addr>
  * addr2line -fe<bin> <addr>

This patch adds the same for llvm-symbolizer.

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

llvm-svn: 357676
2019-04-04 08:45:06 +00:00
Igor Kudrin 0fed7b0564 [llvm-symbolizer] Add `--output-style` switch.
In general, llvm-symbolizer follows the output style of GNU's addr2line.
However, there are still some differences; in particular, for a requested
address, llvm-symbolizer prints line and column, while addr2line prints
only the line number.

This patch adds a new switch to select the preferred style.

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

llvm-svn: 357675
2019-04-04 08:39:40 +00:00
Luqman Aden 8911c5be46 [InstCombine] Combine no-wrap sub and icmp w/ constant.
Teach InstCombine the transformation `(icmp P (sub nuw|nsw C2, Y), C) -> (icmp swap(P) Y, C2-C)`

Reviewers: majnemer, apilipenko, sanjoy, spatel, lebedev.ri

Reviewed By: lebedev.ri

Subscribers: dmgreen, lebedev.ri, nikic, hiraditya, JDevlieghere, jfb, jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 357674
2019-04-04 07:08:30 +00:00
Craig Topper 3649c20884 [X86] Use INSERT_SUBREG rather than SUBREG_TO_REG when creating LEA64_32 during isel.
SUBREG_TO_REG is supposed to be used to assert that we know the upper bits are
zero. But that isn't the case here. We've done no analysis of the inputs.

llvm-svn: 357673
2019-04-04 05:00:18 +00:00