1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00
Commit Graph

1481 Commits

Author SHA1 Message Date
Luke Geeson
d2668753df [ARM] Add Cortex-A78 and Cortex-X1 Support for Clang and LLVM
This patch upstreams support for the Arm-v8 Cortex-A78 and Cortex-X1
processors for AArch64 and ARM.

In detail:
- Adding cortex-a78 and cortex-x1 as cpu options for aarch64 and arm targets in clang
- Adding Cortex-A78 and Cortex-X1 CPU names and ProcessorModels in llvm

details of the CPU can be found here:
https://www.arm.com/products/cortex-x

https://www.arm.com/products/silicon-ip-cpu/cortex-a/cortex-a78

The following people contributed to this patch:
- Luke Geeson
- Mikhail Maltsev

Reviewers: t.p.northover, dmgreen

Reviewed By: dmgreen

Subscribers: dmgreen, kristof.beyls, hiraditya, danielkiss, cfe-commits,
llvm-commits, miyuki

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D83206
2020-07-10 18:24:11 +01:00
Dmitry Polukhin
b364785790 [yaml][clang-tidy] Fix multiline YAML serialization
Summary:
New line duplication logic introduced in https://reviews.llvm.org/D63482
has two issues: (1) there is no logic that removes duplicate newlines
when clang-apply-replacment reads YAML and (2) in general such logic
should be applied to all strings and should happen on string
serialization level instead in YAML parser.

This diff changes multiline strings quotation from single quote `'` to
double `"`. It solves problems with internal newlines because now they are
escaped. Also double quotation solves the problem with leading whitespace after
newline. In case of single quotation YAML parsers should remove leading
whitespace according to specification. In case of double quotation these
leading are internal space and they are preserved. There is no way to
instruct YAML parsers to preserve leading whitespaces after newline so
double quotation is the only viable option that solves all problems at
once.

Test Plan: check-all

Reviewers: gribozavr, mgehre, yvvan

Subscribers: xazax.hun, hiraditya, cfe-commits, llvm-commits

Tags: #clang-tools-extra, #clang, #llvm

Differential Revision: https://reviews.llvm.org/D80301
2020-07-09 02:41:58 -07:00
Oliver Stannard
0a88afaed7 [Support] Fix formatted_raw_ostream for UTF-8
* The getLine and getColumn functions need to update the position, or
  they will return stale data for buffered streams. This fixes a bug in
  the clang -analyzer-checker-option-help option, which was not wrapping
  the help text correctly when stdout is not a TTY.
* If the stream contains multi-byte UTF-8 sequences, then the whole
  sequence needs to be considered to be a single character. This has the
  edge case that the buffer might fill up and be flushed part way
  through a character.
* If the stream contains East Asian wide characters, these will be
  rendered twice as wide as other characters, so we need to increase the
  column count to match.

This doesn't attempt to handle everything unicode can do (combining
characters, right-to-left markers, ...), but hopefully covers most
things likely to be common in messages and source code we might want to
print.

Differential revision: https://reviews.llvm.org/D76291
2020-07-06 16:18:15 +01:00
Sam McCall
8c3580fff2 [Support] Add path::user_config_directory for $XDG_CONFIG_HOME etc
Reviewers: hokein

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83128
2020-07-06 12:20:55 +02:00
Luke Geeson
920620bd6d [ARM] Add Cortex-A77 Support for Clang and LLVM
This patch upstreams support for the Arm-v8 Cortex-A77
processor for AArch64 and ARM.

In detail:
- Adding cortex-a77 as a cpu option for aarch64 and arm targets in clang
- Cortex-A77 CPU name and ProcessorModel in llvm

details of the CPU can be found here:
https://www.arm.com/products/silicon-ip-cpu/cortex-a/cortex-a77

and a similar submission to GCC can be found here:
e0664b7a63

The following people contributed to this patch:
- Luke Geeson
- Mikhail Maltsev

Reviewers: t.p.northover, dmgreen, ostannard, SjoerdMeijer

Reviewed By: dmgreen

Subscribers: dmgreen, kristof.beyls, hiraditya, danielkiss, cfe-commits,
llvm-commits, miyuki

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D82887
2020-07-03 13:00:54 +01:00
David Zarzycki
48aa39a9ee Reland: [clang driver] Move default module cache from system temporary directory
This fixes a unit test. Otherwise here is the original commit:

1) Shared writable directories like /tmp are a security problem.
2) Systems provide dedicated cache directories these days anyway.
3) This also refines LLVM's cache_directory() on Darwin platforms to use
   the Darwin per-user cache directory.

Reviewers: compnerd, aprantl, jakehehrlich, espindola, respindola, ilya-biryukov, pcc, sammccall

Reviewed By: compnerd, sammccall

Subscribers: hiraditya, llvm-commits, cfe-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D82362
2020-06-27 05:35:15 -04:00
Nico Weber
2d39538671 Revert "Disable a JSONTest.Integers test with all MSVCs, PR46470"
This reverts commit 63bcf89125fdfe8a41b0125454b006b49abb0184.
Turns out the more targeted disablement in the previous change
was good enough.
2020-06-26 22:30:24 -04:00
Nico Weber
74b82e9a7e Disable a JSONTest.Integers test with all MSVCs, PR46470 2020-06-26 20:02:04 -04:00
Nico Weber
79ca9c7eae Disable a JSONTest.Integers test with newer MSVCs, PR46470 2020-06-26 19:57:52 -04:00
Simon Pilgrim
f5fa275b44 Revert rGf0bab7875e78e01c149d12302dcc4b6d4c43e25c - "Triple.h - reduce Twine.h include to forward declarations. NFC."
This causes ICEs on the clang-ppc64be buildbots and I've limited ability to triage the problem.
2020-06-26 14:46:40 +01:00
Simon Pilgrim
efd7ae7bbc Triple.h - reduce Twine.h include to forward declarations. NFC.
Move include down to a number of other files that had an implicit dependency on the Twine class.
2020-06-26 13:06:57 +01:00
Eric Christopher
60377c3da8 [clang/llvm] As part of using inclusive language within
the llvm project, migrate away from the use of blacklist and whitelist.
2020-06-20 16:03:58 -07:00
Thomas Preud'homme
af838d617a Reland [FileCheck, unittest] Improve readability of ExpressionFormat
This was originally cd2553de77f and reverted in a3adfb400ef.
The ADT itostr bug this triggered was fixed in f3e8f961736.
2020-06-19 18:44:34 +01:00
Thomas Preud'homme
25010a100a Revert "[FileCheck, unittest] Improve readability of ExpressionFormat"
This reverts commit cd2553de77f2c3206deaa261a15cc7520ff2ff56.
2020-06-19 15:52:39 +01:00
Thomas Preud'homme
3691e53520 [FileCheck, unittest] Improve readability of ExpressionFormat
Summary:
Factor out repetetitive code into helper function and split massive
ExpressionFormat method test into separate test for each method,
removing dead code in passing. Also add a MinInt64 and MaxInt64 checks
when testing getMatchingString.

Reviewers: jhenderson, jdenny, probinson, grimar, arichardson

Reviewed By: jhenderson, grimar

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82132
2020-06-19 14:47:37 +01:00
Michał Górny
6b982af8c2 [llvm] [CommandLine] Do not suggest really hidden opts in nearest lookup
Skip 'really hidden' options when performing lookup of the nearest
option when invalid option was passed.  Since these options aren't even
documented in --help-hidden, it seems inconsistent to suggest them
to users.

This fixes clang-tools-extra test failures due to unexpected suggestions
when linking the tools to LLVM dylib (that provides more options than
the subset of LLVM libraries linked directly).

Differential Revision: https://reviews.llvm.org/D82001
2020-06-17 19:00:26 +02:00
Paul Walker
1b3768875a [FileCheck] Implement * and / operators for ExpressionValue.
Subscribers: arichardson, hiraditya, thopre, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80915
2020-06-17 09:39:17 +00:00
Serge Pavlov
95f949cc97 Use explicitly unsigned zero to prevent from a warning 2020-06-17 15:35:55 +07:00
Serge Pavlov
8b68746c45 [Support] Get process statistics in ExecuteAndWait and Wait
The functions sys::ExcecuteAndWait and sys::Wait now have additional
argument of type pointer to structure, which is filled with process
execution statistics upon process termination. These are total and user
execution times and peak memory consumption. By default this argument is
nullptr so existing users of these function must not change behavior.

Differential Revision: https://reviews.llvm.org/D78901
2020-06-17 13:39:59 +07:00
Thomas Preud'homme
a5f3d35feb FileCheck [11/12]: Add matching constraint specification
This patch is part of a patch series to add support for FileCheck
numeric expressions. This specific patch adds support for specifying the
matching constraint for a numeric expression, ie. how the value being
matched should relate to the numeric expression.

This commit only adds the equality constraint where the numeric value
matched must be equal to the numeric expression. It is the default
matching constraint used when not specified. It is added to provision
other matching constraint (e.g. inequality relations).

Copyright:
    - Linaro (changes up to diff 183612 of revision D55940)
    - GraphCore (changes in later versions of revision D55940 and
                 in new revision created off D55940)

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D60391
2020-06-10 15:56:10 +01:00
Paul Walker
a8c59c6124 [FileCheck] Add function call support to numerical expressions.
This patch extends numerical expressions to allow calls to
predefined functions. These calls can be combined with the
existing numerical operators, which includes nesting calls.

The call syntax is:

  <func>(<args>)

Where <func> is a predefined string literal, currently limited to
one of add, max, min and sub. <arg> is a comma seperated list of
numerical expressions.

Subscribers: arichardson, hiraditya, thopre, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79936
2020-06-10 09:42:00 +00:00
Fangrui Song
be2cb93ae5 [Support][unittest] Fix asan failure after D81156 2020-06-09 17:48:00 -07:00
James Henderson
17d5bec07f [Support] Add stream tie function and use it for errs()
errs() is now tied to outs() so that if something prints to errs(),
outs() will be flushed before the printing occurs. This avoids
interleaving output between the two and is consistent with standard cout
and cerr behaviour.

Reviewed by: labath, JDevlieghere, MaskRay

Differential Revision: https://reviews.llvm.org/D81156
2020-06-09 12:51:02 +01:00
Andrew Litteken
84c169c23a [SuffixTree][MachOpt] Factoring out Suffix Tree and adding Unit Tests
This moves the SuffixTree test used in the Machine Outliner and moves it into Support for use in other outliners elsewhere in the compilation pipeline.

Differential Revision: https://reviews.llvm.org/D80586
2020-06-08 12:44:18 -07:00
Jonas Devlieghere
cbb5f1a118 [Support] Replace 'DisableColors' boolean with 'ColorMode' enum
Replace the DisableColors with a ColorMode which can be set to Auto,
Enabled and Disabled. The purpose of this change is to make it possible
to ignore the command line option not only for disabling colors, but
also for enabling them.

Differential revision: https://reviews.llvm.org/D81056
2020-06-08 09:48:47 -07:00
Jonas Devlieghere
e0b442709e [Support] Move color handling from raw_fd_ostream to raw_ostream
Move the color handling code from raw_fd_ostream to raw_ostream. This
makes it possible to use colors with any ostream when enabled. The
existing behavior where only raw_fd_ostream supports colors by default
remains unchanged.

Differential revision: https://reviews.llvm.org/D81110
2020-06-08 09:03:32 -07:00
Russell Gallop
32a91e7ab7 Revert "Relands "[YAMLVFSWriter][Test][NFC] Add couple tests" vol. 2"
This reverts commit 30949926f98576fbff8d5ad0390be5124ffacd7e.

This was failing on bot here:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/32749
2020-06-04 14:59:45 +01:00
Pavel Labath
0d0270ebc8 [Support] Use outs() in ToolOutputFile
Summary:
If the output filename was specified as "-", the ToolOutputFile class
would create a brand new raw_ostream object referring to the stdout.
This patch changes it to reuse the llvm::outs() singleton.

At the moment, this change should be "NFC", but it does enable other
enhancements, like the automatic stdout/stderr synchronization as
discussed on D80803.

I've checked the history, and I did not find any indication that this
class *has* to use a brand new stream object instead of outs() --
indeed, it is special-casing "-" in a number of places already, so this
change fits the pattern pretty well. I suspect the main reason for the
current state of affairs is that the class was originally introduced
(r111595, in 2010) as a raw_fd_ostream subclass, which made any other
solution impossible.

Another potential benefit of this patch is that it makes it possible to
move the raw_ostream class out of the business of special-casing "-" for
stdout handling. That state of affairs does not seem appropriate because
"-" is a valid filename (albeit hard to access with a lot of command
line tools) on most systems. Handling "-" in ToolOutputFile seems more
appropriate.

To make this possible, this patch changes the return type of
llvm::outs() and errs() to raw_fd_ostream&. Previously the functions
were constructing objects of that type, but returning a generic
raw_ostream reference. This makes it possible for new ToolOutputFile and
other code to use raw_fd_ostream methods like error() on the outs()
object. This does not seem like a bad thing (since stdout is a file
descriptor which can be redirected to anywhere, it makes sense to ask it
whether the writing was successful or if it supports seeking), and
indeed a lot of code was already depending on this fact via the
ToolOutputFile "back door".

Reviewers: dblaikie, JDevlieghere, MaskRay, jhenderson

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D81078
2020-06-04 14:56:35 +02:00
Paul Walker
43bb66cc33 [FileCheck] Implement equality operators for ExpressionValue.
Subscribers: hiraditya, thopre, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D81094
2020-06-04 11:18:35 +00:00
Jan Korous
e78b0af710 Relands "[YAMLVFSWriter][Test][NFC] Add couple tests" vol. 2
This reverts commit e4e3e41905d182c0f3d5b0b9406e3cbf2aabb30f.

Fixed dangling StringRef in test.
2020-06-04 01:26:12 -07:00
Jan Korous
8dbf875fd5 [Support][NFC] Tests for root_name(), root_directory() and root_path()
It's literally just doc comments converted to unittests.
2020-06-04 01:13:35 -07:00
Serge Pavlov
86f8cab821 Revert "[Support] Add file lock/unlock functions"
This reverts commit f51bc4fb60fbcef26d18eff549fc68307fd46489.
It broke the Solaris buildbots (Builder clang-solaris11-sparcv9 Build #5494
<http://lab.llvm.org:8014/builders/clang-solaris11-sparcv9/builds/54).
2020-06-03 15:40:12 +07:00
Serge Pavlov
0a558b962d [Support] Add file lock/unlock functions
New functions `lockFile`, `tryLockFile` and `unlockFile` implement
simple file locking. They lock or unlock entire file. This must be
enough to support simulataneous writes to log files in parallel builds.

Differential Revision: https://reviews.llvm.org/D78896
2020-06-03 12:22:45 +07:00
Pavel Labath
bbfbcfbfb2 [Support] Make DataExtractor error messages more clear
Summary:
This is a result of the discussion at D78113. Previously we would be
only giving the current offset at which the error was detected. However,
this was phrased somewhat ambiguously (as it could also mean that end of
data was at that offset). The new error message includes the current
offset as well as the extent of the data being read.

I've changed a couple of file-level static functions into private member
functions in order to avoid passing a bunch of new arguments everywhere.

Reviewers: dblaikie, jhenderson

Subscribers: hiraditya, MaskRay, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78558
2020-06-02 12:57:51 +02:00
James Henderson
47c0f73fb2 [Support] Add more context to DataExtractor getLEB128 errors
Reviewed by: clayborg, dblaikie, labath

Differential Revision: https://reviews.llvm.org/D80799
2020-06-01 14:00:01 +01:00
Sjoerd Meijer
24a060d455 [AArch64] Add native CPU detection for Neoverse N1
Map the CPU ID value 0xd0c to "neoverse-n1".

Patch by James Greenhalgh.

Differential Revision: https://reviews.llvm.org/D80736
2020-05-28 19:54:18 +01:00
Thomas Preud'homme
959d70cd6e FileCheck [10/12]: Add support for signed numeric values
Summary:
This patch is part of a patch series to add support for FileCheck
numeric expressions. This specific patch adds support signed numeric
values, thus allowing negative numeric values.

As such, the patch adds a new class to represent a signed or unsigned
value and add the logic for type promotion and type conversion in
numeric expression mixing signed and unsigned values. It also adds
the %d format specifier to represent signed value.

Finally, it also adds underflow and overflow detection when performing a
binary operation.

Copyright:
    - Linaro (changes up to diff 183612 of revision D55940)
    - GraphCore (changes in later versions of revision D55940 and
                 in new revision created off D55940)

Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson

Reviewed By: jhenderson, arichardson

Subscribers: MaskRay, hiraditya, llvm-commits, probinson, dblaikie, grimar, arichardson, kristina, hfinkel, rogfer01, JonChesterfield

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D60390
2020-05-28 10:44:21 +01:00
Adrian McCarthy
eb407bac67 Fix Windows command line bug when last token in response file is ""
Patch by Neil Dhar <dhar@alumni.duke.edu>

Current state machine for parsing tokens from response files in Windows
does not correctly handle the case where the last token is "". The current
implementation handles the last token by only adding it if it is not empty,
however this does not cover the case where the last token is meant to be
the empty string. We can cover this case by checking whether the state
machine was last in the UNQUOTED state, which indicates that the last
character of the input was a non-whitespace character.

Differential Revision: https://reviews.llvm.org/D78346
2020-05-27 14:49:30 -07:00
Alex Richardson
aa7eac2e43 [FileCheck] Allow parenthesized expressions
With this change it is be possible to write FileCheck expressions such
as [[#(VAR+1)-2]]. Currently, the only supported arithmetic operators are
plus and minus, so this is not particularly useful yet. However, it our
CHERI fork we have tests that benefit from having multiplication in
FileCheck expressions. Allowing parenthesized expressions is the simplest
way for us to work around the current lack of operator precedence in
FileCheck expressions.

Reviewed By: thopre, jhenderson
Differential Revision: https://reviews.llvm.org/D77383
2020-05-27 16:31:39 +01:00
Jonas Devlieghere
320e22f920 [YAMLTraits] Remove char trait and serialize as uint8_t in lldb.
As discussed in https://reviews.llvm.org/D79745
2020-05-26 11:07:27 -07:00
Craig Topper
c8f290ffea [Align] Remove operations on MaybeAlign that asserted that it had a defined value.
If the caller needs to reponsible for making sure the MaybeAlign
has a value, then we should just make the caller convert it to an Align
with operator*.

I explicitly deleted the relational comparison operators that
were being inherited from Optional. It's unclear what the meaning
of two MaybeAligns were one is defined and the other isn't
should be. So make the caller reponsible for defining the behavior.

I left the ==/!= operators from Optional. But now that exposed a
weird quirk that ==/!= between Align and MaybeAlign required the
MaybeAlign to be defined. But now we use the operator== from
Optional that takes an Optional and the Value.

Differential Revision: https://reviews.llvm.org/D80455
2020-05-22 21:54:28 -07:00
Jonas Devlieghere
6dd20e6e2d Revert "Revert "[YAMLTraits] Add trait for char""
Reverting this to unblock all the LLDB bots while we try to figure out a
solution for Solaris in https://reviews.llvm.org/D79745.
2020-05-21 10:33:09 -07:00
Rainer Orth
aa8832a483 Revert "[YAMLTraits] Add trait for char"
This reverts commit fab08bf4899e40d02d8bf394a63499ac679ac61c.  It has left
the Solaris buildbots broken for a week and a half as reported
in https://reviews.llvm.org/D79745.
2020-05-21 17:33:42 +02:00
Fangrui Song
c0bfc5f564 [Support][unittest] Fix HostTest.NumPhysicalCores on __i386__ after D78324 2020-05-19 21:51:14 -07:00
Simon Pilgrim
9aba16961d Revert rGca18ce1a00cd8b7cb7ce0e130440f5ae1ffe86ee "GlobPattern.h - remove unnecessary BitVector.h/StringRef.h includes. NFC"
Causes lld build errors
2020-05-17 18:51:21 +01:00
Simon Pilgrim
dc62775ff9 GlobPattern.h - remove unnecessary BitVector.h/StringRef.h includes. NFC
Use forward declarations (BitVector already had one) and an headers to source file that were implicitly using them.
2020-05-17 18:29:41 +01:00
Wei Zhao
f6a8e3ef0e [AARch64] Add Marvell ThunderX3T110 support
This is the first checkin to support Marvell ThunderX3T110.

Initial definition of the micro-ops of the instructions in ThunderX3T110
is included.

Differential Revision: https://reviews.llvm.org/D78129
2020-05-13 16:58:51 -07:00
Sylvain Audi
8f3f9e0849 [Clang] Restore replace_path_prefix instead of startswith
In D49466, sys::path::replace_path_prefix was used instead startswith for -f[macro/debug/file]-prefix-map options.
However those were reverted later (commit rG3bb24bf25767ef5bbcef958b484e7a06d8689204) due to broken Windows tests.

This patch restores those replace_path_prefix calls.
It also modifies the prefix matching to be case-insensitive under Windows.

Differential Revision : https://reviews.llvm.org/D76869
2020-05-13 13:49:14 -04:00
Jan Korous
0033cbcfd8 [YAMLVFSWriter] Fix for delimiters
Differential Revision: https://reviews.llvm.org/D79809
2020-05-12 15:43:10 -07:00
Jonas Devlieghere
be984cb005 [VirtualFileSystem] Add unit test that showcases another YAMLVFSWriter bug
This scenario generates another broken YAML mapping as illustrated below.

  {
    'type': 'directory',
    'name': "c",
    'contents': [
      ,
      {
        'type': 'directory',
        'name': "d",
        'contents': [
          ,
          {
            'type': 'directory',
            'name': "e",
            'contents': [
              {
                'type': 'file',
                'name': "f",
                'external-contents': "//root/a/c/d/e/f"
              }                    {
                'type': 'file',
                'name': "g",
                'external-contents': "//root/a/c/d/e/g"
              }
            ]
          }
        ]
      }
    ]
  },
2020-05-12 14:55:43 -07:00