Commit Graph

80808 Commits

Author SHA1 Message Date
Alexey Bataev 14a388f43b [OPENMP50]Add support for parallel master taskloop simd directive.
Added full support for parallel master taskloop simd directive.
2019-10-30 10:23:33 -04:00
Raphael Isemann ba7bde65dc [ASTImporter] Add support for BuiltinTemplateDecl
Summary:
That decl kind is currently not implemented. BuiltinTemplateDecl is for decls that are hardcoded in the
ASTContext, so we can import them like we do other builtin decls by just taking the equivalent
decl from the target ASTContext.

Reviewers: martong, a.sidorin, shafik

Reviewed By: martong, shafik

Subscribers: rnkovacs, kristina, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D69566
2019-10-30 14:53:35 +01:00
Jeremy Morse 6c0a160c2d Rename a flang test case
On Windows and macOS, the filesystem is case insensitive, and these files
interfere with each other. Reading through, the case of the file extension
is part of the test. I've altered the rest of the name instead.
2019-10-30 13:29:47 +00:00
Peter Waller 6bf5580492 [clang][driver] Add basic --driver-mode=flang support for fortran
This patch adds a new Flang mode. When in Flang mode, the driver will
invoke flang for fortran inputs instead of falling back to the GCC
toolchain as it would otherwise do.

The behaviour of other driver modes are left unmodified to preserve
backwards compatibility.

It is intended that a soon to be implemented binary in the flang project
will import libclangDriver and run the clang driver in the new flang
mode.

Please note that since the binary invoked by the driver is under
development, there will no doubt be further tweaks necessary in future
commits.

* Initial support is added for basic driver phases
  * -E, -fsyntax-only, -emit-llvm -S, -emit-llvm, -S, (none specified)
  * -### tests are added for all of the above
  * This is more than is supported by f18 so far, which will emit errors
    for those options which are unimplemented.

* A test is added that ensures that clang gives a reasonable error
  message if flang is not available in the path (without -###).

* Test that the driver accepts multiple inputs in --driver-mode=flang.

* Test that a combination of C and Fortran inputs run both clang and
  flang in --driver-mode=flang.

* clang/test/Driver/fortran.f95 is fixed to use the correct fortran
  comment character.

Differential revision: https://reviews.llvm.org/D63607
2019-10-30 10:42:22 +00:00
Richard Smith cbb3104b1c Suppress useless GCC "bitfield is too small to hold all values of enum class" warning. 2019-10-29 17:20:46 -07:00
Reid Kleckner 07ee46d613 [MS] Fix constexpr data member pointer conversions
Constexpr data member conversions work by starting with the class that
originally introduced the field, and converting from there to the type
that the user desires. Before this change, Clang was using the
inheritance model from the final destination class type instead of the
model from the class that originally introduced the field. To fix this,
find the relevant FieldDecl and take its parent class instead of using
the member pointer type the user provided.

Indirect field decls require some special handling to find the parent
class.

Fixes PR43803
2019-10-29 16:58:00 -07:00
Aaron Puchert ae3159e497 Thread safety analysis: Peel away NoOp implicit casts in initializers
Summary:
This happens when someone initializes a variable with guaranteed copy
elision and an added const qualifier. Fixes PR43826.

Reviewers: aaron.ballman, rsmith

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D69533
2019-10-30 00:37:32 +01:00
Richard Smith dbcb690fb7 Replace std::function in PrintingPolicy with a callbacks object.
This makes PrintingPolicy significantly more lightweight and provides
groundwork for more printing customization hooks.
2019-10-29 15:29:44 -07:00
Eli Friedman 98286b569d [Headers] Fix compatibility between arm_acle.h and intrin.h
Make sure they don't both define __nop.

Differential Revision: https://reviews.llvm.org/D69012
2019-10-29 14:52:56 -07:00
Richard Smith eb535d2341 Accept __is_same_as as a GCC-compatibility synonym for the proper trait name __is_same. 2019-10-29 14:44:38 -07:00
Adrian Prantl f919be3365 [DWARF5] Added support for deleted C++ special member functions.
This patch adds support for deleted C++ special member functions in
clang and llvm. Also added Defaulted member encodings for future
support for defaulted member functions.

Patch by Sourabh Singh Tomar!

Differential Revision: https://reviews.llvm.org/D69215
2019-10-29 13:44:06 -07:00
Richard Smith 52590319a2 Fix argument numbering confusion when diagnosing a non-viable operator().
This could lead to crashes if operator() is a variadic template, as we
could end up asking for an out-of-bounds argument.
2019-10-29 13:08:39 -07:00
Vlad Tsyrklevich efed314118 Revert "[clang-format] Remove the dependency on frontend"
This reverts commit ec66603ac7. It was
causing ubsan failures like the following on the ubsan bot:
llvm/lib/Support/SourceMgr.cpp:440:48: runtime error: pointer index expression with base 0x000000000000 overflowed to 0xfffffffffffffffa
2019-10-29 10:48:03 -07:00
Guillaume Chatelet 1c85a2e8dc isBuiltinFunc() uses StringRef instead of const char*
Summary: This prevents a bug when passing nullptr, StringRef ctor would call strlen(nullptr).

Reviewers: vlad.tsyrklevich

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D69569
2019-10-29 17:36:55 +01:00
Guillaume Chatelet 5607ff12fa Fix missing memcpy builtin on ppc64be
See D68028
2019-10-29 16:35:32 +01:00
Guillaume Chatelet 98f3151a7d [clang] Add no_builtin attribute
Summary:
This is a follow up on https://reviews.llvm.org/D61634
This patch is simpler and only adds the no_builtin attribute.

Reviewers: tejohnson, courbet, theraven, t.p.northover, jdoerfert

Subscribers: mgrang, cfe-commits

Tags: #clang

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

This is a re-submit after it got reverted in https://reviews.llvm.org/rGbd8791610948 since the breakage doesn't seem to come from this patch.
2019-10-29 15:50:29 +01:00
Alexey Bataev c09c0651a4 [OPENMP]Fix PR43772: No warning in non-combined target regions.
Need to analyze inner target regions in case of implicit mapping of the
data members when target region is created in one of the class member
functions.
2019-10-29 10:31:24 -04:00
Krzysztof Parzyszek 99f51960fd [Hexagon] Handle remaining registers in getRegisterByName()
This fixes https://llvm.org/PR43829.
2019-10-29 08:56:01 -05:00
Michael Spencer dddec1f184 [clang][clang-scan-deps] Add -fcxx-modules to test for Darwin. 2019-10-28 17:37:25 -07:00
Reid Kleckner 9ecd3225d1 [NFC] Fix some indentation disturbed in D67368 2019-10-28 17:12:43 -07:00
Dávid Bolvanský dfece0a108 [Builtins] Teach Clang about memccpy
Summary: Hopefully, -fno-builtin-memccpy will work now. Required for https://reviews.llvm.org/D67986.

Reviewers: aaron.ballman, rsmith

Reviewed By: aaron.ballman

Subscribers: RKSimon, kristina, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D68377
2019-10-28 23:27:08 +01:00
Vlad Tsyrklevich ad531fff81 Revert "[clang] Add no_builtin attribute"
This reverts commit bd87916109. It was
causing ASan/MSan failures on the sanitizer buildbots.
2019-10-28 15:21:59 -07:00
Vlad Tsyrklevich 38839d08b8 Revert "[Concepts] Constraint Enforcement & Diagnostics"
This reverts commit ffa214ef22, it was
causing ASAN test failures on sanitizer-x86_64-linux-bootstrap.
2019-10-28 15:00:40 -07:00
Reid Kleckner 7cd595df96 Revert "Use -fdebug-compilation-dir to form absolute paths in coverage mappings"
This reverts commit 9d4806a387.

There seem to be bugs in llvm-cov --path-equivalence that are causing
Chromium problems. Revert this until they are understood or fixed.
2019-10-28 14:40:17 -07:00
Leonard Chan 85b718f53a [Driver] Enable ShadowCallStack, not SafeStack, by default on AArch64 Fuchsia
Submitted for mcgrathr.

On AArch64, Fuchsia fully supports both SafeStack and ShadowCallStack ABIs.
The latter is now preferred and will be the default. It's possible to
enable both simultaneously, but ShadowCallStack is believed to have most
of the practical benefit of SafeStack with less cost.

Differential Revision: https://reviews.llvm.org/D66712
2019-10-28 14:19:38 -07:00
Francis Visoiu Mistrih f5094e1829 [Remarks] Fix Sphinx formatting 2019-10-28 13:13:39 -07:00
Francis Visoiu Mistrih 025166cf48 [Remarks] Add bitstream to the list of supported formats in clang 2019-10-28 13:08:05 -07:00
Simon Pilgrim f2132070d9 Lexer::ReadToEndOfLine - fix Token uninitialised value warnings. NFCI.
Use Token::startToken to initialize Token.
2019-10-28 18:28:18 +00:00
Alexey Bataev 7c86069820 [OPENMP]Fix PR43771: Do not capture contexprs variables.
If the variable is a constexpr variable, it should not be captured in the OpenMP region.
2019-10-28 13:29:02 -04:00
Guillaume Chatelet bd87916109 [clang] Add no_builtin attribute
Summary:
This is a follow up on https://reviews.llvm.org/D61634
This patch is simpler and only adds the no_builtin attribute.

Reviewers: tejohnson, courbet, theraven, t.p.northover, jdoerfert

Subscribers: mgrang, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D68028
2019-10-28 17:30:11 +01:00
Andrew Paverd d157a9bc8b Add Windows Control Flow Guard checks (/guard:cf).
Summary:
A new function pass (Transforms/CFGuard/CFGuard.cpp) inserts CFGuard checks on
indirect function calls, using either the check mechanism (X86, ARM, AArch64) or
or the dispatch mechanism (X86-64). The check mechanism requires a new calling
convention for the supported targets. The dispatch mechanism adds the target as
an operand bundle, which is processed by SelectionDAG. Another pass
(CodeGen/CFGuardLongjmp.cpp) identifies and emits valid longjmp targets, as
required by /guard:cf. This feature is enabled using the `cfguard` CC1 option.

Reviewers: thakis, rnk, theraven, pcc

Subscribers: ychen, hans, metalcanine, dmajor, tomrittervg, alex, mehdi_amini, mgorny, javed.absar, kristof.beyls, hiraditya, steven_wu, dexonsmith, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D65761
2019-10-28 15:19:39 +00:00
vhscampos f6e11a36c4 [ARM][AArch64] Implement __cls, __clsl and __clsll intrinsics from ACLE
Summary:
Writing support for three ACLE functions:
  unsigned int __cls(uint32_t x)
  unsigned int __clsl(unsigned long x)
  unsigned int __clsll(uint64_t x)

CLS stands for "Count number of leading sign bits".

In AArch64, these two intrinsics can be translated into the 'cls'
instruction directly. In AArch32, on the other hand, this functionality
is achieved by implementing it in terms of clz (count number of leading
zeros).

Reviewers: compnerd

Reviewed By: compnerd

Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D69250
2019-10-28 11:06:58 +00:00
vhscampos 5d35b7d9e1 [ARM][AArch64] Implement __arm_rsrf, __arm_rsrf64, __arm_wsrf & __arm_wsrf64
Summary:
Adding support for ACLE intrinsics.

Patch by Michael Platings.

Reviewers: chill, t.p.northover, efriedma

Reviewed By: chill

Subscribers: kristof.beyls, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D69297
2019-10-28 10:59:18 +00:00
Ilya Biryukov d9971d0b2e [clangd] Do not insert parentheses when completing a using declaration
Summary:
Would be nice to also fix this in clang, but that looks like more work
if we want to preserve signatures in informative chunks.

Fixes https://github.com/clangd/clangd/issues/118

Reviewers: kadircet

Reviewed By: kadircet

Subscribers: merge_guards_bot, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D69382
2019-10-28 09:45:10 +01:00
Richard Smith a4facd355d [c++20] Enforce rule that a union-like class or class with reference
members cannot have defaulted comparisons.
2019-10-27 23:26:44 -07:00
Richard Smith 39eef2cbb6 PR43775: don't produce a bogus 'auto' -Wc++98-compat warning for CTAD 2019-10-27 21:42:58 -07:00
Matt Arsenault 56a503bdba OpenMP: Add convergent to more runtime functions
Several of these other functions are probably also convergent, but
these two seem obviously convergent.
2019-10-27 21:26:55 -07:00
Matt Arsenault 40ab8ae9fb OpenMP: Add helper function for convergent runtime calls
Most of the functions emitted here should probably be convergent, but
only barriers are currently marked. Introduce this helper before
adding convergent to more functions.
2019-10-27 21:26:55 -07:00
Richard Smith 06d3fce01d PR43400: Add test that we can instantiate a friend function that is
defined as deleted.

The actual bug was fixed in commit d052a578.
2019-10-27 12:41:53 -07:00
Richard Smith faee39baa8 PR43762: when implicitly changing the active union member for an
assignment during constant evaluation, only start the lifetime of
trivially-default-constructible union members.
2019-10-27 12:31:16 -07:00
Greg Bedwell d4758d4a8d Fix a spelling mistake in a couple of intrinsic description comments. NFC 2019-10-27 09:42:14 +00:00
Sergey Dmitriev edb1a1de1b Reland "[Clang][Bundler] Error reporting improvements"
- Changed FileHandler read/write methods to return llvm::Error
- Using unified way of reporting errors
- Removed trailing '.' from the error messages

Differential Revision: https://reviews.llvm.org/D67031
2019-10-25 19:00:06 -07:00
Sergey Dmitriev 93b29d3882 Revert "[Clang][Bundler] Error reporting improvements"
This reverts commit dd501045cd.
2019-10-25 17:57:55 -07:00
John McCall baf91d02da [NFC] Add a tablegen node for the root of the AST node hierarchies.
This is useful for the property databases we want to add for abstract
serialization, since root classes can have interesting properties.
2019-10-25 16:39:21 -07:00
Sergey Dmitriev dd501045cd [Clang][Bundler] Error reporting improvements
- Changed FileHandler read/write methods to return llvm::Error
- Using unified way of reporting errors
- Removed trailing '.' from the error messages

Differential Revision: https://reviews.llvm.org/D67031
2019-10-25 16:29:57 -07:00
Michael Spencer 8da20560ab [clang][DependencyScanning] 80-col. 2019-10-25 15:43:57 -07:00
David Goldman 7a2b704bf0 [Sema][Typo Correction] Fix another infinite loop on ambiguity
See also: D67515

- For the given call expression we would end up repeatedly
   trying to transform the same expression over and over again

- Fix is to keep the old TransformCache when checking for ambiguity

Differential Revision: https://reviews.llvm.org/D69060
2019-10-25 13:20:27 -04:00
paulhoad 6df7ef0d8b [clang-format] [NFC] update the documentation in Format.h to allow dump_format_style.py to get a little closer to being correct.
Summary:
Running dump_format_style.py on the tip of the trunk causes ClangFormatStyleOptions.rst to have changes, which I think ideally it shouldn't.

Some recent commits have meant Format.h and ClangFormatStyleOptions.rst have become out of sync such that dump_format_style.py either couldn't be run or generated incorrect .rst files.

It's also important to remember to edit the IncludeStyles from Tooling.

Make a couple of changes {D6833} {D64695} which came from recent clang-format commits that missed this step. There are still a couple of other changes  from commit {D67541} {D68296} which also need to be looked at, but I'd like to park these first two changes first.

The authors of these original commits I've included in the reviewers, I'm happy to work on the changes, just really need to know which is the ground truth of the changes you want to keep (whats in the Format.h) or what is in the ClangFormatStyleOptions.rst

Reviewers: klimek, mitchell-stellar, owenpan, jvoung, Manikishan, sammccall

Reviewed By: mitchell-stellar

Subscribers: cfe-commits

Tags: #clang-format, #clang

Differential Revision: https://reviews.llvm.org/D69404
2019-10-25 14:46:19 +01:00
David Tenty 11c2a85db8 [NFC] Rename LLVM_NO_DEAD_STRIP
Summary:
The variable LLVM_NO_DEAD_STRIP is set in LLVM cmake files when building executables that might make use of plugins .The name of the variable does not convey the actual intended usage (i.e. for use with tools that have plugins), just what the eventual effect of setting in on some (i.e. not garbage collecting unused symbols).

This patch renames it to LLVM_SUPPORT_PLUGINS to convey the intended usage, which will allow subsequent patches to add behavior to support that in different ways without confusion about whether it will do on, for example, non-gnu platforms.

Reviewers: hubert.reinterpretcast, stevewan

Reviewed By: stevewan

Subscribers: cfe-commits, mgorny, llvm-commits

Tags: #llvm, #clang

Differential Revision: https://reviews.llvm.org/D69356
2019-10-25 09:32:00 -04:00
Haojian Wu 3d9632a997 [clang-rename] NFC, make getCanonicalSymbolDeclaration robust on nullptr input. 2019-10-25 14:33:04 +02:00