Commit Graph

73355 Commits

Author SHA1 Message Date
Adrian Prantl 9fc8faf9e6 Remove \brief commands from doxygen comments.
This is similar to the LLVM change https://reviews.llvm.org/D46290.

We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.

Patch produced by

for i in $(git grep -l '\@brief'); do perl -pi -e 's/\@brief //g' $i & done
for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done

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

llvm-svn: 331834
2018-05-09 01:00:01 +00:00
Petr Hosek cfa9854830 Set CMAKE_BUILD_WITH_INSTALL_RPATH for Fuchsia runtimes
This doesn't make any difference since we don't use RPATH/RUNPATH
on Fuchsia but it avoids the CMake error when re-linking libraries
while building with Ninja.

Differntial Revision: https://reviews.llvm.org/D46610

llvm-svn: 331833
2018-05-09 00:58:12 +00:00
Petr Hosek 9befdb8814 [CMake] Include llvm-strip in Fuchsia toolchain distribution
Now that llvm-strip is available, include it in the Fuchsia toolchain.

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

llvm-svn: 331826
2018-05-09 00:05:28 +00:00
Craig Topper 384621e985 [X86] Mark builtins 'const' where possible
I attempted to go through all the builtins and marked them const if they didn't touch memory or other hidden state.

I don't know how to test this or if it really matters.

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

llvm-svn: 331814
2018-05-08 22:01:43 +00:00
Erich Keane a4c48c68c5 Fix float->int conversion warnings when near barriers.
As Eli brought up here: https://reviews.llvm.org/D46535
I'd previously messed up this fix by missing conversions
that are just slightly outside the range.  This patch fixes
this by no longer ignoring the return value of 
convertToInteger.  Additionally, one of the error messages
wasn't very sensical (mentioning out of range value, when it 
really was not), so it was cleaned up as well.

llvm-svn: 331812
2018-05-08 21:26:21 +00:00
Yaxun Liu 398612b4c2 [HIP] Add hip offload kind
There are quite differences in HIP action builder and action job creation,
which justifies to define a separate offload kind.

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

llvm-svn: 331811
2018-05-08 21:02:12 +00:00
Jessica Paquette 544bb55a3e Add a mno-outline flag to disable the MachineOutliner
Since we're working on turning the MachineOutliner by default under -Oz for
AArch64, it makes sense to have an -mno-outline flag available. This currently
doesn't do much (it basically just undoes -moutline).

When the MachineOutliner is on by default under AArch64, this flag should
set -mllvm -enable-machine-outliner=never.

llvm-svn: 331810
2018-05-08 20:58:32 +00:00
Martin Storsjo f9fa17b873 [Driver] Don't add -dwarf-column-info when using -gcodeview on non-msvc targets
-dwarf-column-info is omitted if -gcodeview is specified for msvc
targets at the moment, but since -gcodeview is an option that can be
specified for any target, there's little reason to restrict this
handling to msvc targets.

This allows getting proper codeview debug info by passing -gcodeview
for e.g. MinGW targets as well.

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

llvm-svn: 331807
2018-05-08 20:55:23 +00:00
Jessica Paquette 635af6223b Change -foutline to -moutline
Nitpicky, but the MachineOutliner is a machine-level pass, and so we should
reflect that by using "m" instead of "n".

Figured we should get this in before people get used to the letter f. :)

llvm-svn: 331806
2018-05-08 20:53:19 +00:00
Stephane Sezer 9601bf5b6a Add missing newlines to cl::extrahelp uses
llvm-svn: 331802
2018-05-08 19:46:29 +00:00
Zachary Turner b719d1b5b0 [lit] Fix running tests that require 'examples'.
Differential Revision: https://reviews.llvm.org/D46514
Patch by Nikolai Kosjar.

llvm-svn: 331786
2018-05-08 18:20:10 +00:00
Alexey Bataev 9a70017537 [OPENMP, NVPTX] Fix linkage of the global entries.
The linkage of the global entries must be weak to enable support of
redefinition of the same target regions in multiple compilation units.

llvm-svn: 331768
2018-05-08 14:16:57 +00:00
Sven van Haastregt 35b613974e [OpenCL] Factor out language version printing
Generate a printable OpenCL language version number in a single place
and select between the OpenCL C or OpenCL C++ version accordingly.

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

llvm-svn: 331766
2018-05-08 13:47:43 +00:00
Aleksei Sidorin 8f266dbbdc [ASTImporter] Properly import SourceLocations of Attrs
Patch by Rafael Stahl!

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

llvm-svn: 331762
2018-05-08 12:45:21 +00:00
Gabor Horvath 3cd0aa3b7e [ASTMatchers] Overload isConstexpr for ifStmts
Differential Revision: https://reviews.llvm.org/D46233

llvm-svn: 331759
2018-05-08 11:53:32 +00:00
Simon Pilgrim 3366dcfe1f Fix 'not all control paths return a value' MSVC warnings. NFCI.
llvm-svn: 331753
2018-05-08 09:40:32 +00:00
Krasimir Georgiev f2ca41dbba [clang-format] Add raw string formatting to release notes
Reviewers: hans

Reviewed By: hans

Subscribers: cfe-commits

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

llvm-svn: 331750
2018-05-08 09:25:12 +00:00
Eric Fiselier 98a1cab694 [C++2a] Implement operator<=>: Fix another bug in the code gen tests.
Sorry for the failures. I'm quite new at writing code gen tests, and
I'm not sure the best way to make them portable.

llvm-svn: 331745
2018-05-08 07:56:05 +00:00
Gabor Buella 5e52fa9035 [x86] Introduce the encl[u|s|v] intrinsics
Reviewers: craig.topper, zvi

Reviewed By: craig.topper

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

llvm-svn: 331743
2018-05-08 07:12:34 +00:00
Gabor Buella b0f310d51d [x86] Introduce the pconfig intrinsic
Reviewers: craig.topper, zvi

Reviewed By: craig.topper

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

llvm-svn: 331740
2018-05-08 06:49:41 +00:00
Petr Hosek 403793e7b5 [CMake] Pass additional CMake flags in Fuchsia cache files
This allows passing additional CMake flags to builtins and runtimes
build through Fuchsia cache files.

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

llvm-svn: 331717
2018-05-08 02:47:13 +00:00
Eric Fiselier 4ed0fe04ef [C++2a] operator<=>: Fix incorrect use of Twine.
llvm-svn: 331713
2018-05-08 02:28:47 +00:00
Eric Fiselier c5fb858053 [C++2a] Implement operator<=>: Address bugs and post-commit review comments after r331677.
This patch addresses some mostly trivial post-commit review comments received
on r331677.

Additionally, this patch fixes an assertion in `getNarrowingKind` caused by
the use of an uninitialized value from `checkThreeWayNarrowingConversion`.

llvm-svn: 331707
2018-05-08 00:52:19 +00:00
Richard Trieu fb00bde419 Move test input file into same directory as test. NFC
llvm-svn: 331706
2018-05-08 00:29:21 +00:00
Eric Fiselier 2ab957e67b Fix failing codegen test on non-x86_64 platforms
llvm-svn: 331697
2018-05-07 23:15:34 +00:00
Richard Smith a6cede6d8e PR37352: mangle numbering for decomposition declarations.
In order to match our mangling scheme, use a different set of numbers for
decomposition declarations, and consider all binding names when forming the
numbering. This does not yet affect any mangled names we produce, because
local decomposition declarations can't yet have linkage, but a C++ standard
proposal to change that is currently being processed.

llvm-svn: 331692
2018-05-07 22:23:38 +00:00
Erich Keane 4ef47eb121 [NFC] Move 2 variable initialization from Ctor to member initializers.
In response to dblaikie's suggestion on r331536, replace the two enum
typed variable initializers in the constructor with member initializers.

llvm-svn: 331688
2018-05-07 22:01:06 +00:00
Craig Topper 45fc2c83e6 [X86] Use target feature defines in tests instead of defining our own flag on the command line. NFCI
llvm-svn: 331683
2018-05-07 21:47:13 +00:00
Craig Topper 66ef4185bc [X86] Make _mm256_gf2p8mul_epi8 require avx features since its 256 bits.
Without this we throw an error on the header file instead of the user code when the right features aren't enabled in clang.

Rename the other DEFAULT_FN_ATTRS defines to _Z for 512-bit since I used _Y for this case.

llvm-svn: 331682
2018-05-07 21:47:11 +00:00
Peter Collingbourne 69970defe0 Relax a FileCheck pattern to make it pass on Windows.
Should fix Windows bot failure:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/16956

llvm-svn: 331681
2018-05-07 21:40:53 +00:00
Eric Fiselier 0683c0e68d [C++2a] Implement operator<=> CodeGen and ExprConstant
Summary:
This patch tackles long hanging fruit for the builtin operator<=> expressions. It is currently needs some cleanup before landing, but I want to get some initial feedback.

The main changes are:

* Lookup, build, and store the required standard library types and expressions in `ASTContext`. By storing them in ASTContext we don't need to store (and duplicate) the required expressions in the BinaryOperator AST nodes. 

* Implement [expr.spaceship] checking, including diagnosing narrowing conversions. 

* Implement `ExprConstant` for builtin spaceship operators.

* Implement builitin operator<=> support in `CodeGenAgg`. Initially I emitted the required comparisons using `ScalarExprEmitter::VisitBinaryOperator`, but this caused the operand expressions to be emitted once for every required cmp.

* Implement [builtin.over] with modifications to support the intent of P0946R0. See the note on `BuiltinOperatorOverloadBuilder::addThreeWayArithmeticOverloads` for more information about the workaround.




Reviewers: rsmith, aaron.ballman, majnemer, rnk, compnerd, rjmccall

Reviewed By: rjmccall

Subscribers: rjmccall, rsmith, aaron.ballman, junbuml, mgorny, cfe-commits

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

llvm-svn: 331677
2018-05-07 21:07:10 +00:00
Peter Collingbourne 374599cf23 [CFI] Force LLVM to die if the implicit blacklist files cannot be found.
Currently LLVM CFI tries to use an implicit blacklist file, currently
in /usr/lib64/clang/<version>/share. If the file is not there, LLVM
happily continues, which causes CFI to add checks to files/functions
that are known to fail, generating binaries that fail. This CL causes
LLVM to die (I hope) if it can't find these implicit blacklist files.

Patch by Caroline Tice!

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

llvm-svn: 331674
2018-05-07 20:54:05 +00:00
Erich Keane 7130a93934 Correct warning on Float->Integer conversions.
As identified and briefly discussed here:
https://bugs.llvm.org/show_bug.cgi?id=37305

Converting a floating point number to an integer type when
the integral part is out of the range of the integer type is
undefined behavior in C. Additionally, CodeGen emits an undef
in this situation.

HOWEVER, we've been giving a warning that says that the value is
changed. This patch corrects the warning to list that it is actually
undefined behavior.

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

llvm-svn: 331673
2018-05-07 20:52:56 +00:00
Martin Storsjo c33639227e [Driver] Use -fuse-line-directives by default in MSVC mode
Don't use the GNU extension form of line markers in MSVC mode.

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

llvm-svn: 331666
2018-05-07 20:26:09 +00:00
Alexey Bataev c661186cca [OPENMP, NVPTX] Small test fix, NFC.
llvm-svn: 331654
2018-05-07 17:38:13 +00:00
Alexey Bataev 504fc2d0cd [OPENMP, NVPTX] Codegen for critical construct.
Added correct codegen for the critical construct on NVPTX devices.

llvm-svn: 331652
2018-05-07 17:23:05 +00:00
Erich Keane c90bb6d762 Fix explicit template parameter reporting for narrowing conversions
I found that explicit template parameters that caused a
narrowing integer conversion resulted in the incorrect parameter
being mentioned in the note (see test attached). This is because
the argument checking code doesn't check to see if it caused
SFINAE errors when checking the arguments, so instead of giving
up on the first error, it continues through the list. This
makes the error reporting pick up the last template param every time.

This patch checks these parameters on each argument and gives up
if there is an error. The result is that only the required amount
of arguments are checked, and that the 'Converted' array contains
only the successful arguments before the first failure, as the
calls seem to all expect.

llvm-svn: 331651
2018-05-07 17:05:20 +00:00
Joel Galenson 267ea72437 [docs] Fix typos in the Clang User's Manual.
llvm-svn: 331644
2018-05-07 16:23:46 +00:00
Alexey Bataev d7ff6d647f [OPENMP, NVPTX] Added support for L2 parallelism.
Added initial codegen for level 2, 3 etc. parallelism. Currently, all
the second, the third etc. parallel regions will run sequentially.

llvm-svn: 331642
2018-05-07 14:50:05 +00:00
Aleksandar Beserminji 20d603bbdf [mips] Improve handling of -fno-[pic/PIC] option
In order to disable PIC and to match GCC behaviour, -mno-abicalls
option is neccessary. When -fno-[pic/PIC] is used witout -mno-abicalls,
warning is reported. An error is reported when -fno-pic or -fno-PIC is
used in combination with -mabicalls.

In this commit, test case is added.

Depends on D44381.

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

llvm-svn: 331640
2018-05-07 14:30:49 +00:00
Aleksandar Beserminji 535f5ae003 Revert "[mips] Improve handling of -fno-[pic/PIC] option"
This reverts commit r331636. Forgot to add the test case.

llvm-svn: 331639
2018-05-07 14:28:42 +00:00
Aleksandar Beserminji f9b3fc5e2b [mips] Improve handling of -fno-[pic/PIC] option
In order to disable PIC and to match GCC behaviour, -mno-abicalls
option is neccessary. When -fno-[pic/PIC] is used witout -mno-abicalls,
warning is reported. An error is reported when -fno-pic or -fno-PIC is
used in combination with -mabicalls.

Depends on D44381.

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

llvm-svn: 331636
2018-05-07 14:19:54 +00:00
Peter Szecsi ce7f318f21 [ASTImporter] Support importing UnresolvedMemberExpr, DependentNameType, DependentScopeDeclRefExpr
The visit callback implementations for the 3 C++ AST Node added to the ASTImporter.

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

llvm-svn: 331630
2018-05-07 12:08:27 +00:00
Richard Smith c2fccf8338 Remove now-unnecessary check for non-zero nvsize in addition to
emptyness in MS record layout.

llvm-svn: 331621
2018-05-07 06:43:31 +00:00
Richard Smith b5a317fbf6 Non-zero-length bit-fields make a class non-empty.
This implements the rule intended by the standard (see LWG 2358)
and the rule intended by the Itanium C++ ABI (see
https://github.com/itanium-cxx-abi/cxx-abi/pull/51), and makes
Clang match the behavior of GCC, ICC, and MSVC.

A pedantic reading of both the standard and the ABI indicate that Clang
is currently technically correct, but that's not worth much when it's
clear that the wording is wrong in both those places.

This is an ABI break for classes that derive from a class that is empty
other than one or more unnamed non-zero-length bit-fields. Such cases
are expected to be rare, but -fclang-abi-compat=6 restores the old
behavior just in case.

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

llvm-svn: 331620
2018-05-07 06:43:30 +00:00
Aaron Ballman a383c94ccd Disallow pointers to const in __sync_fetch_and_xxx.
Diagnoses code like:

void f(const int *ptr) {
  __sync_fetch_and_add(ptr, 1);
}

which matches the behavior of GCC and ICC.

llvm-svn: 331598
2018-05-05 17:38:42 +00:00
Teresa Johnson fedd39045f Add -target to address errors in test from r331592
The error turns out to be:
Assertion failed: (Target.isCompatibleDataLayout(getDataLayout()) && "Can't create a MachineFunction using a Module with a " "Target-incompatible DataLayout attached\n"), function init, file /Users/buildslave/jenkins/workspace/clang-stage1-cmake-RA-incremental/llvm/lib/CodeGen/MachineFunction.cpp, line 180.

Add -target to address this. Also re-enable the test I had temporarily
commented, and move it further down in case there is still a failure
(since it pipes stderr to FileCheck).

llvm-svn: 331597
2018-05-05 16:37:31 +00:00
Teresa Johnson 1237b3acc9 Skip part of test added in r331592 to help debug bot failures
Trying to debug why/where a few bots getting exit code 256 e.g.
http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental/48471/testReport/Clang/CodeGen/thinlto_diagnostic_handler_remarks_with_hotness_ll/

and a few windows bots getting no output from that RUN line e.g.
http://lab.llvm.org:8011/builders/clang-x86-windows-msvc2015/builds/11865/steps/ninja%20check%201/logs/FAIL%3A%20Clang%3A%3Athinlto-diagnostic-handler-remarks-with-hotness.ll

llvm-svn: 331596
2018-05-05 15:54:57 +00:00
Teresa Johnson 259f8ddff5 Add required target to address bot failures from r331592
Failing on non-x86 bots, needs x86 target for code gen.

llvm-svn: 331593
2018-05-05 15:15:04 +00:00
Teresa Johnson 66744f8137 [ThinLTO] Support opt remarks options with distributed ThinLTO backends
Summary:
Passes down the necessary code ge options to the LTO Config to enable
-fdiagnostics-show-hotness and -fsave-optimization-record in the ThinLTO
backend for a distributed build.

Also, remove warning about not having PGO when the input is IR.

Reviewers: pcc

Subscribers: mehdi_amini, inglorion, eraman, cfe-commits

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

llvm-svn: 331592
2018-05-05 14:37:29 +00:00