]> granicus.if.org Git - clang/log
clang
5 years ago[CTU] Do not allow different CPP dialects in CTU
Gabor Marton [Thu, 28 Feb 2019 15:24:59 +0000 (15:24 +0000)]
[CTU] Do not allow different CPP dialects in CTU

Summary:
If CPP dialects are different then return with error.

Consider this STL code:
  template<typename _Alloc>
    struct __alloc_traits
  #if __cplusplus >= 201103L
    : std::allocator_traits<_Alloc>
  #endif
    { // ...
    };
This class template would create ODR errors during merging the two units,
since in one translation unit the class template has a base class, however
in the other unit it has none.

Reviewers: xazax.hun, a_sidorin, r.stahl

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

Tags: #clang

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355096 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[clang][index-while-building][NFC] Comment about implementation detail in FileIndexRecord
Jan Korous [Thu, 28 Feb 2019 01:12:27 +0000 (01:12 +0000)]
[clang][index-while-building][NFC] Comment about implementation detail in FileIndexRecord

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355061 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoEnsure that set constrained asm operands are not affected by truncation.
Joerg Sonnenberger [Thu, 28 Feb 2019 00:55:09 +0000 (00:55 +0000)]
Ensure that set constrained asm operands are not affected by truncation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355058 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CodeGen] Fix some broken IR generated by -fsanitize=unsigned-integer-overflow
Erik Pilkington [Thu, 28 Feb 2019 00:47:55 +0000 (00:47 +0000)]
[CodeGen] Fix some broken IR generated by -fsanitize=unsigned-integer-overflow

I think the author of the function assumed that `GetInsertBlock()`
wouldn't change from where `atomicPHI` was created, but this isn't
true when `-fsanitize=unsigned-integer-overflow` is enabled (we
generate an overflow/continuation label). Fix by keeping track of the
block we want to return to to complete the cmpxchg loop.

rdar://48406558

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355054 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstrProf] Use separate comdat group for data and counters
Reid Kleckner [Wed, 27 Feb 2019 23:38:44 +0000 (23:38 +0000)]
[InstrProf] Use separate comdat group for data and counters

Summary:
I hadn't realized that instrumentation runs before inlining, so we can't
use the function as the comdat group. Doing so can create relocations
against discarded sections when references to discarded __profc_
variables are inlined into functions outside the function's comdat
group.

In the future, perhaps we should consider standardizing the comdat group
names that ELF and COFF use. It will save object file size, since
__profv_$sym won't appear in the symbol table again.

Reviewers: xur, vsk

Subscribers: eraman, hiraditya, cfe-commits, #sanitizers, llvm-commits

Tags: #clang, #sanitizers, #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355044 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[clang][index-while-building][NFC] FileIndexRecord - Comments, replace auto with...
Jan Korous [Wed, 27 Feb 2019 21:48:02 +0000 (21:48 +0000)]
[clang][index-while-building][NFC] FileIndexRecord - Comments, replace auto with type

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355036 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[clang][index-while-building] FileIndexRecord
Jan Korous [Wed, 27 Feb 2019 21:47:40 +0000 (21:47 +0000)]
[clang][index-while-building] FileIndexRecord

Basic data structures for index

Tests are missing from this patch - will be covered properly by tests for the whole feature.
I'm just trying to split into smaller patches to make it easier for reviewers.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355035 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoUse Secure PLT as default on NetBSD/PowerPC.
Joerg Sonnenberger [Wed, 27 Feb 2019 21:46:01 +0000 (21:46 +0000)]
Use Secure PLT as default on NetBSD/PowerPC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355033 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[OPENMP]Delay emission of the error for unsupported types.
Alexey Bataev [Wed, 27 Feb 2019 20:29:45 +0000 (20:29 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355027 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdd triples to the test I committed in r355012 to fix windows bots.
Akira Hatanaka [Wed, 27 Feb 2019 18:59:52 +0000 (18:59 +0000)]
Add triples to the test I committed in r355012 to fix windows bots.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355017 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAvoid needlessly copying a block to the heap when a block literal
Akira Hatanaka [Wed, 27 Feb 2019 18:17:16 +0000 (18:17 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355012 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoSupport framework import/include auto-completion
David Goldman [Wed, 27 Feb 2019 17:40:33 +0000 (17:40 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355008 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ASTImporter] Improve import of FileID.
Balazs Keri [Wed, 27 Feb 2019 16:31:48 +0000 (16:31 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355000 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC] minor revision of r354929 [CUDA][HIP] Check calling convention based on functio...
Yaxun Liu [Wed, 27 Feb 2019 15:46:29 +0000 (15:46 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354990 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAttrDocs.td: fix broken bullet-point indentation
Hans Wennborg [Wed, 27 Feb 2019 13:11:37 +0000 (13:11 +0000)]
AttrDocs.td: fix broken bullet-point indentation

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354968 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[HIP] change kernel stub name
Yaxun Liu [Wed, 27 Feb 2019 02:02:52 +0000 (02:02 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354948 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[index] Fixup for r354942. Specify target in test to achieve stable mangling.
Volodymyr Sapsai [Wed, 27 Feb 2019 01:37:43 +0000 (01:37 +0000)]
[index] Fixup for r354942. Specify target in test to achieve stable mangling.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354946 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[index] Improve indexing support for MSPropertyDecl.
Volodymyr Sapsai [Wed, 27 Feb 2019 01:04:53 +0000 (01:04 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354942 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix inline assembler constraint validation
Joerg Sonnenberger [Wed, 27 Feb 2019 00:40:59 +0000 (00:40 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354937 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CUDA][HIP] Check calling convention based on function target
Yaxun Liu [Tue, 26 Feb 2019 22:24:49 +0000 (22:24 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354929 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[OPENMP][CUDA]Do not emit warnings for variables in late-reported asm
Alexey Bataev [Tue, 26 Feb 2019 21:51:16 +0000 (21:51 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354928 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[OPENMP]Delay emission for unsupported va_arg expression.
Alexey Bataev [Tue, 26 Feb 2019 20:52:16 +0000 (20:52 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354925 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MS] Don't emit coverage for deleting dtors
Reid Kleckner [Tue, 26 Feb 2019 20:42:52 +0000 (20:42 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354924 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ASTImporter] Add support for importing ChooseExpr AST nodes.
Tom Roeder [Tue, 26 Feb 2019 19:26:41 +0000 (19:26 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354916 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Add 'znver2' and 'cascadelake' to the __builtin_cpu_is test.
Craig Topper [Tue, 26 Feb 2019 19:20:04 +0000 (19:20 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354915 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU] Allow using integral non-type template parameters
Michael Liao [Tue, 26 Feb 2019 18:49:36 +0000 (18:49 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354909 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] AMD znver2 enablement
Ganesh Gopalasubramanian [Tue, 26 Feb 2019 17:15:36 +0000 (17:15 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354899 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[OpenCL] Fix assertion due to blocks
Yaxun Liu [Tue, 26 Feb 2019 16:20:41 +0000 (16:20 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354893 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[libclang] Avoid crashing when getting layout info of an undeduced type.
Emilio Cobos Alvarez [Tue, 26 Feb 2019 15:04:18 +0000 (15:04 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354885 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[clang-format] SpaceBeforeParens for lambda expressions
Andrew Ng [Tue, 26 Feb 2019 14:34:49 +0000 (14:34 +0000)]
[clang-format] SpaceBeforeParens for lambda expressions

Add support for lambda expressions to the SpaceBeforeParens formatting
option.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354880 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[clang][Index] Visit UsingDecls and generate USRs for them
Kadir Cetinkaya [Tue, 26 Feb 2019 14:23:12 +0000 (14:23 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354878 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agorevert r354873 as this breaks lldb builds.
Pierre Gousseau [Tue, 26 Feb 2019 13:50:29 +0000 (13:50 +0000)]
revert r354873 as this breaks lldb builds.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354875 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Driver] Allow enum SanitizerOrdinal to represent more than 64 different sanitizer...
Pierre Gousseau [Tue, 26 Feb 2019 13:30:14 +0000 (13:30 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354873 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CodeComplete] Propagate preferred type for function arguments in more cases
Ilya Biryukov [Tue, 26 Feb 2019 11:01:50 +0000 (11:01 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354864 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoCodeGen: Explicitly initialize structure padding in the -ftrivial-auto-var-init mode
Alexander Potapenko [Tue, 26 Feb 2019 10:46:21 +0000 (10:46 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354861 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CGDebugInfo] Set NonTrivial DIFlag to a c++ record if it's not trivial
Aaron Smith [Tue, 26 Feb 2019 03:49:05 +0000 (03:49 +0000)]
[CGDebugInfo] Set NonTrivial DIFlag to a c++ record if it's not trivial

This goes with https://reviews.llvm.org/D44406

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354843 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert r354832 "[ASTImporter] Add support for importing ChooseExpr AST nodes."
Reid Kleckner [Tue, 26 Feb 2019 02:22:22 +0000 (02:22 +0000)]
Revert r354832 "[ASTImporter] Add support for importing ChooseExpr AST nodes."

Test does not pass on Windows

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354839 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MS] Fix for Bug 8446, template instantiation without a 'typename' keyword
Reid Kleckner [Tue, 26 Feb 2019 02:22:17 +0000 (02:22 +0000)]
[MS] Fix for Bug 8446, template instantiation without a 'typename' keyword

Patch by Zahira Ammarguellat!

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354838 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ASTImporter] Add support for importing ChooseExpr AST nodes.
Tom Roeder [Mon, 25 Feb 2019 23:24:58 +0000 (23:24 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354832 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC] Reorder some mis-ordered tests
JF Bastien [Mon, 25 Feb 2019 23:09:34 +0000 (23:09 +0000)]
[NFC] Reorder some mis-ordered tests

I somehow had misaligned some of the tests when I originally wrote this. Re-order them properly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354831 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoReapply "Make static counters in ASTContext non-static." with fixes.
Alexander Kornienko [Mon, 25 Feb 2019 22:22:09 +0000 (22:22 +0000)]
Reapply "Make static counters in ASTContext non-static." with fixes.

This reverts commit e50038e4dc53caee1acc811362ac0b15e00ef5eb.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354827 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CodeGenObjC] Fix a nullptr dyn_cast
Erik Pilkington [Mon, 25 Feb 2019 21:35:14 +0000 (21:35 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354826 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[libclang] Expose warn_unused and warn_unused_result attributes.
Emilio Cobos Alvarez [Mon, 25 Feb 2019 21:24:52 +0000 (21:24 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354824 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[libclang] Fix a trivial error introduced in D57946.
Emilio Cobos Alvarez [Mon, 25 Feb 2019 21:15:34 +0000 (21:15 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354823 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[OpenMP 5.0] Parsing/sema support for from clause with mapper modifier.
Michael Kruse [Mon, 25 Feb 2019 20:34:15 +0000 (20:34 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354817 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "Make static counters in ASTContext non-static."
Vlad Tsyrklevich [Mon, 25 Feb 2019 19:53:13 +0000 (19:53 +0000)]
Revert "Make static counters in ASTContext non-static."

This reverts commit r354795, I suspect it is causing test failures
on MSan sanitizer bots.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354812 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[analyzer] Fix infinite recursion in printing macros
Kristof Umann [Mon, 25 Feb 2019 18:49:42 +0000 (18:49 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354806 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoMake static counters in ASTContext non-static.
Alexander Kornienko [Mon, 25 Feb 2019 16:08:46 +0000 (16:08 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354795 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AArch64] Add support for Cortex-A76 and Cortex-A76AE
Luke Cheeseman [Mon, 25 Feb 2019 15:11:31 +0000 (15:11 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354789 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFixed typos in tests: s/CHEKC/CHECK/
Dmitri Gribenko [Mon, 25 Feb 2019 13:41:59 +0000 (13:41 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354785 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SYCL] Add clang front-end option to enable SYCL device compilation flow.
Alexey Bader [Mon, 25 Feb 2019 11:48:48 +0000 (11:48 +0000)]
[SYCL] Add clang front-end option to enable SYCL device compilation flow.

Patch by Mariya Podchishchaeva <mariya.podchishchaeva@intel.com>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354773 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix accidentally used hard tabs. NFC
Kristina Brooks [Sun, 24 Feb 2019 18:06:10 +0000 (18:06 +0000)]
Fix accidentally used hard tabs. NFC

Big sorry. This undoes the indentation mess I made
in r354751.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354752 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoWrap code for builtin_assume_aligned at 80 col.NFC
Kristina Brooks [Sun, 24 Feb 2019 17:57:33 +0000 (17:57 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354751 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoTypo: s/CHCCK/CHECK
Michael Liao [Sun, 24 Feb 2019 03:10:14 +0000 (03:10 +0000)]
Typo: s/CHCCK/CHECK

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354742 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC] Minor coding style (indent) fix.
Michael Liao [Sun, 24 Feb 2019 03:07:32 +0000 (03:07 +0000)]
[NFC] Minor coding style (indent) fix.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354741 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoEnable coroutines under -std=c++2a.
Richard Smith [Sat, 23 Feb 2019 21:06:26 +0000 (21:06 +0000)]
Enable coroutines under -std=c++2a.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354736 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[cxx_status] Update to match Kona motions.
Richard Smith [Sat, 23 Feb 2019 21:06:25 +0000 (21:06 +0000)]
[cxx_status] Update to match Kona motions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354735 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC] Fix Wdocumentation warning in OMPToClause
Bruno Ricci [Sat, 23 Feb 2019 16:40:30 +0000 (16:40 +0000)]
[NFC] Fix Wdocumentation warning in OMPToClause

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354728 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Sema][NFC] SequenceChecker: More tests in preparation for D57660
Bruno Ricci [Sat, 23 Feb 2019 16:25:00 +0000 (16:25 +0000)]
[Sema][NFC] SequenceChecker: More tests in preparation for D57660

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354727 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRemove OpenBSD case for old system libstdc++ header path as OpenBSD
Brad Smith [Sat, 23 Feb 2019 07:21:19 +0000 (07:21 +0000)]
Remove OpenBSD case for old system libstdc++ header path as OpenBSD
has switched to libc++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354723 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRemove sanitizer context workaround no longer necessary
Brad Smith [Sat, 23 Feb 2019 06:19:28 +0000 (06:19 +0000)]
Remove sanitizer context workaround no longer necessary

The base linker is now lld.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354721 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[OpenMP 5.0] Parsing/sema support for to clause with mapper modifier.
Michael Kruse [Fri, 22 Feb 2019 22:29:42 +0000 (22:29 +0000)]
[OpenMP 5.0] Parsing/sema support for to clause with mapper modifier.

This patch implements the parsing and sema support for OpenMP to clause
with potential user-defined mappers attached. User defined mapper is a
new feature in OpenMP 5.0. A to/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 to(mapper(id): ss) // use the mapper with name 'id' to map ss to device

Contributed-by: <lildmh@gmail.com>
Differential Revision: https://reviews.llvm.org/D58523

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354698 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[clang] Only provide C11 features in <float.h> starting with C++17
Louis Dionne [Fri, 22 Feb 2019 20:48:54 +0000 (20:48 +0000)]
[clang] Only provide C11 features in <float.h> starting with C++17

Summary:
In r353970, I enabled those features in C++11 and above. To be strictly
conforming, those features should only be enabled in C++17 and above.

Reviewers: jfb, eli.friedman

Subscribers: jkorous, dexonsmith, libcxx-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354691 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[OPENMP] Delayed diagnostics for VLA support.
Alexey Bataev [Fri, 22 Feb 2019 20:36:10 +0000 (20:36 +0000)]
[OPENMP] Delayed diagnostics for VLA support.

Generalized processing of the deferred diagnostics for OpenMP/CUDA code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354690 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix "not all control paths return" warning. NFCI.
Simon Pilgrim [Fri, 22 Feb 2019 17:37:59 +0000 (17:37 +0000)]
Fix "not all control paths return" warning. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354681 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "[OPENMP] Delayed diagnostics for VLA support."
Alexey Bataev [Fri, 22 Feb 2019 17:16:50 +0000 (17:16 +0000)]
Revert "[OPENMP] Delayed diagnostics for VLA support."

This reverts commit r354679 to fix the problem with the Windows
buildbots

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354680 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[OPENMP] Delayed diagnostics for VLA support.
Alexey Bataev [Fri, 22 Feb 2019 16:49:13 +0000 (16:49 +0000)]
[OPENMP] Delayed diagnostics for VLA support.

Generalized processing of the deferred diagnostics for OpenMP/CUDA code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354679 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoCodeGen: use COMDAT for block copy/destroy helpers
Saleem Abdulrasool [Fri, 22 Feb 2019 16:29:50 +0000 (16:29 +0000)]
CodeGen: use COMDAT for block copy/destroy helpers

SVN r339438 added support to deduplicate the helpers by using a consistent
naming scheme and using LinkOnceODR semantics.  This works on ELF by means of
weak linking semantics, and entirely does not work on PE/COFF where you end up
with multiply defined strong symbols, which is a strong error on PE/COFF.
Assign the functions a COMDAT group so that they can be uniqued by the linker.
This fixes the use of blocks in CoreFoundation on Windows.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354678 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CUDA]Delayed diagnostics for the asm instructions.
Alexey Bataev [Fri, 22 Feb 2019 14:42:48 +0000 (14:42 +0000)]
[CUDA]Delayed diagnostics for the asm instructions.

Adapted targetDiag for the CUDA and used for the delayed diagnostics in
asm constructs. Works for both host and device compilation sides.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354671 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agorevert r354615: [HIP] change kernel stub name
Yaxun Liu [Fri, 22 Feb 2019 04:20:12 +0000 (04:20 +0000)]
revert r354615: [HIP] change kernel stub name

It caused regressions.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354651 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[analyzer] MIGChecker: Enable by default as `osx.MIG'.
Artem Dergachev [Fri, 22 Feb 2019 00:18:46 +0000 (00:18 +0000)]
[analyzer] MIGChecker: Enable by default as `osx.MIG'.

With r354643, the checker is feature-rich and polished enough.

rdar://problem/35380337

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354644 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[analyzer] MIGChecker: Add support for more APIs.
Artem Dergachev [Fri, 22 Feb 2019 00:15:14 +0000 (00:15 +0000)]
[analyzer] MIGChecker: Add support for more APIs.

Add more "consuming" functions. For now only vm_deallocate() was supported.

Add a non-zero value that isn't an error; this value is -305 ("MIG_NO_REPLY")
and it's fine to deallocate data when you are returning this error.

Make sure that the mig_server_routine annotation is inherited.

rdar://problem/35380337

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354643 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[analyzer] MIGChecker: Fix an FN when the object is released in a destructor.
Artem Dergachev [Fri, 22 Feb 2019 00:09:56 +0000 (00:09 +0000)]
[analyzer] MIGChecker: Fix an FN when the object is released in a destructor.

When a MIG server routine argument is released in an automatic destructor,
the Static Analyzer thinks that this happens after the return statement, and so
the violation of the MIG convention doesn't happen.

Of course, it doesn't quite work that way, so this is a false negative.

Add a hack that makes the checker double-check at the end of function
that no argument was released when the routine fails with an error.

rdar://problem/35380337

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354642 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[analyzer] MIGChecker: Improve intermediate diagnostic notes.
Artem Dergachev [Fri, 22 Feb 2019 00:06:30 +0000 (00:06 +0000)]
[analyzer] MIGChecker: Improve intermediate diagnostic notes.

Add a BugReporterVisitor for highlighting the events of deallocating a
parameter. All such events are relevant to the emitted report (as long as the
report is indeed emitted), so all of them will get highlighted.

Add a trackExpressionValue visitor for highlighting where does the error return
code come from.

Do not add a trackExpressionValue visitor for highlighting how the deallocated
argument(s) was(were) copied around. This still remains to be implemented.

rdar://problem/35380337

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354641 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[analyzer] MIGChecker: Take advantage of the mig_server_routine annotation.
Artem Dergachev [Fri, 22 Feb 2019 00:02:47 +0000 (00:02 +0000)]
[analyzer] MIGChecker: Take advantage of the mig_server_routine annotation.

r354530 has added a new function/block/message attribute "mig_server_routine"
that attracts compiler's attention to functions that need to follow the MIG
server routine convention with respect to deallocating out-of-line data that
was passed to them as an argument.

Teach the checker to identify MIG routines by looking at this attribute,
rather than by making heuristic-based guesses.

rdar://problem/35380337

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354638 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[analyzer] MIGChecker: A checker for Mach Interface Generator conventions.
Artem Dergachev [Thu, 21 Feb 2019 23:55:28 +0000 (23:55 +0000)]
[analyzer] MIGChecker: A checker for Mach Interface Generator conventions.

This checker detects use-after-free bugs in (various forks of) the Mach kernel
that are caused by errors in MIG server routines - functions called remotely by
MIG clients. The MIG convention forces the server to only deallocate objects
it receives from the client when the routine is executed successfully.
Otherwise, if the server routine exits with an error, the client assumes that
it needs to deallocate the out-of-line data it passed to the server manually.
This means that deallocating such data within the MIG routine and then returning
a non-zero error code is always a dangerous use-after-free bug.

rdar://problem/35380337

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354635 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoUse _Q as MS ABI mangling for char8_t.
Richard Smith [Thu, 21 Feb 2019 23:04:35 +0000 (23:04 +0000)]
Use _Q as MS ABI mangling for char8_t.

Thanks to Yuriy Solodkyy for letting us know the mangling here.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354633 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[clang-cl] Whitelist -fbracket-depth=123 in clang-cl
Reid Kleckner [Thu, 21 Feb 2019 21:53:12 +0000 (21:53 +0000)]
[clang-cl] Whitelist -fbracket-depth=123 in clang-cl

Users apparently need it when expanding large quantities of macros.

Fixes PR38685

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354626 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU: Don't emit debugger subtarget features
Matt Arsenault [Thu, 21 Feb 2019 21:31:43 +0000 (21:31 +0000)]
AMDGPU: Don't emit debugger subtarget features

Keep the flag around for compatability.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354624 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Driver] Fix float ABI default for Android ARMv8.
Dan Albert [Thu, 21 Feb 2019 21:13:03 +0000 (21:13 +0000)]
[Driver] Fix float ABI default for Android ARMv8.

Summary: Android doesn't regress back to soft float after ARMv7 :)

Reviewers: srhines, pirama

Reviewed By: srhines, pirama

Subscribers: javed.absar, kristof.beyls, cfe-commits

Tags: #clang

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354622 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Fixed Point Arithmetic] Fixed Point Comparisons
Leonard Chan [Thu, 21 Feb 2019 20:50:09 +0000 (20:50 +0000)]
[Fixed Point Arithmetic] Fixed Point Comparisons

This patch implements fixed point comparisons with other fixed point types and
integers. This also provides constant expression evaluation for them.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354621 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[HIP] change kernel stub name
Yaxun Liu [Thu, 21 Feb 2019 20:12:16 +0000 (20:12 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354615 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CodeGen] Fix string literal address space casting.
Michael Liao [Thu, 21 Feb 2019 19:40:20 +0000 (19:40 +0000)]
[CodeGen] Fix string literal address space casting.

Summary:
- If a string literal is reused directly, need to add necessary address
  space casting if the target requires that.

Reviewers: yaxunl

Subscribers: jvesely, cfe-commits

Tags: #clang

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354610 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[test] Fix typo: 's/ ot / to /' [NFC]
Mandeep Singh Grang [Thu, 21 Feb 2019 19:11:15 +0000 (19:11 +0000)]
[test] Fix typo: 's/ ot / to /' [NFC]

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354608 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "[CUDA]Delayed diagnostics for the asm instructions."
Alexey Bataev [Thu, 21 Feb 2019 16:40:21 +0000 (16:40 +0000)]
Revert "[CUDA]Delayed diagnostics for the asm instructions."

This reverts commit r354593 to fix the problem with the crash on
windows.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354596 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CUDA]Delayed diagnostics for the asm instructions.
Alexey Bataev [Thu, 21 Feb 2019 15:51:30 +0000 (15:51 +0000)]
[CUDA]Delayed diagnostics for the asm instructions.

Summary:
Adapted targetDiag for the CUDA and used for the delayed diagnostics in
asm constructs. Works for both host and device compilation sides.

Reviewers: tra, jlebar

Subscribers: jdoerfert, cfe-commits

Tags: #clang

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354593 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CodeComplete] Collect visited contexts when scope specifier is invalid.
Eric Liu [Thu, 21 Feb 2019 11:22:58 +0000 (11:22 +0000)]
[CodeComplete] Collect visited contexts when scope specifier is invalid.

Summary:
This will allow completion consumers to guess the specified scope by
putting together scopes in the context with the specified scope (e.g. when the
specified namespace is not imported yet).

Reviewers: ilya-biryukov

Subscribers: jdoerfert, cfe-commits

Tags: #clang

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354570 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[OpenCL] Simplify LLVM IR generated for OpenCL blocks
Andrew Savonichev [Thu, 21 Feb 2019 11:02:10 +0000 (11:02 +0000)]
[OpenCL] Simplify LLVM IR generated for OpenCL blocks

Summary:
Emit direct call of block invoke functions when possible, i.e. in case the
block is not passed as a function argument.
Also doing some refactoring of `CodeGenFunction::EmitBlockCallExpr()`

Reviewers: Anastasia, yaxunl, svenvh

Reviewed By: Anastasia

Subscribers: cfe-commits

Tags: #clang

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354568 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[clang][Index] Enable indexing of Template Type Parameters behind a flag
Kadir Cetinkaya [Thu, 21 Feb 2019 09:52:33 +0000 (09:52 +0000)]
[clang][Index] Enable indexing of Template Type Parameters behind a flag

Summary:
clangd uses indexing api to provide references and it was not possible
to perform symbol information for template parameters. This patch enables
visiting of TemplateTypeParmTypeLocs.

Reviewers: ilya-biryukov, akyrtzi

Subscribers: javed.absar, kristof.beyls, ioeric, arphaman, cfe-commits

Tags: #clang

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354560 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert r354546
Serge Guelton [Thu, 21 Feb 2019 06:59:21 +0000 (06:59 +0000)]
Revert r354546

This triggers an ICE on gcc 7, see http://lab.llvm.org:8011/builders/clang-cmake-aarch64-quick/builds/17598/steps/build%20stage%201/logs/stdio

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354549 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix typo in r354546
Serge Guelton [Thu, 21 Feb 2019 06:12:41 +0000 (06:12 +0000)]
Fix typo in r354546

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354548 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC] Always initialize all members in ABIArgInfo
Serge Guelton [Thu, 21 Feb 2019 04:55:50 +0000 (04:55 +0000)]
[NFC] Always initialize all members in ABIArgInfo

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354546 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AArch64] Change size suffix for FP16FML intrinsics.
Ahmed Bougacha [Thu, 21 Feb 2019 01:13:27 +0000 (01:13 +0000)]
[AArch64] Change size suffix for FP16FML intrinsics.

These currently use _u32, but they should instead use _f16, the
types of the multiplication (matching the various integer vmlal
variants).

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354538 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[attributes] Fix buildbot after r354530.
Artem Dergachev [Thu, 21 Feb 2019 00:19:24 +0000 (00:19 +0000)]
[attributes] Fix buildbot after r354530.

Update the test after adding more attribute subjects.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354531 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[attributes] Add an attribute for server routines in Mach kernel and extensions.
Artem Dergachev [Thu, 21 Feb 2019 00:01:02 +0000 (00:01 +0000)]
[attributes] Add an attribute for server routines in Mach kernel and extensions.

The new __attribute__ ((mig_server_routine)) is going to be used for annotating
Mach Interface Generator (MIG) callback functions as such, so that additional
static analysis could be applied to their implementations. It can also be
applied to regular functions behavior of which is supposed to be identical to
that of a MIG server routine.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354530 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[clang] Add CMake target for installing clang's CMake exports
Shoaib Meenai [Wed, 20 Feb 2019 23:16:15 +0000 (23:16 +0000)]
[clang] Add CMake target for installing clang's CMake exports

This mirrors LLVM's install-cmake-exports target.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354527 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[clang] Switch to LLVM_ENABLE_IDE
Shoaib Meenai [Wed, 20 Feb 2019 23:08:43 +0000 (23:08 +0000)]
[clang] Switch to LLVM_ENABLE_IDE

r344555 switched LLVM to guarding install targets with LLVM_ENABLE_IDE
instead of CMAKE_CONFIGURATION_TYPES, which expresses the intent more
directly and can be overridden by a user. Make the corresponding change
in clang. LLVM_ENABLE_IDE is computed by HandleLLVMOptions, so it should
be available for both standalone and integrated builds.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354525 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoMake predefined FLT16 macros conditional on support for the type
Nemanja Ivanovic [Wed, 20 Feb 2019 20:27:33 +0000 (20:27 +0000)]
Make predefined FLT16 macros conditional on support for the type

We unconditionally predefine these macros. However, they may be used to
determine if the type is supported. In that case, there are unnecessary
failures to compile the code.

This is the proposed fix for https://bugs.llvm.org/show_bug.cgi?id=40559

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354512 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[OPENMP] Use targetDiag for diagnostics of unsupported exceptions, NFC.
Alexey Bataev [Wed, 20 Feb 2019 19:37:17 +0000 (19:37 +0000)]
[OPENMP] Use targetDiag for diagnostics of unsupported exceptions, NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354509 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix remaining semicolon pedantic errors for intel
Gabor Marton [Wed, 20 Feb 2019 19:07:36 +0000 (19:07 +0000)]
Fix remaining semicolon pedantic errors for intel

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354503 91177308-0d34-0410-b5e6-96231b3b80d8