Commit Graph

77461 Commits

Author SHA1 Message Date
Alexey Bataev 123ad19691 [OPENMP]Delay emission of the error for unsupported types.
If the type is unsupported on the device side, it still must be emitted,
but we should emit errors for operations with such types.

llvm-svn: 355027
2019-02-27 20:29:45 +00:00
Akira Hatanaka b65a8ad761 Add triples to the test I committed in r355012 to fix windows bots.
llvm-svn: 355017
2019-02-27 18:59:52 +00:00
Akira Hatanaka c5792aa90f Avoid needlessly copying a block to the heap when a block literal
initializes a local auto variable or is assigned to a local auto
variable that is declared in the scope that introduced the block
literal.

rdar://problem/13289333

https://reviews.llvm.org/D58514

llvm-svn: 355012
2019-02-27 18:17:16 +00:00
David Goldman 3e804d2581 Support framework import/include auto-completion
Frameworks filesystem representations:
  UIKit.framework/Headers/%header%

Framework import format:
  #import <UIKit/%header%>

Thus the completion code must map the input format of <UIKit/> to
the path of UIKit.framework/Headers as well as strip the
".framework" suffix when auto-completing the framework name.

llvm-svn: 355008
2019-02-27 17:40:33 +00:00
Balazs Keri 9cf39dfb38 [ASTImporter] Improve import of FileID.
Summary:
Even if the content cache has a directory and filename, it may be a virtual file.
The old code returned with error in this case, but it is worth to try to handle
the file as it were a memory buffer.

Reviewers: a.sidorin, shafik, martong, a_sidorin

Reviewed By: shafik

Subscribers: efriedma, rnkovacs, cfe-commits, dkrupp, martong, Szelethus, gamesh411

Tags: #clang

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

llvm-svn: 355000
2019-02-27 16:31:48 +00:00
Yaxun Liu 785cbd850b [NFC] minor revision of r354929 [CUDA][HIP] Check calling convention based on function target
Add comments and move a variable to if block.

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

llvm-svn: 354990
2019-02-27 15:46:29 +00:00
Hans Wennborg 3fc81c29db AttrDocs.td: fix broken bullet-point indentation
llvm-svn: 354968
2019-02-27 13:11:37 +00:00
Yaxun Liu e739ac0e25 [HIP] change kernel stub name
Add .stub to kernel stub function name so that it is different from kernel
name in device code. This is necessary to let debugger find correct symbol
for kernel.

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

llvm-svn: 354948
2019-02-27 02:02:52 +00:00
Volodymyr Sapsai bc72061edf [index] Fixup for r354942. Specify target in test to achieve stable mangling.
llvm-svn: 354946
2019-02-27 01:37:43 +00:00
Volodymyr Sapsai 4b0f7f99ce [index] Improve indexing support for MSPropertyDecl.
Currently the symbol for MSPropertyDecl has kind `SymbolKind::Unknown`
which can trip up various indexing tools.

rdar://problem/46764224

Reviewers: akyrtzi, benlangmuir, jkorous

Reviewed By: jkorous

Subscribers: dexonsmith, cfe-commits, jkorous, jdoerfert, arphaman

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

llvm-svn: 354942
2019-02-27 01:04:53 +00:00
Joerg Sonnenberger 49ef2a4acd Fix inline assembler constraint validation
The current constraint logic is both too lax and too strict. It fails
for input outside the [INT_MIN..INT_MAX] range, but it also implicitly
accepts 0 as value when it should not. Adjust logic to handle both
correctly.

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

llvm-svn: 354937
2019-02-27 00:40:59 +00:00
Yaxun Liu fa49c3a888 [CUDA][HIP] Check calling convention based on function target
MSVC header files using vectorcall to differentiate overloaded functions, which
causes failure for AMDGPU target. This is because clang does not check function
calling convention based on function target.

This patch checks calling convention using the proper target info.

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

llvm-svn: 354929
2019-02-26 22:24:49 +00:00
Alexey Bataev 305b6b9647 [OPENMP][CUDA]Do not emit warnings for variables in late-reported asm
statements.

If the assembler instruction is not generated and the delayed diagnostic
is emitted, we may end up with extra warning message for variables used
in the asm statement. Since the asm statement is not built, the
variables may be left non-referenced and it may produce a warning about
a use of the non-initialized variables.

llvm-svn: 354928
2019-02-26 21:51:16 +00:00
Alexey Bataev ddc181d256 [OPENMP]Delay emission for unsupported va_arg expression.
If the OpenMP device is NVPTX and va_arg is used, delay emission of the
error for va_arg unless it is used in the device code.

llvm-svn: 354925
2019-02-26 20:52:16 +00:00
Reid Kleckner f9ef9f868c [MS] Don't emit coverage for deleting dtors
Summary:
The MS C++ ABI has no constructor variants, but it has destructor
variants, so we should move the deleting destructor variant check
outside the check for "does the ABI have constructor variants".

Fixes PR37561, so basic code coverage works on Windows with C++.

Reviewers: vsk

Subscribers: jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 354924
2019-02-26 20:42:52 +00:00
Tom Roeder 521f004e99 [ASTImporter] Add support for importing ChooseExpr AST nodes.
Summary:
This allows ASTs to be merged when they contain ChooseExpr (the GNU
__builtin_choose_expr construction). This is needed, for example, for
cross-CTU analysis of C code that makes use of __builtin_choose_expr.

The node is already supported in the AST, but it didn't have a matcher
in ASTMatchers. So, this change adds the matcher and adds support to
ASTImporter.

This was originally reviewed and approved in
https://reviews.llvm.org/D58292 and submitted as r354832. It was
reverted in r354839 due to failures on the Windows CI builds.

This version fixes the test failures on Windows, which were caused by
differences in template expansion between versions of clang on different
OSes. The version of clang built with MSVC and running on Windows never
expands the template in the C++ test in ImportExpr.ImportChooseExpr in
clang/unittests/AST/ASTImporter.cpp, but the version on Linux does for
the empty arguments and -fms-compatibility.

So, this version of the patch drops the C++ test for
__builtin_choose_expr, since that version was written to catch
regressions of the logic for isConditionTrue() in the AST import code
for ChooseExpr, and those regressions are also caught by
ASTImporterOptionSpecificTestBase.ImportChooseExpr, which does work on
Windows.

Reviewers: shafik, a_sidorin, martong, aaron.ballman, rnk, a.sidorin

Subscribers: cfe-commits, jdoerfert, rnkovacs, aaron.ballman

Tags: #clang

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

llvm-svn: 354916
2019-02-26 19:26:41 +00:00
Craig Topper 611a36b48b [X86] Add 'znver2' and 'cascadelake' to the __builtin_cpu_is test.
These are supported by at least libgcc trunk so we can include them now.

llvm-svn: 354915
2019-02-26 19:20:04 +00:00
Michael Liao 7557afa000 [AMDGPU] Allow using integral non-type template parameters
Summary:
- Allow using integral non-type template parameters in the following
  attributes

  __attribute__((amdgpu_flat_work_group_size(<min>, <max>)))
  __attribute__((amdgpu_waves_per_eu(<min>[, <max>])))

Reviewers: kzhuravl, yaxunl

Subscribers: jvesely, wdng, nhaehnle, dstuttard, tpr, t-tye, jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 354909
2019-02-26 18:49:36 +00:00
Ganesh Gopalasubramanian 4f171d2761 [X86] AMD znver2 enablement
This patch enables the following

1) AMD family 17h "znver2" tune flag (-march, -mcpu).
2) ISAs that are enabled for "znver2" architecture.
3) For the time being, it uses the znver1 scheduler model.
4) Tests are updated.
5) This patch is the clang counterpart to D58343

Reviewers: craig.topper
Tags: #clang

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

llvm-svn: 354899
2019-02-26 17:15:36 +00:00
Yaxun Liu d83c74028d [OpenCL] Fix assertion due to blocks
A recent change caused assertion in CodeGenFunction::EmitBlockCallExpr when a block is called.

There is code

  Func = CGM.getOpenCLRuntime().getInvokeFunction(E->getCallee());
getCalleeDecl calls Expr::getReferencedDeclOfCallee, which does not handle
BlockExpr and returns nullptr, which causes isa to assert.

This patch fixes that.

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

llvm-svn: 354893
2019-02-26 16:20:41 +00:00
Emilio Cobos Alvarez 0d76dc285c [libclang] Avoid crashing when getting layout info of an undeduced type.
When the type is not deducible, return an error instead of crashing.

This fixes https://bugs.llvm.org/show_bug.cgi?id=40813.

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

llvm-svn: 354885
2019-02-26 15:04:18 +00:00
Andrew Ng 301f304949 [clang-format] SpaceBeforeParens for lambda expressions
Add support for lambda expressions to the SpaceBeforeParens formatting
option.

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

llvm-svn: 354880
2019-02-26 14:34:49 +00:00
Kadir Cetinkaya a87ada0dad [clang][Index] Visit UsingDecls and generate USRs for them
Summary:
Add indexing of UsingDecl itself.
Also enable generation of USRs for UsingDecls, using the qualified name of the
decl.

Reviewers: ilya-biryukov, akyrtzi

Subscribers: arphaman, cfe-commits

Tags: #clang

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

llvm-svn: 354878
2019-02-26 14:23:12 +00:00
Pierre Gousseau 40ad3d2aa4 revert r354873 as this breaks lldb builds.
llvm-svn: 354875
2019-02-26 13:50:29 +00:00
Pierre Gousseau 44fad947a5 [Driver] Allow enum SanitizerOrdinal to represent more than 64 different sanitizer checks, NFC.
enum SanitizerOrdinal has reached maximum capacity, this change extends the capacity to 128 sanitizer checks.
This can eventually allow us to add gcc 8's options "-fsanitize=pointer-substract" and "-fsanitize=pointer-compare".

Fixes: https://llvm.org/PR39425

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

llvm-svn: 354873
2019-02-26 13:30:14 +00:00
Ilya Biryukov ff2a99752f [CodeComplete] Propagate preferred type for function arguments in more cases
Summary:
See the added test for some new cases.
This change also removes special code completion calls inside the
ParseExpressionList function now that we properly propagate expected
type to the function responsible for parsing elements of the expression list
(ParseAssignmentExpression).

Reviewers: kadircet

Reviewed By: kadircet

Subscribers: xbolva00, jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 354864
2019-02-26 11:01:50 +00:00
Alexander Potapenko 4f7bc0eee7 CodeGen: Explicitly initialize structure padding in the -ftrivial-auto-var-init mode
When generating initializers for local structures in the
-ftrivial-auto-var-init mode, explicitly wipe the padding bytes with
either 0x00 or 0xAA.

This will allow us to automatically handle the padding when splitting
the initialization stores (see https://reviews.llvm.org/D57898).

Reviewed at https://reviews.llvm.org/D58188

llvm-svn: 354861
2019-02-26 10:46:21 +00:00
Aaron Smith f0d2733e50 [CGDebugInfo] Set NonTrivial DIFlag to a c++ record if it's not trivial
This goes with https://reviews.llvm.org/D44406

llvm-svn: 354843
2019-02-26 03:49:05 +00:00
Reid Kleckner 1144084cb2 Revert r354832 "[ASTImporter] Add support for importing ChooseExpr AST nodes."
Test does not pass on Windows

llvm-svn: 354839
2019-02-26 02:22:22 +00:00
Reid Kleckner 2bc58bd06d [MS] Fix for Bug 8446, template instantiation without a 'typename' keyword
Patch by Zahira Ammarguellat!

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

llvm-svn: 354838
2019-02-26 02:22:17 +00:00
Tom Roeder 9a72870122 [ASTImporter] Add support for importing ChooseExpr AST nodes.
Summary:
This allows ASTs to be merged when they contain ChooseExpr (the GNU
__builtin_choose_expr construction). This is needed, for example, for
cross-CTU analysis of C code that makes use of __builtin_choose_expr.

The node is already supported in the AST, but it didn't have a matcher
in ASTMatchers. So, this change adds the matcher and adds support to
ASTImporter.

Reviewers: shafik, a_sidorin, martong, aaron.ballman

Subscribers: aaron.ballman, rnkovacs, jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 354832
2019-02-25 23:24:58 +00:00
JF Bastien 17aec7bd36 [NFC] Reorder some mis-ordered tests
I somehow had misaligned some of the tests when I originally wrote this. Re-order them properly.

llvm-svn: 354831
2019-02-25 23:09:34 +00:00
Alexander Kornienko 5858764f31 Reapply "Make static counters in ASTContext non-static." with fixes.
This reverts commit e50038e4dc.

llvm-svn: 354827
2019-02-25 22:22:09 +00:00
Erik Pilkington 55e703a550 [CodeGenObjC] Fix a nullptr dyn_cast
ObjCMessageExpr::getInstanceReceiver returns nullptr if the receiver
is 'super'. Make this check more strict, since we don't care about
messages to super here.

rdar://48247290

llvm-svn: 354826
2019-02-25 21:35:14 +00:00
Emilio Cobos Alvarez 0a3fe502e6 [libclang] Expose warn_unused and warn_unused_result attributes.
This is helpful to properly detect them, and fixing issues like
https://github.com/rust-lang/rust-bindgen/issues/1518.

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

llvm-svn: 354824
2019-02-25 21:24:52 +00:00
Emilio Cobos Alvarez 76004da1c9 [libclang] Fix a trivial error introduced in D57946.
The value for CXCursor_ConvergentAttr is not 420. I'm not really sure how easy
it is to test this, and I'm not familiar with the python bindings, just noticed
the error while looking at D57946 to write D58570.

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

llvm-svn: 354823
2019-02-25 21:15:34 +00:00
Michael Kruse 0336c75c36 [OpenMP 5.0] Parsing/sema support for from clause with mapper modifier.
This patch implements the parsing and sema support for the OpenMP
'from'-clause with potential user-defined mappers attached.
User-defined mappers are a new feature in OpenMP 5.0. A 'from'-clause
can have an explicit or implicit associated mapper, which instructs the
compiler to generate and use customized mapping functions. An example is
shown below:

    struct S { int len; int *d; };
    #pragma omp declare mapper(id: struct S s) map(s, s.d[0:s.len])
    struct S ss;
    #pragma omp target update from(mapper(id): ss) // use the mapper with name 'id' to map ss from device

Contributed-by: Lingda Li <lildmh@gmail.com>

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

llvm-svn: 354817
2019-02-25 20:34:15 +00:00
Vlad Tsyrklevich e50038e4dc Revert "Make static counters in ASTContext non-static."
This reverts commit r354795, I suspect it is causing test failures
on MSan sanitizer bots.

llvm-svn: 354812
2019-02-25 19:53:13 +00:00
Kristof Umann cd8c438086 [analyzer] Fix infinite recursion in printing macros
#define f(y) x
#define x f(x)
int main() { x; }

This example results a compilation error since "x" in the first line was not
defined earlier. However, the macro expression printer goes to an infinite
recursion on this example.

Patch by Tibor Brunner!

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

llvm-svn: 354806
2019-02-25 18:49:42 +00:00
Alexander Kornienko 00c22db89f Make static counters in ASTContext non-static.
Summary:
Fixes a data race and makes it possible to run clang-based tools in
multithreaded environment with TSan.

Reviewers: ilya-biryukov, riccibruno

Reviewed By: riccibruno

Subscribers: riccibruno, jfb, cfe-commits

Tags: #clang

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

llvm-svn: 354795
2019-02-25 16:08:46 +00:00
Luke Cheeseman 3e34150009 [AArch64] Add support for Cortex-A76 and Cortex-A76AE
- Add LLVM backend support for Cortex-A76 and Cortex-A76AE
- Documentation can be found at
  https://developer.arm.com/products/processors/cortex-a/cortex-a76

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

llvm-svn: 354789
2019-02-25 15:11:31 +00:00
Dmitri Gribenko a3a3964f98 Fixed typos in tests: s/CHEKC/CHECK/
Reviewers: ilya-biryukov

Subscribers: nemanjai, javed.absar, jsji, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

llvm-svn: 354785
2019-02-25 13:41:59 +00:00
Alexey Bader 3f62fa69a7 [SYCL] Add clang front-end option to enable SYCL device compilation flow.
Patch by Mariya Podchishchaeva <mariya.podchishchaeva@intel.com>

llvm-svn: 354773
2019-02-25 11:48:48 +00:00
Kristina Brooks 103799c060 Fix accidentally used hard tabs. NFC
Big sorry. This undoes the indentation mess I made
in r354751.

llvm-svn: 354752
2019-02-24 18:06:10 +00:00
Kristina Brooks 716cbfb464 Wrap code for builtin_assume_aligned at 80 col.NFC
Minor style fix to avoid going over 80 cols in handling
of case for Builtin::BI__builtin_assume_aligned. NFC.

llvm-svn: 354751
2019-02-24 17:57:33 +00:00
Michael Liao 7faef3d1a3 Typo: s/CHCCK/CHECK
llvm-svn: 354742
2019-02-24 03:10:14 +00:00
Michael Liao 8676f12ac6 [NFC] Minor coding style (indent) fix.
llvm-svn: 354741
2019-02-24 03:07:32 +00:00
Richard Smith 10ab78e854 Enable coroutines under -std=c++2a.
llvm-svn: 354736
2019-02-23 21:06:26 +00:00
Richard Smith 456e7afbca [cxx_status] Update to match Kona motions.
llvm-svn: 354735
2019-02-23 21:06:25 +00:00
Bruno Ricci d9381ae4f4 [NFC] Fix Wdocumentation warning in OMPToClause
llvm-svn: 354728
2019-02-23 16:40:30 +00:00