Commit Graph

295723 Commits

Author SHA1 Message Date
Julie Hockett 8899c29b1e Reland "[clang-doc] Refactoring mapper to map by scope"
Relanding with a minor change to prevent an assertion on release bots.

The result of this adjusted mapper pass is that all Function and Enum
infos are absorbed into the info of their enclosing scope (i.e. the class
or namespace in which they are defined). Namespace and Record infos are
passed along to the final output, but the second pass creates a reference
to each in its parent scope. As a result, the top-level final outputs are
Namespaces and Records.

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

llvm-svn: 338763
2018-08-02 20:10:17 +00:00
George Burgess IV 31da130e4d [Support] Add an enable bit to our DebugCounters
r337748 made us start incrementing DebugCounters all of the time. This
makes tsan unhappy in multithreaded environments.

Since it doesn't make much sense to use DebugCounters with multiple
threads, this patch makes us only count anything if the user passed a
-debug-counter option or if some other piece of code explicitly asks
for it (e.g. the pass in D50031).

The amount of global state here makes writing a unittest for this
behavior somewhat awkward. So, no test is provided.

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

llvm-svn: 338762
2018-08-02 19:50:27 +00:00
Krzysztof Parzyszek dfd5fadcf2 Unbreak build after r338758: specify lambda return type explicitly
llvm-svn: 338760
2018-08-02 19:38:18 +00:00
Paul Robinson 96545db374 [DebugInfo/DWARF] Remove redundant iterator type. NFC
llvm-svn: 338759
2018-08-02 19:29:38 +00:00
Krzysztof Parzyszek 90f3249ce2 [SCEV] Properly solve quadratic equations
Differential Revision: https://reviews.llvm.org/D48283

llvm-svn: 338758
2018-08-02 19:13:35 +00:00
Jonathan Peyton 821649229e [OpenMP] Fix doacross testing for gcc
This patch adds a test using the doacross clauses in OpenMP and removes gcc from
testing kmp_doacross_check.c which is only testing the kmp rather than the
gomp interface.

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

llvm-svn: 338757
2018-08-02 19:13:07 +00:00
George Karpenkov 61ac05c57e [analyzer] Fix tests.
llvm-svn: 338756
2018-08-02 18:41:25 +00:00
Bob Haarman 112ebb687a [Support] [NFC] change comment about retries in createUniqueEntity
Rewording as requested on D50126 after the change was pushed.

llvm-svn: 338755
2018-08-02 18:27:21 +00:00
Matt Arsenault e3d81572c1 AMDGPU: Fix missing declaration of queue ptr builtin
llvm-svn: 338754
2018-08-02 18:24:55 +00:00
George Karpenkov 3cff19be36 [analyzer] Forward arguments in registerChecker to avoid accidental copies
Differential Revision: https://reviews.llvm.org/D50108

llvm-svn: 338753
2018-08-02 18:17:01 +00:00
Puyan Lotfi 97604b4f09 [NFC] clang-format cleanup of a couple files in llvm-objcopy.
llvm-svn: 338752
2018-08-02 18:16:52 +00:00
Tom Stellard 910f70238c CMake: Remove LLVM_DYLIB_SYMBOL_VERSIONING
Summary:
This option is no longer needed since r300496 added symbol
versioning by default

Reviewers: sylvestre.ledru, beanz, mgorny

Reviewed By: mgorny

Subscribers: llvm-commits

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

llvm-svn: 338751
2018-08-02 18:16:10 +00:00
Jordan Rupprecht 0f6d31812e [LLD] Update split stack support to handle more generic prologues. Improve error handling. Add test file for better code-coverage. Update tests to be more complete.
Submitting patch on behalf of saugustine.

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

llvm-svn: 338750
2018-08-02 18:13:40 +00:00
Martin Storsjo d03fa9903f Work around more GCC miscompiles exposed by r338464.
This is the same fix as in r338478, for another occurrance of the
same pattern from r338464.

See gcc.gnu.org/PR86769 for details of the bug.

llvm-svn: 338749
2018-08-02 18:12:08 +00:00
Julie Hockett a9cb2dd8b0 Revert "[clang-doc] Refactoring mapper to map by scope"
This reverts commit r338738 as it's breaking the bots.

llvm-svn: 338748
2018-08-02 18:01:37 +00:00
Erik Pilkington 90dc82e955 [itanium demangler] Support dot suffixes on block invocation functions
rdar://32378759

llvm-svn: 338747
2018-08-02 17:45:01 +00:00
Zachary Turner af3367d2ff Fix CMake build.
Some new files were committed to the repository but not added
to the CMakeLists.txt, so this patch fixes the build.

llvm-svn: 338746
2018-08-02 17:44:41 +00:00
Bob Haarman 9b36f51ae7 [Support] fix TempFile infinite loop and permission denied errors
Summary:
On Windows, TempFile::create() was prone to failing with permission
denied errors when a process created many tempfiles without providing
a model large enough to accommodate them. There was also a problem
with createUniqueEntity getting into an infinite loop when all names
permitted by the model are in use. This change fixes both of these
problems and adds a unit test for them.

Reviewers: pcc, rnk, zturner

Reviewed By: zturner

Subscribers: inglorion, hiraditya, llvm-commits

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

llvm-svn: 338745
2018-08-02 17:41:38 +00:00
Sam Clegg 41d7047de5 [WebAssembly] Ensure bitcasts that would result in invalid wasm are removed by FixFunctionBitcasts
Rather than allowing invalid bitcasts to be lowered to wasm
call instructions that won't validate, generate wrappers that
contain unreachable thereby delaying the error until runtime.

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

llvm-svn: 338744
2018-08-02 17:38:06 +00:00
JF Bastien b4b1f59869 __c11_atomic_load's _Atomic can be const
Summary:
C++11 onwards specs the non-member functions atomic_load and atomic_load_explicit as taking the atomic<T> by const (potentially volatile) pointer. C11, in its infinite wisdom, decided to drop the const, and C17 will fix this with DR459 (the current draft forgot to fix B.16, but that’s not the normative part).

clang’s lib/Headers/stdatomic.h implements these as #define to the __c11_* equivalent, which are builtins with custom typecheck. Fix the typecheck.

D47613 takes care of the libc++ side.

Discussion: http://lists.llvm.org/pipermail/cfe-dev/2018-May/058129.html

<rdar://problem/27426936>

Reviewers: rsmith

Subscribers: cfe-commits

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

llvm-svn: 338743
2018-08-02 17:35:46 +00:00
Zachary Turner ae67218989 Fix one more warning.
llvm-svn: 338742
2018-08-02 17:33:33 +00:00
Volodymyr Sapsai 7b16e8ad32 [c-index-test] Use correct executable path to discover resource directory.
Driver builds resource directory path based on provided executable path.
Instead of string "clang" use actual executable path.

rdar://problem/42699514

Reviewers: nathawes, akyrtzi, bob.wilson

Reviewed By: akyrtzi

Subscribers: dexonsmith, cfe-commits

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

llvm-svn: 338741
2018-08-02 17:29:53 +00:00
Zachary Turner bd45adb50f Update the LLVM VS integration to sign the assembly.
llvm-svn: 338740
2018-08-02 17:20:31 +00:00
Zachary Turner 5b0456d0ce Fix a couple of warnings.
llvm-svn: 338739
2018-08-02 17:18:01 +00:00
Julie Hockett 1f430693b1 [clang-doc] Refactoring mapper to map by scope
The result of this adjusted mapper pass is that all Function and Enum
infos are absorbed into the info of their enclosing scope (i.e. the
class or namespace in which they are defined). Namespace and Record
infos are passed along to the final output, but the second pass creates
a reference to each in its parent scope. As a result, the top-level final
outputs are Namespaces and Records.

llvm-svn: 338738
2018-08-02 17:17:19 +00:00
Zachary Turner 7563ebe391 Use %.*s instead of %*s when formatting strings with explicit length.
llvm-svn: 338737
2018-08-02 17:08:24 +00:00
Zachary Turner 172aea10fa [MS Demangler] Resolve back-references lazily.
We need to both record and resolve back-references lazily due to
not being able to know until a demangling is complete whether or
not a name should go into the back-reference table..  This patch
implements lazy resolution of back-references, but we still have
eager recording of back-references.  This will be fixed in a
subsequent patch.

llvm-svn: 338736
2018-08-02 17:08:03 +00:00
Craig Topper 0423881820 [X86] Allow fake unary unpckhpd and movhlps to be commuted for execution domain fixing purposes
These instructions perform the same operation, but the semantic of which operand is destroyed is reversed. If the same register is used as both operands we can change the execution domain without worrying about this difference.

Unfortunately, this really only works in cases where the input register is killed by the instruction. If its not killed, the two address isntruction pass inserts a copy that will become a move instruction. This makes the instruction use different physical registers that contain the same data at the time the unpck/movhlps executes. I've considered using a unary pseudo instruction with tied operand to trick the two address instruction pass. We could then expand the pseudo post regalloc to get the same physical register on both inputs.

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

llvm-svn: 338735
2018-08-02 16:48:01 +00:00
Greg Clayton 2d953f22a0 Add support for ARM and ARM64 breakpad generated minidump files
In this patch I add support for ARM and ARM64 break pad files. There are two flavors of ARM: Apple where FP is R7, and non Apple where FP is R11. Added minimal tests that load up ARM64 and the two flavors or ARM core files with a single thread and known register values in each register. Each register is checked for the exact value.

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

llvm-svn: 338734
2018-08-02 16:46:15 +00:00
Raphael Isemann 92b16738a1 Add byte counting mechanism to LLDB's Stream class.
Summary:
This patch allows LLDB's Stream class to count the bytes it has written to so far.

There are two major motivations for this patch:

The first one is that this will allow us to get rid of all the handwritten byte counting code
we have in LLDB so far. Examples for this are pretty much all functions in LLDB that
take a Stream to write to and return a size_t, which usually represents the bytes written.

By moving to this centralized byte counting mechanism, we hopefully can avoid some
tricky errors that happen when some code forgets to count the written bytes while
writing something to a stream.

The second motivation is that this is needed for the migration away from LLDB's `Stream`
and towards LLVM's `raw_ostream`. My current plan is to start offering a fake raw_ostream
class that just forwards to a LLDB Stream.

However, for this raw_ostream wrapper we need to fulfill the raw_ostream interface with
LLDB's Stream, which currently lacks the ability to count the bytes written so far (which
raw_ostream exposes by it's `tell()` method). By adding this functionality it is trivial to start
rolling out our raw_ostream wrapper (and then eventually completely move to raw_ostream).

Also, once this fake raw_ostream is available, we can start replacing our own code writing
to LLDB's Stream by LLVM code writing to raw_ostream. The best example for this is the
LEB128 encoding we currently ship, which can be replaced with by LLVM's version which
accepts an raw_ostream.

From the point of view of the pure source changes this test does, we essentially just renamed
the Write implementation in Stream to `WriteImpl` while the `Write` method everyone is using
to write its raw bytes is now just forwarding and counting the written bytes.

Reviewers: labath, davide

Reviewed By: labath

Subscribers: JDevlieghere, lldb-commits

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

llvm-svn: 338733
2018-08-02 16:38:34 +00:00
Fangrui Song 98768e40fe [analyzer] Make RegionVector use const reference
llvm-svn: 338732
2018-08-02 16:29:36 +00:00
Evandro Menezes 84e74362c1 [SLC] Refactor simplification of pow() (NFC)
llvm-svn: 338730
2018-08-02 15:43:57 +00:00
Simon Pilgrim ef494e1722 [X86][SSE] Add uniform/non-uniform exact sdiv vector tests covering all paths
Regenerated tests and tested on 64-bit (AVX2) as well.

llvm-svn: 338729
2018-08-02 15:34:51 +00:00
David Bolvansky 67647bcfbe [InstCombine] [NFC] Tests for select with binop fold
llvm-svn: 338727
2018-08-02 14:59:23 +00:00
George Rimar 300d363dfd [LLD][ELF] - Remove dead check from adjustSplitStackFunctionPrologues().
In according to the comment, undefined symbol should never reach there.
So, should be able to remove the check. I am assuming this is NFC. 

llvm-svn: 338723
2018-08-02 14:44:39 +00:00
George Rimar 47ec1e07c7 [LLD][ELF] - An attemp to fix BB after rL338718.
BB is unhappy :`-(
http://lab.llvm.org:8011/builders/lld-perf-testsuite/builds/5632

llvm-svn: 338722
2018-08-02 14:34:39 +00:00
Jonas Hahnfeld ef8f737288 [OMPT] Disable by default on Windows
This is broken per PR36561 and PR36574, so disable it for now until
somebody interested can take a look. OMPT can still be activated manually
by passing -DLIBOMP_OMPT_SUPPORT=ON during configuration.

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

llvm-svn: 338721
2018-08-02 14:34:08 +00:00
Jonas Hahnfeld 5b57eb4b09 [tests] Add annotations for taskloop features
Only supported since GCC 6 and Intel 17.0. However GCC 6.3.0 is
crashing on two of the tests, so disable them as well...

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

llvm-svn: 338720
2018-08-02 14:34:03 +00:00
Sanjay Patel 3f6e9a71f7 [InstSimplify] move minnum/maxnum with undef fold from instcombine
llvm-svn: 338719
2018-08-02 14:33:40 +00:00
George Rimar a7dbe571e6 [LLD][ELF] - Remove excessive cases from getRelocTargetVA(). NFC.
There is no point to explicitly proccess the expressions this patch removes.
We already have a llvm_unreachable for the default case.

llvm-svn: 338718
2018-08-02 14:15:02 +00:00
Sjoerd Meijer 8e7fab0443 [ARM][NFC] Follow up of r338568
I disabled more tests than necessary, this enables them.

llvm-svn: 338717
2018-08-02 14:04:48 +00:00
Sanjay Patel f9a0d593e9 [ValueTracking] fix maxnum miscompile for cannotBeOrderedLessThanZero (PR37776)
This adds the NAN checks suggested in PR37776:
https://bugs.llvm.org/show_bug.cgi?id=37776

If both operands to maxnum are NAN, that should get constant folded, so we don't 
have to handle that case. This is the same assumption as other FP ops in this
function. Returning 'false' is always conservatively correct.

Copying from the bug report:

Currently, we have this for "when is cannotBeOrderedLessThanZero 
(mustBePositiveOrNaN) true for maxnum":
               L
        -------------------
        | Pos | Neg | NaN |
   ------------------------
   |Pos |  x  |  x  |  x  |
   ------------------------
 R |Neg |  x  |     |  x  |
   ------------------------
   |NaN |  x  |  x  |  x  |
   ------------------------


The cases with (Neg & NaN) are wrong. We should have:

                L
        -------------------
        | Pos | Neg | NaN |
   ------------------------
   |Pos |  x  |  x  |  x  |
   ------------------------
 R |Neg |  x  |     |     |
   ------------------------
   |NaN |  x  |     |  x  |
   ------------------------

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

llvm-svn: 338716
2018-08-02 13:46:20 +00:00
Matt Arsenault 1f3977a856 DAG: Fix vector widening fcanonicalize
llvm-svn: 338715
2018-08-02 13:43:53 +00:00
Matt Arsenault 36cdcfadcf AMDGPU: Fix scalarizing v4f16 fcanonicalize
llvm-svn: 338714
2018-08-02 13:43:42 +00:00
George Rimar 467505bd31 [LLD][ELF] - Remove dead code. NFC.
It does not seem that this code is alive.
I seems was needed previously but we fixed it.

If it is still needed, it needs new tests,
but for now I do not know how to trigger it,
and so I removed it.

llvm-svn: 338713
2018-08-02 13:18:49 +00:00
Tim Northover ccb06e720d Move ClangHighlighter.cpp to hopefully better place in Xcode project.
But with a write-only format, who can really say?

llvm-svn: 338712
2018-08-02 12:50:23 +00:00
Ben Dunbobbin d498dcdbbf [llvm-ar] Fix help text test. NFC.
Missed from @338703

llvm-svn: 338709
2018-08-02 12:27:01 +00:00
George Rimar 830ff2d0b1 [LLD][ELF] - Remove redundant code. NFC.
Code was never executed with our test cases,
though it is valid and I think we can always run it.
This improves code coverage.

llvm-svn: 338708
2018-08-02 12:20:36 +00:00
Matt Arsenault c65f966d76 Try to make builtin address space declarations not useless
The way address space declarations for builtins currently work
is nearly useless. The code assumes the address spaces used for
builtins is a confusingly named "target address space" from user
code using __attribute__((address_space(N))) that matches
the builtin declaration. There's no way to use this to declare
a builtin that returns a language specific address space.
The terminology used is highly cofusing since it has nothing
to do with the the address space selected by the target to use
for a language address space.

This feature is essentially unused as-is. AMDGPU and NVPTX
are the only in-tree targets attempting to use this. The AMDGPU
builtins certainly do not behave as intended (i.e. all of the
builtins returning pointers can never compile because the numbered
address space never matches the expected named address space).

The NVPTX builtins are missing tests for some, and the others
seem to rely on an implicit addrspacecast.

Change the used address space for builtins based on a target
hook to allow using a language address space for a builtin.
This allows the same builtin declaration to be used for multiple
languages with similarly purposed address spaces (e.g. the same
AMDGPU builtin can be used in OpenCL and CUDA even though the
constant address spaces are arbitarily different).

This breaks the possibility of using arbitrary numbered
address spaces alongside the named address spaces for builtins.
If this is an issue we probably need to introduce another builtin
declaration character to distinguish language address spaces from
so-called "target address spaces".

llvm-svn: 338707
2018-08-02 12:14:28 +00:00
Martin Probst 9d7178139c clang-format: fix a crash in comment wraps.
Summary:
Previously, clang-format would crash if it tried to wrap an overlong
single line comment, because two parts of the code inserted a break in
the same location.

    /** heregoesalongcommentwithnospace */

This wasn't previously noticed as it could only trigger for an overlong
single line comment that did have no breaking opportunities except for a
whitespace at the very beginning.

This also introduces a check for JavaScript to not ever wrap a comment
before an opening curly brace:

    /** @mods {donotbreakbeforethecurly} */

This is because some machinery parsing these tags sometimes supports
breaks before a possible `{`, but in some other cases does not.
Previously clang-format was careful never to wrap a line with certain
tags on it. The better solution is to specifically disable wrapping
before the problematic token: this allows wrapping and aligning comments
but still avoids the problem.

Reviewers: krasimir

Subscribers: cfe-commits

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

llvm-svn: 338706
2018-08-02 11:52:08 +00:00