Commit Graph

308999 Commits

Author SHA1 Message Date
Eric Fiselier 1bccafe4f6 Handle cases where the dirent::d_type macros aren't defined
llvm-svn: 352942
2019-02-01 23:52:17 +00:00
Yonghong Song 329010e1b5 Revert "[BPF] [BTF] Process FileName with absolute path correctly"
This reverts commit r352939.

Some tests failed. Revert to unblock others.

llvm-svn: 352941
2019-02-01 23:49:52 +00:00
Mandeep Singh Grang dc1e778369 [AArch64] Fix unused variable [NFC]
llvm-svn: 352940
2019-02-01 23:42:34 +00:00
Yonghong Song 5233fb8f5e [BPF] [BTF] Process FileName with absolute path correctly
In IR, sometimes the following attributes for DIFile may be
generated:
  filename: /home/yhs/test.c
  directory: /tmp
The /tmp may represent the working directory of the compilation
process.

In such cases, since filename is with absolute path,
the directory should be ignored by BTF. The filename alone is
enough to get the source.

Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Yonghong Song <yhs@fb.com>
llvm-svn: 352939
2019-02-01 23:23:17 +00:00
George Karpenkov 77b3530865 [analyzer] Hotfix for RetainCountChecker: assert was too strong.
Bridged casts can happen to non-CF objects as well.

llvm-svn: 352938
2019-02-01 23:06:44 +00:00
Philip Reames 00056ed0e6 [CodeGen] Be as conservative about atomic accesses as for volatile
Background: At the moment, we record the AtomicOrdering of an access in the MMO, but also mark any atomic access as volatile in SelectionDAG. I'm working towards separating that. See https://reviews.llvm.org/D57601 for context.

Update all usages of isVolatile in lib/CodeGen to preserve behaviour once atomic MMOs stop being also volatile. This is NFC in it's current form, but is essential for correctness once we make that final change.

It useful to keep in mind that AtomicSDNode is not a parent of LoadSDNode, StoreSDNode, or LSBaseSDNode. As a result, any call to isVolatile on one of those static types doesn't need a companion isAtomic check.  We should probably adjust that class hierarchy long term, but for now, that seperation is useful.

I'm deliberately being conservative about handling. I want the change to stop adding volatile to be NFC itself, and then will work through places where we can be less conservative for atomics one by one in separate changes w/tests.

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

llvm-svn: 352937
2019-02-01 22:58:52 +00:00
Dan Gohman b392ac9208 [WebAssembly] Fix ImportName's position in this test.
This is a follow-up to r352930.

llvm-svn: 352936
2019-02-01 22:52:29 +00:00
Evandro Menezes 39ad187ec9 [InstCombine] Refactor test checks (NFC)
llvm-svn: 352935
2019-02-01 22:52:05 +00:00
Roman Lebedev a21f3424d2 Revert "[AST][OpenMP] OpenMP Sections / Section constructs contain Structured blocks"
Further reviews (D57594, D57615) have revealed that this was not reviewed,
and that the differential's description was not read during the review,
thus rendering this commit invalid.

This reverts commit r352882.

llvm-svn: 352933
2019-02-01 22:43:08 +00:00
Philip Reames 05fc7edf62 [Test] Update file w/update_test_checks.py to make a follow on change obvious
llvm-svn: 352932
2019-02-01 22:30:51 +00:00
Dan Gohman f726e4454c [WebAssembly] Add codegen support for the import_field attribute
This adds the LLVM side of https://reviews.llvm.org/D57602 -- the
import_field attribute. See that patch for details.

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

llvm-svn: 352931
2019-02-01 22:27:34 +00:00
Dan Gohman cae8459ad2 [WebAssembly] Add an import_field function attribute
This is similar to import_module, but sets the import field name
instead.

By default, the import field name is the same as the C/asm/.o symbol
name. However, there are situations where it's useful to have it be
different. For example, suppose I have a wasm API with a module named
"pwsix" and a field named "read". There's no risk of namespace
collisions with user code at the wasm level because the generic name
"read" is qualified by the module name "pwsix". However in the C/asm/.o
namespaces, the module name is not used, so if I have a global function
named "read", it is intruding on the user's namespace.

With the import_field module, I can declare my function (in libc) to be
"__read", and then set the wasm import module to be "pwsix" and the wasm
import field to be "read". So at the C/asm/.o levels, my symbol is
outside the user namespace.

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

llvm-svn: 352930
2019-02-01 22:25:23 +00:00
Martin Storsjo c9f4d25f26 [COFF] Create range extension thunks for ARM64
On ARM64, this is normally necessary only after a module exceeds
128 MB in size (while the limit for thumb is 16 MB). For conditional
branches, the range limit is only 1 MB though (the same as for thumb),
and for the tbz instruction, the range is only 32 KB, which allows for
a test much smaller than the full 128 MB.

This fixes PR40467.

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

llvm-svn: 352929
2019-02-01 22:08:09 +00:00
Martin Storsjo b2b0cab0c3 [COFF] Fix crashes when writing a PDB after adding thunks.
When writing a PDB, the OutputSection of all chunks need to be set.
The thunks are added directly to OutputSection after the normal
machinery that sets it for all other chunks.

This fixes part of PR40467.

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

llvm-svn: 352928
2019-02-01 22:08:03 +00:00
Eric Fiselier 1147f71fed Improve diagnostic to tell you a type is incomplete.
I recently ran into this code:
```
\#include <iostream>
void foo(const std::string &s, const std::string& = "");
\#include <string>
void test() { foo(""); }
```

The diagnostic produced said it can't bind char[1] to std::string
const&. It didn't mention std::string is incomplete. The user had to
infer that.

This patch causes the diagnostic to now say "incomplete type".

llvm-svn: 352927
2019-02-01 22:06:02 +00:00
Marshall Clow 2e719bc428 add a test and a couple minor bug fixes for the implicit-signed-integer-truncation sanitizer. This is PR#40566
llvm-svn: 352926
2019-02-01 21:59:27 +00:00
Richard Smith 259e1bdfdd Factor out duplication between ExprIterator and ConstExprIterator.
This also exposes a more general iterator cast mechanism suitable for
use in http://reviews.llvm.org/D56571.

llvm-svn: 352925
2019-02-01 21:58:17 +00:00
Mandeep Singh Grang 70d484d94e [COFF, ARM64] Fix localaddress to handle stack realignment and variable size objects
Summary: This fixes using the correct stack registers for SEH when stack realignment is needed or when variable size objects are present.

Reviewers: rnk, efriedma, ssijaric, TomTan

Reviewed By: rnk, efriedma

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

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

llvm-svn: 352923
2019-02-01 21:41:33 +00:00
Simon Pilgrim e95550f508 [X86][AVX] Add VMOVDDUP-VPBROADCASTQ execution domain mapping
Noticed in D57514.

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

llvm-svn: 352922
2019-02-01 21:41:30 +00:00
Reid Kleckner 33706e3cbf [ubsan] Make suppressions.cpp test pass for me on Windows
The test seems to be failing because the module suppression file
contains a colon. I found that it was sufficient to just use the
basename of the suppression file.

While I was here, I noticed that we don't implement IsAbsolutePath for
Windows, so I added it.

llvm-svn: 352921
2019-02-01 21:35:17 +00:00
Scott Linder afc24ed21a [AMDGPU] Mark test functions with hidden visibility
Prepare for future patch which affects codegen for calls to preemptible
functions.

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

llvm-svn: 352920
2019-02-01 21:23:28 +00:00
Eric Fiselier de9ffab1ca Don't use ASTContext in DeclOpenMP.h because it's still incomplete.
llvm-svn: 352919
2019-02-01 21:19:20 +00:00
Jordan Rupprecht 614dd19869 [DebugInfo] Fix mkdir use in test
llvm-svn: 352918
2019-02-01 21:14:21 +00:00
Evandro Menezes d91776a433 [InstCombine] Expand Windows test (NFC)
Run checks for Win32 as well.

llvm-svn: 352917
2019-02-01 21:14:10 +00:00
Jordan Rupprecht 835df27f85 [DebugInfo] Don't use realpath when looking up debug binary locations.
Summary:
Using realpath makes assumptions about build systems that do not always hold true. The debug binary referred to from the .gnu_debuglink should exist in the same directory (or in a .debug directory, etc.), but the files may only exist as symlinks to a differently named files elsewhere, and using realpath causes that lookup to fail.

This was added in r189250, and this is basically a revert + regression test case.

Reviewers: dblaikie, samsonov, jhenderson

Reviewed By: dblaikie

Subscribers: llvm-commits, hiraditya

Tags: #llvm

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

llvm-svn: 352916
2019-02-01 21:04:16 +00:00
James Y Knight 291f791ef1 [opaque pointer types] Pass function type for CallBase::setCalledFunction.
Differential Revision: https://reviews.llvm.org/D57174

llvm-svn: 352914
2019-02-01 20:44:54 +00:00
James Y Knight 7716075a17 [opaque pointer types] Pass value type to GetElementPtr creation.
This cleans up all GetElementPtr creation in LLVM to explicitly pass a
value type rather than deriving it from the pointer's element-type.

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

llvm-svn: 352913
2019-02-01 20:44:47 +00:00
James Y Knight 14359ef1b6 [opaque pointer types] Pass value type to LoadInst creation.
This cleans up all LoadInst creation in LLVM to explicitly pass the
value type rather than deriving it from the pointer's element-type.

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

llvm-svn: 352911
2019-02-01 20:44:24 +00:00
James Y Knight d9e85a0861 [opaque pointer types] Pass function types to InvokeInst creation.
This cleans up all InvokeInst creation in LLVM to explicitly pass a
function type rather than deriving it from the pointer's element-type.

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

llvm-svn: 352910
2019-02-01 20:43:34 +00:00
James Y Knight 7976eb5838 [opaque pointer types] Pass function types to CallInst creation.
This cleans up all CallInst creation in LLVM to explicitly pass a
function type rather than deriving it from the pointer's element-type.

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

llvm-svn: 352909
2019-02-01 20:43:25 +00:00
Evandro Menezes c456309f67 [InstCombine] Expand Windows test (NFC)
Run checks for Win64 as well.

llvm-svn: 352908
2019-02-01 20:42:03 +00:00
Peter Collingbourne a18761ab9e gn build: Create regular archives for the sanitizer runtimes.
We'll need to do this eventually if we create an installable package.
For now, this lets me use the archives to build Android, whose build
system wants to copy the archives to another location.

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

llvm-svn: 352907
2019-02-01 20:34:43 +00:00
Michael Kruse 251e1488e1 [OpenMP 5.0] Parsing/sema support for "omp declare mapper" directive.
This patch implements parsing and sema for "omp declare mapper"
directive. User defined mapper, i.e., declare mapper directive, is a new
feature in OpenMP 5.0. It is introduced to extend existing map clauses
for the purpose of simplifying the copy of complex data structures
between host and device (i.e., deep copy). An example is shown below:

    struct S {  int len;  int *d; };
    #pragma omp declare mapper(struct S s) map(s, s.d[0:s.len]) // Memory region that d points to is also mapped using this mapper.

Contributed-by: Lingda Li <lildmh@gmail.com>

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

llvm-svn: 352906
2019-02-01 20:25:04 +00:00
Louis Dionne 6b653fc70f [libc++] Disentangle the 3 implementations of type_info
Summary:
We currently have effectively 3 implementations of type_info: one for
the Microsoft ABI, one that does not assume that there's a unique copy
of each RTTI in a progran, and one that assumes a unique copy.

Those 3 implementations are entangled into the same class with nested
ifdefs, which makes it very difficult to understand. Furthermore, the
benefit of doing this is rather small since the code that is duplicated
across implementations is just a couple of trivial lines.

This patch stamps out the 3 versions of type_info explicitly to increase
readability. It also explains what's going on with short comments, because
it's far from obvious.

Reviewers: EricWF, mclow.lists

Subscribers: christof, jkorous, dexonsmith

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

llvm-svn: 352905
2019-02-01 20:00:13 +00:00
Michael Liao 8b323f53eb [InstCombine] Extra null-checking on TFE/LWE support
- If that operand is not ConstantInt, skip enabling TFE/LWE.

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

llvm-svn: 352904
2019-02-01 19:53:44 +00:00
James Y Knight 6e75c7e337 Hopefully fix a couple more sphinx doc errors.
These seem to only appear on the buildbot runner, and it looks like we
tried to suppress them, but it's not working. Not sure why.

llvm-svn: 352903
2019-02-01 19:40:07 +00:00
Stefan Granitz da8fe66cb4 Fix the xcode build for r352845, attempt #2
llvm-svn: 352902
2019-02-01 19:31:02 +00:00
Stefan Granitz 5c49a3f4cc Revert "Fix the xcode build for r352845."
This reverts commit 72c1213a5e901b80c0f1d2794e5088d7f71a3632.

llvm-svn: 352901
2019-02-01 19:30:57 +00:00
Sid Manning 5d9c8ad43b [llvm-objdump] - llvm-objdump can skip bytes at the end of a section.
Differential Revision: https://reviews.llvm.org/D57549

llvm-svn: 352900
2019-02-01 19:11:47 +00:00
Thomas Anderson 7ba2d3e872 [lldb] Relax libc++ ABI version checking
libc++ has programmable ABI versioning controllable with the _LIBCPP_ABI_VERSION
macro.  Currently there are at least 3 settings used in real systems (1 as the
default, ndk1 for Anroid, Cr for Chromium).

Only the 1 and ndk1 cases were handled.  This change relaxes the check to allow
any ABI version.

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

llvm-svn: 352899
2019-02-01 19:10:39 +00:00
Philip Reames 5503e4f9b9 Fix a bug in the definition of isUnordered on MachineMemOperand
Background: At the moment, we record the AtomicOrdering of an access in the MMO, but also mark any atomic access as volatile in SelectionDAG. GlobalISEL keeps the two separate, but currently doesn't know how to lower an atomic G_LOAD at all. See https://reviews.llvm.org/D57601 for context.

The definition used for unordered was only checking volatility, not atomicity. As noted above, all atomic MMOs are currently also volatile, so this is a latent bug only. Copy the definition used in IR, after auditing the two (2) uses of the function to be sure the desired semantics are the same.

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

llvm-svn: 352898
2019-02-01 19:08:59 +00:00
Roland Froese 7f29195c3f test commit (add blank line) NFC
llvm-svn: 352897
2019-02-01 18:55:43 +00:00
Matt Davis 50ca8edb1a [llvm-readobj] Add a flag to dump just the section-to-segment mapping.
Summary:
The following patch introduces a new function `printSectionMapping` which is responsible for dumping just the section-to-segment mapping.
This patch also introduces a n option `-section-mapping` that outputs that mapping without the program headers.

Previously, this functionality was controlled by `printProgramHeaders`, and the output from `-program-headers` has not been changed.  I am happy to change the option name, I copied  the name that was displayed when outputting the mapping table.

Reviewers: khemant, jhenderson, grimar, rupprecht

Reviewed By: jhenderson, grimar, rupprecht

Subscribers: rupprecht, jhenderson, llvm-commits

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

llvm-svn: 352896
2019-02-01 18:51:10 +00:00
Evandro Menezes 25b4c4ceb6 [InstCombine] Refactor test checks (NFC)
llvm-svn: 352895
2019-02-01 18:34:20 +00:00
Jim Ingham 5c6544409a Fix the xcode build for r352845.
llvm-svn: 352894
2019-02-01 18:26:08 +00:00
Nico Weber 186fcdb5e5 gn build: Add a missing dependency from llvm/test to llvm-lit
check-llvm already listed llvm-lit as script which counts as a dep, so running
check-llvm worked fine, but `ninja -C out/gn llvm/test` didn't build llvm-lit
before if it wasn't already there.

llvm-svn: 352893
2019-02-01 18:17:19 +00:00
Evandro Menezes 743ba66f93 [InstCombine] Expand Windows test (NFC)
Add checks for Win64 to existing cases.

llvm-svn: 352892
2019-02-01 17:39:48 +00:00
Matt Davis 68fad505e2 [llvm-nm] Report '.comment' ELF sections as 'n' instead of '?'
Summary:
The previous implementation reported `.comment` sections as '?'
GNU uses 'n' which means  "The symbol is a debugging symbol."  `.note`  sections are represented as 'n' too.

The test related to this change was updated to CHECK-NEXT to ensure
order and that we did not miss any symbols in the dump.

Reviewers: jhenderson

Reviewed By: jhenderson

Subscribers: rupprecht, llvm-commits

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

llvm-svn: 352891
2019-02-01 17:38:08 +00:00
Max Moroz 123883807d Update SanitizerCoverage doc regarding the issue with pc-table and gc-sections.
Summary:
There is a bug for this: https://bugs.llvm.org/show_bug.cgi?id=34636
But it would be also helpful to leave a note in the docs to prevent users from
running into issues, e.g. https://crbug.com/926588.

Reviewers: morehouse

Reviewed By: morehouse

Subscribers: cfe-commits, llvm-commits, kcc

Tags: #clang

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

llvm-svn: 352890
2019-02-01 17:12:35 +00:00
Wolfgang Pieb 58513b7761 [DWARF v5] Fix DWARF emitter and consumer to produce/expect a uleb for a location description's length.
Reviewer: davide, JDevliegere

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

llvm-svn: 352889
2019-02-01 17:11:58 +00:00