Commit Graph

306509 Commits

Author SHA1 Message Date
Evgeniy Stepanov e9d00896bd Enable posix regex interceptors on linux.
Summary: They happen to work out of the box.

Reviewers: rtrieu, vitalybuka

Subscribers: kubamracek, fedor.sergeev, krytarowski, llvm-commits

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

llvm-svn: 350103
2018-12-27 21:47:26 +00:00
Kamil Rytarowski 93e3b34ceb Reimplement Thread Static Data MSan routines with TLS
Summary:
Thread Static Data cannot be used in early init on NetBSD
and FreeBSD. Reuse the MSan TSD API for compatibility with
existing code with an alternative implementation using Thread
Local Storage.

New version uses Thread Local Storage to store a pointer
with thread specific data. The destructor from TSD has been
replaced with a TLS destrucutor that is called upon thread
exit.

Reviewers: joerg, vitalybuka, jfb

Reviewed By: vitalybuka

Subscribers: emaste, jfb, llvm-commits, #sanitizers, mgorny

Tags: #sanitizers

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

llvm-svn: 350102
2018-12-27 21:43:46 +00:00
Evgeniy Stepanov d9df65fd0d [asan] Support running without /proc.
Summary:
This patch lets ASan run when /proc is not accessible (ex. not mounted
yet). It includes a special test-only flag that emulates this condition
in an unpriviledged process.

This only matters on Linux, where /proc is necessary to enumerate
virtual memory mappings.

Reviewers: pcc, vitalybuka

Subscribers: kubamracek, llvm-commits

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

llvm-svn: 350101
2018-12-27 21:31:52 +00:00
David Carlier 04b7be08d2 getfsent, unit test.
llvm-svn: 350100
2018-12-27 21:26:03 +00:00
David Carlier 774f7e83c3 [Sanitizer] Add fstab api to FreeBSD/Linux
Interception of /etc/fstab function parsers.

Reviewers: krytarowski, vitalybuka

Reviewed By: krytarowski

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

llvm-svn: 350099
2018-12-27 21:25:24 +00:00
Jordan Rupprecht 4009724151 [sanitizer] Avoid memset call in tsan
Summary: Assigning an array of bools to {false, false, false} can, in certain build configurations, lead to a memset call. Use internal_memset to avoid this.

Reviewers: eugenis

Subscribers: kubamracek, delcypher, llvm-commits, #sanitizers

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

llvm-svn: 350098
2018-12-27 20:29:10 +00:00
Kamil Rytarowski 7c276c141b Adjust NetBSD/sha2.cc to be portable to more environments
Summary:
By an accident part of the tests contained hardcoded checksums
for external files that will differ between setups.

Reviewers: mgorny

Subscribers: kubamracek, llvm-commits, #sanitizers

Tags: #sanitizers

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

llvm-svn: 350097
2018-12-27 17:04:00 +00:00
Kamil Rytarowski e4693c2c20 Adjust NetBSD/md2.cc to be portable to more environments
Summary:
By an accident part of the tests contained hardcoded checksums
for external files that will differ between setups.

Reviewers: mgorny

Subscribers: kubamracek, llvm-commits, #sanitizers

Tags: #sanitizers

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

llvm-svn: 350096
2018-12-27 17:03:21 +00:00
Kamil Rytarowski 001df4fb5a Adjust NetBSD/md[45].cc to be portable to more environments
Summary:
By an accident part of the tests contained hardcoded checksums
for external files that will differ between setups.

Reviewers: mgorny

Subscribers: kubamracek, llvm-commits, #sanitizers

Tags: #sanitizers

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

llvm-svn: 350095
2018-12-27 17:02:16 +00:00
Pavel Labath 88a2c2a41b Reduce indentation in ObjectFilePECOFF::CreateSections via an early return
llvm-svn: 350094
2018-12-27 15:16:44 +00:00
Pavel Labath 9294a2669e Fix tests for python 3.7
python 3.7 removes re._pattern_type. Fix the one place where we were
depending on the type of regular expressions to compute the type
dynamically.

llvm-svn: 350093
2018-12-27 15:16:37 +00:00
David Chisnall ddd06821c4 [objc-gnustep] Fix a copy-and-paste error.
We were emitting the null class symbol in the wrong section, which meant
that programs that contained no Objective-C classes would fail to link.

llvm-svn: 350092
2018-12-27 14:44:36 +00:00
Pavel Labath 9352f4706a Fix assertion failure in NativeProcessProtocolTest
The assertion fired (with a debug visual studio STL) because we tried to
dereference the end of a vector (although it was only to take its
address again and form an end iterator). Rewrite this logic to avoid the
questionable code.

llvm-svn: 350091
2018-12-27 13:45:55 +00:00
David Carlier 018f505c9e [Sanitizer] Enable FTS api on FreeBSD
Reviewers: krytarowski, vitalybuka

Reviewed By: krytarowski

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

llvm-svn: 350090
2018-12-27 12:56:54 +00:00
Pavel Labath 796984d6c0 Fix "default argument for lambda parameter" (-Wpedantic) warning
llvm-svn: 350089
2018-12-27 09:44:32 +00:00
Pavel Labath 4870fa9a40 Delete lldb_utility::Range
This class is unused, and there is already a lldb_private::Range
(defined in lldb/Core/RangeMap.h), which has similar functionality.

llvm-svn: 350088
2018-12-27 09:44:27 +00:00
Pavel Labath a352ed208b lldb-test ir-memory-map: Use IntervalMap::contains
Summary:
Simplify the code by using the contains implementation in IntervalMap.

There is a slight change of behavior here: We now treat an allocation of
size 0, as if it was size 1. This guarantees that the returned addresses
will be unique, whereas previously we would allow the allocation
function to return the same zero-sized region multiple times, as long as
it is not null, and not in the middle of an existing interval (but the
situation when we were placing an larger interval over a zero-sized one
was not detected).

I think this behavior makes more sense, as that is pretty much the same
guarantee as offered by malloc (except that is permitted to also return
nullptr).

Reviewers: vsk

Subscribers: lldb-commits

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

llvm-svn: 350087
2018-12-27 09:32:04 +00:00
Pavel Labath 3eba3f1a13 DWARF: Fix a bug in array size computation
Summary:
r346165 introduced a bug, where we would fail to parse the size of an
array if that size happened to match an existing die offset.

The logic was:
if (DWARFDIE count = die.GetReferencedDie(DW_AT_count))
  num_elements = compute_vla_size(count);
else
  num_elements = die.GetUsigned(DW_AT_count); // a fixed-size array

The problem with this logic was that GetReferencedDie did not take the
form class of the attribute into account, and would happily return a die
reference for any form, if its value happened to match some die.

As this behavior is inconsistent with how llvm's DWARFFormValue class
operates, I chose to fix the problem by making our version of this class
match the llvm behavior. For this to work, I had to add an explicit form
class check to the .apple_XXX tables parsing code, because they do
(incorrectly?) use data forms as die references.

Reviewers: aprantl, clayborg

Subscribers: JDevlieghere, lldb-commits

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

llvm-svn: 350086
2018-12-27 09:25:34 +00:00
Martin Liska 7240eb3ba9 Do not rely on that subject of ErrorAllocTypeMismatch is a heap address.
Differential Revision: https://reviews.llvm.org/D54856.

llvm-svn: 350085
2018-12-27 08:39:13 +00:00
Craig Topper 787ad92bf6 [X86] Remove check that avoids creating PMULDQ with illegal types. Rely on SplitOpsAndApply to legalize it.
Create PMULDQ/PMULUDQ as long as the number of elements is a power of 2.

This seems to give some improvements in our ability to use SimplifyDemandedBits.

llvm-svn: 350084
2018-12-27 03:37:04 +00:00
Evgeniy Stepanov 772bf988cf Revert "[msan] Disable tail call optimization in msan rtl."
This reverts commit r350080, which breaks
* gcc as the host compiler
* some tests on ppc64

llvm-svn: 350083
2018-12-27 03:30:42 +00:00
Craig Topper a8f07e51f9 [X86] Factor the core code out of LowerSETCC into a helper that can create CMP/BT/PTEST/KORTEST etc. without making an X86ISD::SETCC node. NFCI
Make each of the helper functions only return their comparison node and the condition code. Leave X86ISD::SETCC creation to the LowerSETCC function itself.

Looking into whether we can use this code directly in BRCOND and SELECT lowering instead of going through LowerSETCC which creates an X86ISD::SETCC node we need to look through.

llvm-svn: 350082
2018-12-27 01:50:40 +00:00
Craig Topper 4f1ef9fc0f [X86] Merge getBitTestCondition into LowerAndToBT. Don't create X86ISD::SETCC node in the merged function. NFCI
Only one of the 3 callers of LowerAndToBT need the SETCC node. Two of them have to look through it to find the operands they really need. Instead create it after the one call that needs it.

LowerAndToBT now returns both the BT node and the X86 specific condition code separately.

llvm-svn: 350081
2018-12-27 01:50:38 +00:00
Evgeniy Stepanov faef9b77de [msan] Disable tail call optimization in msan rtl.
This should give us better error stack traces on the bots, in
particular, for https://bugs.llvm.org/show_bug.cgi?id=40162

llvm-svn: 350080
2018-12-27 00:21:20 +00:00
Wouter van Oortmerssen f227621036 [WebAssembly] Added basic support for if/else/end_if in MC layer.
Summary:
These instructions are currently unused in our backend, but for
completeness it is good to support them, so they can be used with
the assembler in hand-written code.

Tests are very basic, signature support missing much like other blocks.

Reviewers: dschuff, aheejin

Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits

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

llvm-svn: 350079
2018-12-26 22:55:26 +00:00
Wouter van Oortmerssen 29c6ce5879 [WebAssembly] Make assembler check for proper nesting of control flow.
Summary:
It does so using a simple nesting stack, and gives clear errors upon
violation. This is unique to wasm, since most CPUs do not have
any nested constructs.

Had to add an end of file check to the general assembler for this.

Note: if/else/end instructions are not currently supported in our
tablegen defs, so these tests will be enabled in a follow-up.
They already pass the nesting check.

Reviewers: dschuff, aheejin

Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits

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

llvm-svn: 350078
2018-12-26 22:46:18 +00:00
Sylvestre Ledru 82f43aab21 manpages: Update the URL for https
llvm-svn: 350077
2018-12-26 22:34:44 +00:00
Heejin Ahn ce1d50f9d7 [WebAssembly] Delete an unnecessary line in RegStackify
`OneUseInst` is set outside of the loop before and `OneUse` does not
change throughout the loop, so this line is not necessary.

llvm-svn: 350076
2018-12-26 22:33:35 +00:00
Heejin Ahn 99d3946398 [WebAssembly] Fix typos in comments in RegStackify (NFC)
llvm-svn: 350075
2018-12-26 22:27:46 +00:00
Craig Topper c9a6000755 [LoopIdiomRecognize] Add CTTZ support
Summary:
Existing LIR recognizes CTLZ where shifting input variable right until it is zero. (Shift-Until-Zero idiom)

This commit:
1. Augments Shift-Until-Zero idiom to recognize CTTZ where input variable is shifted left.
2. Prepare for BitScan idiom recognition.

Patch by Yuanfang Chen (tabloid.adroit)

Reviewers: craig.topper, evstupac

Reviewed By: craig.topper

Subscribers: llvm-commits

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

llvm-svn: 350074
2018-12-26 21:59:48 +00:00
Reid Kleckner c168c6f86f [codeview] Check if this 'this' type of a method is a pointer
Fixes crash reported after r347354 for frontends that don't always emit
'this' pointers for methods. Now we will silently produce debug info
that makes functions like this look like static methods, which seems
reasonable.

llvm-svn: 350073
2018-12-26 21:52:17 +00:00
Reid Kleckner a643e6449b [clang-cl] Treat inputs as C++ with /E, like MSVC
midl invokes the compiler on .idl files with /E. Before this change, we
would treat unrecognized inputs as object files. Now we pre-process to
stdout as expected. I checked that MSVC defines __cplusplus when invoked
this way, so treating the input as C++ seems like the right thing to do.

After this change, I was able to run midl like this with clang-cl:
$ midl -cpp_cmd clang-cl.exe foo.idl

Things worked for the example IDL file in the Microsoft documentation,
but beyond that, I don't know if this will work well.

Fixes PR40140

llvm-svn: 350072
2018-12-26 21:04:08 +00:00
Reid Kleckner 3ab5a9cd1c [MS] Mangle return adjusting thunks with the public access specifier
MSVC does this, so we should too.

Fixes PR40138

llvm-svn: 350071
2018-12-26 20:07:52 +00:00
Rui Ueyama 56c5343e5a Use error() instead of fatal() to report an invalid address range.
In this patch we also use toString() to stringize a section.

llvm-svn: 350070
2018-12-26 19:15:04 +00:00
Justin Lebar 49fac56ea3 [NVPTX] Allow libcalls that are defined in the current module.
The patch adds a possibility to make library calls on NVPTX.

An important thing about library functions - they must be defined within
the current module. This basically should guarantee that we produce a
valid PTX assembly (without calls to not defined functions). The one who
wants to use the libcalls is probably will have to link against
compiler-rt or any other implementation.

Currently, it's completely impossible to make library calls because of
error LLVM ERROR: Cannot select: i32 = ExternalSymbol '...'. But we can
lower ExternalSymbol to TargetExternalSymbol and verify if the function
definition is available.

Also, there was an issue with a DAG during legalisation. When we expand
instruction into libcall, the inner call-chain isn't being "integrated"
into outer chain. Since the last "data-flow" (call retval load) node is
located in call-chain earlier than CALLSEQ_END node, the latter becomes
a leaf and therefore a dead node (and is being removed quite fast).
Proposed here solution relies on another data-flow pseudo nodes
(ProxyReg) which purpose is only to keep CALLSEQ_END at legalisation and
instruction selection phases - we remove the pseudo instructions before
register scheduling phase.

Patch by Denys Zariaiev!

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

llvm-svn: 350069
2018-12-26 19:12:31 +00:00
Reid Kleckner 423b65333d Ignore ConstantExpr in IgnoreParens
Summary:
This moves it up from IgnoreParenImpCasts to IgnoreParens, so that more
helpers ignore it. For most clients, this ensures that these helpers
behave the same with and without C++17 enabled, which is what appears to
introduce these new expression nodes.

Fixes PR39881

Reviewers: void, rsmith

Subscribers: cfe-commits

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

llvm-svn: 350068
2018-12-26 17:44:40 +00:00
Nico Weber 170a55b893 Pass a concrete triple for two OpenMP tests that depend on TLS
Not all %itanium_abi_triple values support TLS. Makes
OpenMP/declare_reduction_codegen.cpp, OpenMP/parallel_copyin_codegen.cpp for
%itanium_abi_triples without TLS support.

Alternatively we could pass -fnoopenmp-use-tls and tweak some of the CHECK
lines, but this seems a bit simpler.

Fixes PR40156.

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

llvm-svn: 350067
2018-12-26 16:06:26 +00:00
Simon Pilgrim a8ff77bb34 [AMDGPU] Regenerate i64 shift tests.
To show codegen diff due to a future SimplifyDemandedBits patch.

llvm-svn: 350065
2018-12-26 12:09:10 +00:00
Max Kazantsev 28298e9647 [NFC] Use utility function for guards detection
llvm-svn: 350064
2018-12-26 08:22:25 +00:00
Petar Avramovic 09dff33349 [MIPS GlobalISel] Select G_SELECT
Add widen scalar for type index 1 (i1 condition) for G_SELECT.
Select G_SELECT for pointer, s32(integer) and smaller low level
types on MIPS32.

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

llvm-svn: 350063
2018-12-25 14:42:30 +00:00
Max Kazantsev 9b25bf3960 [NFC] Reuse variables instead of re-calling getParent
llvm-svn: 350062
2018-12-25 07:20:06 +00:00
Kang Zhang d501a1e596 [PowerPC] Fix the bug of ISD::ADDE to set its second return type to glue
Summary:
This patch is to fix the bug imported by rL341634.
In above submit , the the return type of ISD::ADDE is 
14224: SDVTList VTs = DAG.getVTList(MVT::i64, MVT::i64), 
but in fact, the second return type of ISD::ADDE should be 
MVT::Glue not MVT::i64.

Reviewed By: hfinkel

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

llvm-svn: 350061
2018-12-25 03:29:51 +00:00
Nico Weber 495b9e0eb7 [gn build] Make NOSORT line actually work
GN wants the NOSORT line to be the first line of a comment block, not the last
line.

I sent https://gn-review.googlesource.com/c/gn/+/3560 to support having it in
the last line too, but since it will be a while until everyone has that change
even if it's expected, use the form that works today.

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

llvm-svn: 350060
2018-12-24 23:06:29 +00:00
Craig Topper 0229da8f07 [X86] Use GetDemandedBits to simplify the operands of PMULDQ/PMULUDQ.
This is an alternative to what I attempted in D56057.

GetDemandedBits is a special version of SimplifyDemandedBits that allows simplifications even when the operand has other uses. GetDemandedBits will only do simplifications that allow a node to be bypassed. It won't create new nodes or alter any of the other users.

I had to add support for bypassing SIGN_EXTEND_INREG to GetDemandedBits.

Based on a patch that Simon Pilgrim sent me in email.

Fixes PR40142.

llvm-svn: 350059
2018-12-24 19:40:20 +00:00
Craig Topper 6356ad940b [X86] Add test cases for PR40142. NFC
llvm-svn: 350058
2018-12-24 19:40:17 +00:00
George Karpenkov b945db8afc [analyzer] [NFC] Clean up the mess of constructing argument effects in RetainCountChecker
Previously, argument effects were stored in a method variable, which was
effectively global.
The global state was reset at each (hopefully) entrance point to the
summary construction,
and every function could modify it.

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

llvm-svn: 350057
2018-12-24 18:45:18 +00:00
Miklos Vajna 7fb1c2a6ca [clang-tidy] add IgnoreMacros option to readability-uppercase-literal-suffix
And also enable it by default to be consistent with e.g.
modernize-use-using.

This helps e.g. when running this check on client code where the macro
is provided by the system, so there is no easy way to modify it.

Reviewed By: JonasToth, lebedev.ri

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

llvm-svn: 350056
2018-12-24 17:47:32 +00:00
Eugene Leviant 4dc3a3f746 [HWASAN] Instrument memorty intrinsics by default
Differential revision: https://reviews.llvm.org/D55926

llvm-svn: 350055
2018-12-24 16:02:48 +00:00
Nico Weber ba9d5cf961 [gn build] Add build files for clang/tools/{c-arcmt-test,c-index-test} and their dependency clang/tools/libclang
libclang is somewhat incomplete. It's just enough to get check-clang to pass,
but that requires it to be pretty complete. The biggest thing is that it's not
built as a shared library on Linux. The libclang/BUILD.gn file has a comment
with details on what else is missing.

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

llvm-svn: 350054
2018-12-24 15:45:04 +00:00
Roman Lebedev 629d9804e3 ReleaseNotes: X86 Target: bdver2 sched model was added (D52779)
llvm-svn: 350053
2018-12-24 12:12:26 +00:00