4592 Commits

Author SHA1 Message Date
Simon Atanasyan
acd4380df9 [mips] Add support MIPS r6 Debian triples
Debian uses different triples for MIPS r6 and paths. Here we use SubArch
to determine whether it is r6, if we found `r6' in CPU section of triple.

These new triples include:
  mipsisa32r6-linux-gnu
  mipsisa32r6el-linux-gnu
  mipsisa64r6-linux-gnuabi64
  mipsisa64r6el-linux-gnuabi64
  mipsisa64r6-linux-gnuabin32
  mipsisa64r6el-linux-gnuabin32

Patch by YunQiang Su.

Differential revision: https://reviews.llvm.org/D50857

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343185 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-27 08:51:18 +00:00
Fangrui Song
3b35e17b21 llvm::sort(C.begin(), C.end(), ...) -> llvm::sort(C, ...)
Summary: The convenience wrapper in STLExtras is available since rL342102.

Reviewers: dblaikie, javed.absar, JDevlieghere, andreadb

Subscribers: MatzeB, sanjoy, arsenm, dschuff, mehdi_amini, sdardis, nemanjai, jvesely, nhaehnle, sbc100, jgravelle-google, eraman, aheejin, kbarton, JDevlieghere, javed.absar, gbedwell, jrtc27, mgrang, atanasyan, steven_wu, george.burgess.iv, dexonsmith, kristina, jsji, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343163 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-27 02:13:45 +00:00
Oliver Stannard
ecc449e514 [ARM/AArch64][v8.5A] Add Armv8.5-A target
This patch allows targeting Armv8.5-A, adding the architecture to
tablegen and setting the options to be identical to Armv8.4-A for the
time being. Subsequent patches will add support for the different
features included in the Armv8.5-A Reference Manual.

Patch by Pablo Barrio!

Differential revision: https://reviews.llvm.org/D52470



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343102 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-26 12:48:21 +00:00
Craig Topper
03728047a1 [X86] Infer 64bit feature support from the CPUID results in getHostCPUFeatures.
After r341022, we more strictly check the 64bit feature in X86Subtargets constructor when a 64-bit triple is used. If we don't infer this feature for autodetected CPUs we might incorrectly report an error if the CPU name wasn't autodetected to a CPU that supports 64-bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342914 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-24 18:55:41 +00:00
Nico Weber
cb24b2be15 Remove dead function user_cache_directory()
It's been unused since it was added almost 3 years ago in
https://reviews.llvm.org/D13801

Motivated by https://reviews.llvm.org/rL342002 since it removes one of the
functions keeping a ref to SHGetKnownFolderPath.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342485 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-18 15:06:16 +00:00
Simon Atanasyan
b34d98d917 [mips] Fix MIPS N32 ABI triples support
Add support mips64(el)-linux-gnuabin32 triples, and set them to N32.
Debian architecture name mipsn32/mipsn32el are also added. Set
UseIntegratedAssembler for N32 if we can detect it.

Patch by YunQiang Su.

Differential revision: https://reviews.llvm.org/D51408

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342416 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-17 21:21:57 +00:00
Adrian Prantl
6764b4552f fix typos
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342241 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-14 16:12:14 +00:00
Martin Storsjo
54e576d282 [Support] Treat null bytes as separator in windows command line strings
When reading directives from a .drectve section, the directives are
tokenized as a normal windows command line. However in these cases,
link.exe allows the directives to be separated by null bytes, not only by
spaces.

A test case for this change will be added in the lld repo.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342204 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-14 06:08:01 +00:00
Richard Smith
9d93ec6c77 Common infrastructure for reading a profile remapping file and building
a mangling remapper from it.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342161 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-13 18:51:44 +00:00
Kristina Brooks
90f4ccc2c5 [Support] sys::fs::directory_entry includes the file_type.
This is available on most platforms (Linux/Mac/Win/BSD) with no extra syscalls.
On other platforms (e.g. Solaris) we stat() if this information is requested.

This will allow switching clang's VFS to efficiently expose (path, type) when
traversing a directory. Currently it exposes an entire Status, but does so by
calling fs::status() on all platforms.
Almost all callers only need the path, and all callers only need (path, type).

Patch by sammccall (Sam McCall)

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342089 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-12 22:08:10 +00:00
Konstantin Zhuravlyov
4d82ce5c27 AMDGPU: Re-apply r341982 after fixing the layering issue
Move isa version determination into TargetParser.

Also switch away from target features to CPU string when
determining isa version. This fixes an issue when we
output wrong isa version in the object code when features
of a particular CPU are altered (i.e. gfx902 w/o xnack
used to result in gfx900).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342069 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-12 18:50:47 +00:00
Ilya Biryukov
867f48781f Revert "AMDGPU: Move isa version and EF_AMDGPU_MACH_* determination into TargetParser."
This reverts commit r341982.

The change introduced a layering violation. Reverting to unbreak
our integrate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342023 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-12 07:05:30 +00:00
Reid Kleckner
148f823e48 [cmake] Speed up check-llvm 5x by delay loading shell32 and ole32
Summary:
Previously, check-llvm on my Windows 10 workstation took about 300s to
run, and it would lock up my mouse. Now, it takes just under 60s.
Previously running the tests only used about 15% of the available CPU
time, now it uses up to 60%.

Shell32.dll and ole32.dll have direct dependencies on user32.dll and
gdi32.dll. These DLLs are mostly used to for Windows GUI functionality,
which most LLVM tools don't need. It seems that these DLLs acquire and
release some system resources on startup and exit, and that requires
acquiring the same highly contended lock discussed in this post:
https://randomascii.wordpress.com/2017/07/09/24-core-cpu-and-i-cant-move-my-mouse/

Most LLVM tools still have a transitive dependency on
SHGetKnownFolderPathW, which is used to look up the user home directory
and local AppData directory. We also use SHFileOperationW to recursively
delete a directory, but only LLDB and clang-doc use this today. At some
point, we might consider removing these last shell32.dll deps, but for
now, I would like to take this free performance.

Many thanks to Bruce Dawson for suggesting this fix. He looked at an ETW
trace of an LLVM test run, noticed these DLLs, and suggested avoiding
them.

Reviewers: zturner, pcc, thakis

Subscribers: mgorny, llvm-commits, hiraditya

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342002 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-11 22:25:13 +00:00
Reid Kleckner
e207c27bf5 [Support] Quote arguments containing \n on Windows
Fixes at_file.c test failure caused by r341988. We may want to change
how we treat \n in our tokenizer, but this is probably a good fix
regardless, since we can invoke all kinds of programs with different
interpretations of the command line quoting rules.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341992 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-11 21:02:03 +00:00
Reid Kleckner
547c92f475 [Support] Avoid calling CommandLineToArgvW from shell32.dll
Summary:
Shell32.dll depends on gdi32.dll and user32.dll, which are mostly DLLs
for Windows GUI functionality. LLVM's utilities don't typically need GUI
functionality, and loading these DLLs seems to be slowing down startup.
Also, we already have an implementation of Windows command line
tokenization in cl::TokenizeWindowsCommandLine, so we can just use it.

The goal is to get the original argv in UTF-8, so that it can pass
through most LLVM string APIs. A Windows process starts life with a
UTF-16 string for its command line, and it can be retreived with
GetCommandLineW from kernel32.dll.

Previously, we would:
1. Get the wide command line
2. Call CommandLineToArgvW to handle quoting rules and separate it into
   arguments.
3. For each wide argument, expand wildcards (* and ?) using
   FindFirstFileW.
4. Convert each argument to UTF-8

Now we:
1. Get the wide command line, convert the whole thing to UTF-8
2. Tokenize the UTF-8 command line with cl::TokenizeWindowsCommandLine
3. For each argument, expand wildcards if present
   - This requires converting back to UTF-16 to call FindFirstFileW
   - Results of FindFirstFileW must be converted back to UTF-8

Reviewers: zturner

Subscribers: hiraditya, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341988 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-11 20:22:39 +00:00
Konstantin Zhuravlyov
b479681381 AMDGPU: Move isa version and EF_AMDGPU_MACH_* determination
into TargetParser.

Also switch away from target features to CPU string when
determining isa version. This fixes an issue when we
output wrong isa version in the object code when features
of a particular CPU are altered (i.e. gfx902 w/o xnack
used to result in gfx900).

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341982 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-11 18:56:51 +00:00
JF Bastien
7dcaeafd0b ADT: add <bit> header, implement C++20 bit_cast, use
Summary: I saw a few places that were punning through a union of FP and integer, and that made me sad. Luckily, C++20 adds bit_cast for exactly that purpose. Implement our own version in ADT (without constexpr, leaving us a bit sad), and use it in the few places my grep-fu found silly union punning.

This was originally committed as r341728 and reverted in r341730.

Reviewers: javed.absar, steven_wu, srhines

Subscribers: dexonsmith, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341741 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-08 03:55:25 +00:00
JF Bastien
5dc5797dce Revert "ADT: add <bit> header, implement C++20 bit_cast, use"
Bots sad. Looks like missing std::is_trivially_copyable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341730 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-07 23:23:47 +00:00
JF Bastien
265ce994cb ADT: add <bit> header, implement C++20 bit_cast, use
Summary: I saw a few places that were punning through a union of FP and integer, and that made me sad. Luckily, C++20 adds bit_cast for exactly that purpose. Implement our own version in ADT (without constexpr, leaving us a bit sad), and use it in the few places my grep-fu found silly union punning.

Reviewers: javed.absar

Subscribers: dexonsmith, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341728 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-07 23:08:26 +00:00
Reid Kleckner
dc281ceff8 [Windows] Convert from UTF-8 to UTF-16 when writing to a Windows console
Summary:
Calling WriteConsoleW is the most reliable way to print Unicode
characters to a Windows console.

If binary data gets printed to the console, attempting to re-encode it
shouldn't be a problem, since garbage in can produce garbage out.

This breaks printing strings in the local codepage, which WriteConsoleA
knows how to handle. For example, this can happen when user source code
is encoded with the local codepage, and an LLVM tool quotes it while
emitting a caret diagnostic. This is unfortunate, but well-behaved tools
should validate that their input is UTF-8 and escape non-UTF-8
characters before sending them to raw_fd_ostream. Clang already does
this, but not all LLVM tools do this.

One drawback to the current implementation is printing a string a byte
at a time doesn't work. Consider this LLVM code:
  for (char C : MyStr) outs() << C;

Because outs() is now unbuffered, we wil try to convert each byte to
UTF-16, which will fail. However, this already didn't work, so I think
we may as well update callers that do that as we find them to print
complete portions of strings. You can see a real example of this in my
patch to SourceMgr.cpp

Fixes PR38669 and PR36267.

Reviewers: zturner, efriedma

Subscribers: llvm-commits, hiraditya

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341433 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-05 00:08:56 +00:00
David Bolvansky
810335c3b5 Set console mode when -fansi-escape-codes is enabled
Summary:
Windows console now supports supports ANSI escape codes, but we need to enable it using SetConsoleMode with ENABLE_VIRTUAL_TERMINAL_PROCESSING flag.

Fixes https://bugs.llvm.org/show_bug.cgi?id=38817


Tested on Windows 10, screenshot:
https://i.imgur.com/bqYq0Uy.png

Reviewers: zturner, chandlerc

Reviewed By: zturner

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341396 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-04 19:23:05 +00:00
Kristina Brooks
81a94dc637 Do not leak the Mach host port in sys::getHostCPUName()
Patch by rsesek (Robert Sesek)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341357 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-04 10:54:09 +00:00
Alexandre Ganea
0444f57668 [DebugInfo] Common behavior for error types
Following D50807, and heading towards D50664, this intermediary change does the following:

1. Upgrade all custom Error types in llvm/trunk/lib/DebugInfo/ to use the new StringError behavior (D50807).
2. Implement std::is_error_code_enum and make_error_code() for DebugInfo error enumerations.
3. Rename GenericError -> PDBError (the file will be renamed in a subsequent commit)
4. Update custom error messages to follow the same formatting: (\w\s*)+\.
5. Keep generic "file not found" (ENOENT) errors as they are in PDB code. Previously, there used to be a custom enumeration for that purpose.
6. Remove a few extraneous LF in log() implementations. Printing LF is a responsability at a higher level, not at the error level.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341228 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-31 17:41:58 +00:00
Tim Northover
be4b3b1eba Hashing: use 64-bit seed for hashing on all platforms.
get_execution_seed returns a size_t which varies across platforms, but its
users actually always feed it into a uint64_t role so it makes sense to be
consistent.

Mostly this is just a tidy-up, but it also apparently allows PCH files to be
shared between Clang compilers built for 32-bit and 64-bit hosts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341113 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-30 20:28:32 +00:00
Alexandre Ganea
0993f24765 [Error] Add FileError helper; upgrade StringError behavior
FileError is meant to encapsulate both an Error and a file name/path. It should be used in cases where an Error occurs deep down the call chain, and we want to return it to the caller along with the file name.

StringError was updated to display the error messages in different ways. These can be:

1. display the error_code message, and convert to the same error_code (ECError behavior)
2. display an arbitrary string, and convert to a provided error_code (current StringError behavior)
3. display both an error_code message and a string, in this order; and convert to the same error_code

These behaviors can be triggered depending on the constructor. The goal is to use StringError as a base class, when a library needs to provide a explicit Error type.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341064 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-30 13:10:42 +00:00
Peter Collingbourne
acf390b1ed Start reserving x18 by default on Android targets.
Differential Revision: https://reviews.llvm.org/D45588

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340889 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-29 01:38:47 +00:00
Hans Wennborg
601e525007 Use a lambda for calls to ::open in RetryAfterSignal
In Bionic, open can be overloaded for _FORTIFY_SOURCE support, causing
compile errors of RetryAfterSignal due to overload resolution. Wrapping
the call in a lambda avoids this.

Based on a patch by Chih-Wei Huang <cwhuang@linux.org.tw>!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340751 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-27 15:55:39 +00:00
Chandler Carruth
8c9f47fdf1 Avoid specializing a variadic member template in a way that seems to not
agree with MSVC.

There isn't actually a need for specialization here as we can write the
code generically and just have a test that will fold away as a constant.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340700 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-26 09:17:49 +00:00
Simon Pilgrim
ad6c4284cd Remove superfluous semicolon. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340686 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-25 16:49:35 +00:00
Eric Christopher
19181fbcf2 This patch adds support to LLVM for writing HermitCore (https://hermitcore.org) ELF binaries.
HermitCore is a POSIX-compatible kernel for running a single application in an isolated environment to get maximum performance and predictable runtime behavior. It can either be used bare-metal on hardware or a VM (Unikernel) or side by side to an existing Linux system (Multikernel).
Due to the latter feature, HermitCore binaries are marked with ELFOSABI_STANDALONE to let the Linux ELF loader distinguish them from regular Unix/Linux binaries and load them using the HermitCore "proxy" tool.

Patch by Colin Finck!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340675 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-25 01:08:18 +00:00
Richard Smith
fc721a89bb Allow demangler's node allocator to fail, and bail out of the entire
demangling process when it does.

Use this to support a "lookup" query for the mangling canonicalizer that
does not create new nodes. This could also be used to implement
demangling with a fixed-size temporary storage buffer.

Reviewers: erik.pilkington

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340670 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-24 23:26:05 +00:00
Richard Smith
a5beadf824 Add data structure to form equivalence classes of mangled names.
Summary:
Given a set of equivalent name fragments, this mechanism determines whether two
mangled names are equivalent. The intent is to use this for fuzzy matching of
profile data against the program after certain refactorings are performed.

Reviewers: erik.pilkington, dlj

Subscribers: mgorny, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340663 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-24 22:31:51 +00:00
Martin Storsjo
5cd279703c [Support] Allow discarding a FileOutputBuffer without removing the memory mapping
Differential Revision: https://reviews.llvm.org/D51095

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340634 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-24 18:36:22 +00:00
Reid Kleckner
db0f76949f Make LLVM_ENABLE_CRASH_DUMPS set a variable default
That way users can set the default to true, but then disable core dumps
from certain apps that link support.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340588 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-23 22:58:56 +00:00
Douglas Yung
65dbe3021d Fixup AreCoreFilesPrevented() to consider first LLVM_ENABLE_CRASH_DUMPS and secondly coreFilesPrevented.
The previous change ignored the latter resulting in crash dumps being generated when LLVM_ENABLE_CRASH_DUMPS was
set, but coreFilesPrevented was true.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340561 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-23 18:20:13 +00:00
Sven van Haastregt
8d709d9d43 [Support] Fix some Wundef warnings
For the _WIN32 macro, it is the definedness that matters rather than
the value.  Most uses of the macro already rely on the definedness.
This commit fixes the few remaining uses that relied on the value.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340520 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-23 09:42:58 +00:00
JF Bastien
33aee6f125 Improve incompatible triple error
When complaining that the triple is incompatible with all targets, print out the triple not just a generic error about triples not matching.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340509 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-23 03:40:31 +00:00
Bob Haarman
b10c5f9f68 [Support][CachePruning] prune least recently accessed files first
Summary:
Before this change, pruning order was based on size. This changes it
to be based on time of last use instead, preferring to keep recently
used files and prune older ones.

Reviewers: pcc, rnk, espindola

Reviewed By: rnk

Subscribers: emaste, arichardson, hiraditya, steven_wu, dexonsmith, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340374 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-22 00:52:16 +00:00
Matt Arsenault
6b2c78bfb0 Try to fix bot build failure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340296 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-21 16:24:56 +00:00
Matt Arsenault
60b9afadc6 AMDGPU: Partially move target handling code from clang to TargetParser
A future change in clang necessitates access of this information
from the driver, so move this into a common place.

Try to mimic something resembling the API the other targets are
using here.

One thing I'm uncertain about is how to split amdgcn and r600
handling. Here I've mostly duplicated the functions for each,
while keeping the same enums. I think this is a bit awkward
for the features which don't matter for amdgcn.

It's also a bit messy that this isn't a complete set of
subtarget features. This is just the minimum set needed
for the driver code. For example building the list of
subtarget feature names is still in clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340291 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-21 16:13:01 +00:00
Reid Kleckner
7e4b0fae2e Add cmake option to disable minidumps, default it to off
Since crash dumping landed in r268519, May 2016, I have not once seen
anyone use an uploaded minidump to debug a compiler crash. Therefore,
I'm turning this off by default. The dumps clutter up user and buildbot
temp directories. Each file is only about 56KB, but it adds up.

In the context of clang, the extra line about the minidump confuses
users, when what we really want from them is the pre-processed source
code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340185 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-20 16:49:54 +00:00
Haojian Wu
ce61d9b983 Fix an undefined behavior when storing an empty StringRef.
Summary: Passing a nullptr to memcpy is UB.

Reviewers: ioeric

Subscribers: llvm-commits, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340170 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-20 13:12:54 +00:00
George Burgess IV
68cedc8ad5 [DebugCounters] don't do redundant map lookups; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340104 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-17 22:34:04 +00:00
Bernard Ogden
c30814805c [ARM/AArch64] Support FP16 +fp16fml instructions
Add +fp16fml feature for new FP16 instructions, which are a
mandatory part of FP16 from v8.4-A and an optional part of FP16
from v8.2-A. It doesn't seem to be possible to model this in
LLVM, but the relationship between the options is handled by
the related clang patch.

In keeping with what I think is the usual practice, the fp16fml
extension is accepted regardless of base architecture version.

Builds on/replaces Sjoerd Meijer's patch to add these instructions at
https://reviews.llvm.org/D49839.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340013 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-17 11:29:49 +00:00
Graydon Hoare
7de28914d7 [Support] Add a public API to allow clearing all (static) timer groups.
Summary:
Formerly, all timer groups were automatically cleared when printed out. In
https://reviews.llvm.org/rL324788 this behaviour was changed to not-clearing
timers on printout, to allow printing timers more than once, but as a result
clients (specifically Swift) that relied on the clear-on-print behaviour to
inhibit duplicate timer printing on shutdown were broken.

Rather than revert that change, this change adds a new API that enables
clients that _want_ to clear all timers to do so explicitly.

Reviewers: george.karpenkov, thegameg

Reviewed By: george.karpenkov

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339980 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-17 04:13:19 +00:00
Simon Pilgrim
547d94c020 [ADT] Replace APInt::WORD_MAX with APInt::WORDTYPE_MAX
The windows SDK defines WORD_MAX, so any poor soul that wants to use LLVM in a project that depends on the windows SDK gets a build error.

Given that it actually describes the maximal value of WordType, it actually fits even better than WORD_MAX

Patch by: @miscco

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339863 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-16 11:08:23 +00:00
Lang Hames
e0dc5c1ea2 [Support] Add a basic C API for llvm::Error.
Summary:
The C-API supports consuming errors, converting an error to a string error
message, and querying an error's type. Other LLVM C APIs that wish to use
llvm::Error can supply error-type-id checkers and custom
error-to-structured-type converters for any custom errors they provide.

Reviewers: bogner, zturner, labath, dblaikie

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339802 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-15 18:42:11 +00:00
Jordan Rupprecht
f0b29b88a4 [Support] NFC: Allow modifying access/modification times independently in sys::fs::setLastModificationAndAccessTime.
Summary:
Add an overload to sys::fs::setLastModificationAndAccessTime that allows setting last access and modification times separately. This will allow tools to use this API when they want to preserve both the access and modification times from an input file, which may be different.

Also note that both the POSIX (futimens/futimes) and Windows (SetFileTime) APIs take the two timestamps in the order of (1) access (2) modification time, so this renames the method to "setLastAccessAndModificationTime" to make it clear which timestamp is which.

For existing callers, the 1-arg overload just sets both timestamps to the same thing.

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339628 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-13 23:03:45 +00:00
Petr Hosek
85ffa199e1 [ADT] Normalize empty triple components
LLVM triple normalization is handling "unknown" and empty components
differently; for example given "x86_64-unknown-linux-gnu" and
"x86_64-linux-gnu" which should be equivalent, triple normalization
returns "x86_64-unknown-linux-gnu" and "x86_64--linux-gnu". autoconf's
config.sub returns "x86_64-unknown-linux-gnu" for both
"x86_64-linux-gnu" and "x86_64-unknown-linux-gnu". This changes the
triple normalization to behave the same way, replacing empty triple
components with "unknown".

This addresses PR37129.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339294 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-08 22:23:57 +00:00
Aditya Nandakumar
5718b6f1bc Refactor FileCheck to make it usable as an API
https://reviews.llvm.org/D50283
reviewed by bogner

This patch refactors FileCheck's implementation into support so it can
be used from C++ in other places (Unit tests).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339192 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-07 21:58:49 +00:00