]> granicus.if.org Git - clang/log
clang
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

5 years ago[Clang Driver] Add support for "-static-pie" argument to the Clang driver.
Siva Chandra [Wed, 20 Feb 2019 19:07:04 +0000 (19:07 +0000)]
[Clang Driver] Add support for "-static-pie" argument to the Clang driver.

Summary: This change mimics GCC's support for the "-static-pie" argument.

Subscribers: cfe-commits

Tags: #clang

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

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

5 years ago[OPENMP] Delay emission of the asm target-specific error messages.
Alexey Bataev [Wed, 20 Feb 2019 17:42:57 +0000 (17:42 +0000)]
[OPENMP] Delay emission of the asm target-specific error messages.

Summary:
Added the ability to emit target-specific builtin assembler error
messages only in case if the function is really is going to be emitted
for the device.

Reviewers: rjmccall

Subscribers: guansong, jdoerfert, cfe-commits

Tags: #clang

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

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

5 years agoFix compile error with Intel's compiler (-Werror=pedantic)
Gabor Marton [Wed, 20 Feb 2019 16:57:41 +0000 (16:57 +0000)]
Fix compile error with Intel's compiler (-Werror=pedantic)

An extra semicolon at the end of macro invocations caused a build bot
failure for Intel's compiler when pedantic is turned on.

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

5 years ago[CodeGen] Enable the complex-math test for arm
Petr Hosek [Wed, 20 Feb 2019 16:53:08 +0000 (16:53 +0000)]
[CodeGen] Enable the complex-math test for arm

This test wasn't running due to a missing : after the RUN statement.
Enabling this test revealed that it's actually broken.

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

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

5 years ago[OPENMP][NVPTX]Use faster teams reduction algorithm.
Alexey Bataev [Wed, 20 Feb 2019 16:36:22 +0000 (16:36 +0000)]
[OPENMP][NVPTX]Use faster teams reduction algorithm.

A faster way to reduce the values in teams reductions was found, the
codegen is updated to use this faster algorithm and new runtime functions.

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

5 years ago[clang-format] Do not emit replacements if Java imports are OK
Krasimir Georgiev [Wed, 20 Feb 2019 11:44:21 +0000 (11:44 +0000)]
[clang-format] Do not emit replacements if Java imports are OK

Summary:
Currently clang-format would always emit a replacement for a block of Java imports even if it is correctly formatted:
```
% cat /tmp/Aggregator.java
import X;
% clang-format /tmp/Aggregator.java
import X;
% clang-format -output-replacements-xml /tmp/Aggregator.java
<?xml version='1.0'?>
<replacements xml:space='preserve' incomplete_format='false'>
<replacement offset='0' length='9'>import X;</replacement>
</replacements>
%
```
This change makes clang-format not emit replacements in this case. Note that
there is logic to not emit replacements in this case for C++.

Reviewers: ioeric

Reviewed By: ioeric

Subscribers: jdoerfert, cfe-commits

Tags: #clang

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

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

5 years agoLimit new PM tests to X86 registered targets.
Leonard Chan [Wed, 20 Feb 2019 05:07:14 +0000 (05:07 +0000)]
Limit new PM tests to X86 registered targets.

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

5 years agoRemove test on incompatible mpis target.
Leonard Chan [Wed, 20 Feb 2019 04:35:28 +0000 (04:35 +0000)]
Remove test on incompatible mpis target.

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

5 years ago[NewPM] Add other sanitizers at O0
Leonard Chan [Wed, 20 Feb 2019 03:50:11 +0000 (03:50 +0000)]
[NewPM] Add other sanitizers at O0

This allows for MSan and TSan to be used without optimizations required.

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

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

5 years agoCMake: Fix stand-alone clang builds since r353268
Tom Stellard [Wed, 20 Feb 2019 01:11:05 +0000 (01:11 +0000)]
CMake: Fix stand-alone clang builds since r353268

Summary:
Handle the case where LLVM_MAIN_SRC_DIR is not set and also use
LLVM_CMAKE_DIR for locating installed cmake files rather than
LLVM_CMAKE_PATH.

Reviewers: phosek, andrewrk, smeenai

Reviewed By: phosek, andrewrk, smeenai

Subscribers: mgorny, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

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

5 years agoRemove extraneous space in MSVC-style diagnostic output
Hans Wennborg [Tue, 19 Feb 2019 16:58:25 +0000 (16:58 +0000)]
Remove extraneous space in MSVC-style diagnostic output

There was an extra space between the file location and the diagnostic
message:

  /tmp/a.c(1,12):  warning: unused parameter 'unused'

the tests didn't catch this due to FileCheck not running in --strict-whitespace mode.

Reported by Marco: http://lists.llvm.org/pipermail/cfe-dev/2019-February/061326.html

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

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

5 years ago[OpenMP 5.0] Parsing/sema support for map clause with mapper modifier.
Michael Kruse [Tue, 19 Feb 2019 16:38:20 +0000 (16:38 +0000)]
[OpenMP 5.0] Parsing/sema support for map clause with mapper modifier.

This patch implements the parsing and sema support for OpenMP map
clauses with potential user-defined mapper attached. User defined mapper
is a new feature in OpenMP 5.0. A map clause can have an explicit or
implicit associated mapper, which instructs the compiler to generate
extra data mapping. 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 map(mapper(id) tofrom: ss) // use the mapper with name 'id' to map ss

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

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

5 years ago[OpenCL] Change type of block pointer for OpenCL
Alexey Bader [Tue, 19 Feb 2019 15:19:06 +0000 (15:19 +0000)]
[OpenCL] Change type of block pointer for OpenCL

Summary:

For some reason OpenCL blocks in LLVM IR are represented as function pointers.
These pointers do not point to any real function and never get called. Actually
they point to some structure, which in turn contains pointer to the real block
invoke function.
This patch changes represntation of OpenCL blocks in LLVM IR from function
pointers to pointers to `%struct.__block_literal_generic`.
Such representation allows to avoid unnecessary bitcasts and simplifies
further processing (e.g. translation to SPIR-V ) of the module for targets
which do not support function pointers.

Patch by: Alexey Sotkin.

Reviewers: Anastasia, yaxunl, svenvh

Reviewed By: Anastasia

Subscribers: alexbatashev, cfe-commits

Tags: #clang

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

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

5 years ago[clang][test] Fix FileManagerTest.getFileDontOpenRealPath for Windows
Jan Korous [Mon, 18 Feb 2019 23:12:29 +0000 (23:12 +0000)]
[clang][test] Fix FileManagerTest.getFileDontOpenRealPath for Windows

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

5 years agoReland "[clang][FileManager] fillRealPathName even if we aren't opening the file"
Jan Korous [Mon, 18 Feb 2019 22:33:40 +0000 (22:33 +0000)]
Reland "[clang][FileManager] fillRealPathName even if we aren't opening the file"

This reverts commit e2bb3121fd4ab5b01f9ec1d2e3e9877db9c6a54c.
+ fixed test for Windows

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

5 years ago[ASTImporter] Find previous friend function template
Gabor Marton [Mon, 18 Feb 2019 13:09:27 +0000 (13:09 +0000)]
[ASTImporter] Find previous friend function template

Reviewers: a_sidorin, shafik, a.sidorin

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

Tags: #clang

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

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

5 years ago[ARM] Add pre-defined macros for ROPI and RWPI
Oliver Stannard [Mon, 18 Feb 2019 12:39:47 +0000 (12:39 +0000)]
[ARM] Add pre-defined macros for ROPI and RWPI

This adds ACLE-defined macros to test for code being compiled in the ROPI and
RWPI position-independence modes.

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

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

5 years ago[clang][Index] Fix usage of IndexImplicitInstantiation
Kadir Cetinkaya [Mon, 18 Feb 2019 11:30:43 +0000 (11:30 +0000)]
[clang][Index] Fix usage of IndexImplicitInstantiation

Summary:
Indexing context was skipping explicit template instantiations as well.
This patch makes sure it only skips implicit ones.

Subscribers: arphaman, jdoerfert, cfe-commits

Tags: #clang

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

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

5 years ago[ASTImporter] Unify redecl chain tests as type parameterized tests
Gabor Marton [Mon, 18 Feb 2019 11:09:56 +0000 (11:09 +0000)]
[ASTImporter] Unify redecl chain tests as type parameterized tests

Summary:
This patch unifies all those tests which check the correctness of the
redecl chains. Previously we had several structurally very similar test
cases for each language construct (class, function, variable, function
template, ...).

We still use value-parameterized tests for the different AST
compatibility switches (-fdelayed-template-parsing, -fms-compatibility).
Gtest makes it possible to have either value-parameterized or
type-parameterized fixtures. However, we cannot have both value- and
type-parameterized test fixtures. So we use a value-parameterized test
fixture in the gtest sense. We intend to mimic gtest's type-parameters
via the type template parameter. We manually instantiate the different
tests with the each types.

After this patch I am planning to put the "generic redecl chain" related
tests into their own separate test file (in another patch).

Reviewers: a_sidorin, shafik, a.sidorin

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

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

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

5 years ago[analyzer] Make valist.Uninitialized depend on ValistBase
Kristof Umann [Sun, 17 Feb 2019 19:51:42 +0000 (19:51 +0000)]
[analyzer] Make valist.Uninitialized depend on ValistBase

Accidentally left this dependency out, resulting in an assert failure if
only valist.Uninitialized is enabled from the valist package.

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

5 years ago[NFC] Add a llvm_unreachable to silence a warning in SubstObjCTypeArgsVisitor
Bruno Ricci [Sun, 17 Feb 2019 19:18:38 +0000 (19:18 +0000)]
[NFC] Add a llvm_unreachable to silence a warning in SubstObjCTypeArgsVisitor

All cases in the switch are covered. NFC.

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

5 years agoRecommit "[AST] Factor out the logic of the various Expr::Ignore*"
Bruno Ricci [Sun, 17 Feb 2019 18:50:51 +0000 (18:50 +0000)]
Recommit "[AST] Factor out the logic of the various Expr::Ignore*"

(Originally commited in r354215 and reverted in r354216 because of a
 missed failing clang-tidy test (fix in r354228))

Now that the implementation of all of the Expr::Ignore* is in Expr.cpp
we can try to remove some duplication. Do this by separating the logic
of the Expr::Ignore* from the iterative loop.

This is NFC, except for one change: IgnoreParenImpCasts now skips,
among other things, everything that IgnoreImpCasts skips. This means
FullExpr are now skipped by IgnoreParenImpCasts. This was likely an
oversight when FullExpr was added to the nodes skipped by IgnoreImpCasts.

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

Reviewed By: aaron.ballman (with comments from void and rnk)

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

5 years ago[RISCV] Default enable RISCV linker relaxation
Shiva Chen [Sun, 17 Feb 2019 16:05:51 +0000 (16:05 +0000)]
[RISCV] Default enable RISCV linker relaxation

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

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

5 years agoRevert "[AST] Factor out the logic of the various Expr::Ignore*"
Bruno Ricci [Sun, 17 Feb 2019 13:47:29 +0000 (13:47 +0000)]
Revert "[AST] Factor out the logic of the various Expr::Ignore*"

This breaks some clang-tidy checks. For some reason they were
not included in check-clang ?

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

5 years ago[AST] Factor out the logic of the various Expr::Ignore*
Bruno Ricci [Sun, 17 Feb 2019 13:32:39 +0000 (13:32 +0000)]
[AST] Factor out the logic of the various Expr::Ignore*

Now that the implementation of all of the Expr::Ignore* is in Expr.cpp
we can try to remove some duplication. Do this by separating the logic of
the Expr::Ignore* from the iterative loop.

This is NFC, except for one change: IgnoreParenImpCasts now skips, among
other things, everything that IgnoreImpCasts skips. This means FullExpr
are now skipped by IgnoreParenImpCasts. This was likely an oversight when
FullExpr was added to the nodes skipped by IgnoreImpCasts.

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

Reviewed By: aaron.ballman (with comments from void and rnk)

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

5 years ago[X86] Prevent clang clobber checking for asm flag constraints.
Nirav Dave [Sun, 17 Feb 2019 03:53:23 +0000 (03:53 +0000)]
[X86] Prevent clang clobber checking for asm flag constraints.

Update getConstraintRegister as X86 Asm flag output constraints are no
longer fully alphanumeric,

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

5 years ago[Driver][Gnu] Support -nolibc flag
Petr Hosek [Sun, 17 Feb 2019 02:42:48 +0000 (02:42 +0000)]
[Driver][Gnu] Support -nolibc flag

This can be used to disable libc linking. This flag is supported by
GCC since version 9 as well as some Clang target toolchains.

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

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

5 years ago[Driver][Fuchsia] Support -nolibc flag
Petr Hosek [Sun, 17 Feb 2019 01:02:40 +0000 (01:02 +0000)]
[Driver][Fuchsia] Support -nolibc flag

This can be used to disable libc linking. This flag is supported by
GCC since version 9 as well as some Clang target toolchains. This
change also includes tests for all -no* flags which previously weren't
covered.

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

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

5 years agoMove multiline raw string literal out of macro. NFC
David Green [Sat, 16 Feb 2019 11:19:04 +0000 (11:19 +0000)]
Move multiline raw string literal out of macro. NFC

Certain combinations of gcc and ccache fail when the raw
string literal is preprocessed. This just moves the string
out as is done elsewhere in the same file.

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

5 years agoFix some tests I broke in r354190
Erik Pilkington [Sat, 16 Feb 2019 01:51:19 +0000 (01:51 +0000)]
Fix some tests I broke in r354190

This was breaking on MSVC, since long double and double have the same
semantics there.

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

5 years ago[Sema] Diagnose floating point conversions based on target semantics
Erik Pilkington [Sat, 16 Feb 2019 01:11:47 +0000 (01:11 +0000)]
[Sema] Diagnose floating point conversions based on target semantics

...instead of just comparing rank. Also, fix a bad warning about
_Float16, since its declared out of order in BuiltinTypes.def,
meaning comparing rank using BuiltinType::getKind() is incorrect.

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

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

5 years ago[ObjC generics] Fix applying `__kindof` to the type parameter.
Volodymyr Sapsai [Sat, 16 Feb 2019 01:01:08 +0000 (01:01 +0000)]
[ObjC generics] Fix applying `__kindof` to the type parameter.

Fixes the warning about incompatible pointer types on assigning to a
subclass of type argument an expression of type `__kindof TypeParam`.

We already have a mechanism in `ASTContext::canAssignObjCInterfaces`
that handles `ObjCObjectType` with `__kindof`. But it wasn't triggered
because during type substitution `__kindof TypeParam` was represented as
`AttributedType` with attribute `ObjCKindOf` and equivalent type
`TypeArg`. For assignment type checking we use canonical types so
attributed type was desugared and the attribute was ignored.

The fix is in checking transformed `AttributedType` and pushing
`__kindof` down into `ObjCObjectType` when necessary.

rdar://problem/38514910

Reviewers: ahatanak, erik.pilkington, doug.gregor

Reviewed By: doug.gregor

Subscribers: jkorous, dexonsmith, manmanren, jordan_rose, doug.gregor, cfe-commits

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

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

5 years agoclang-format with UseTab: Always sometimes doesn't insert the right amount of tabs.
Alexander Kornienko [Fri, 15 Feb 2019 23:07:43 +0000 (23:07 +0000)]
clang-format with UseTab: Always sometimes doesn't insert the right amount of tabs.

Trailing comments are not always aligned properly when UseTab is set to Always.

Consider:

int a;        // x
int bbbbbbbb; // x
With .clang-format:

---
Language:        Cpp
BasedOnStyle: LLVM
UseTab: Always
...
The trailing comments of this code block should be aligned, but aren't

To align the first trailing comment it needs to insert 8 spaces. This should be
one tab plus six spaces. It skips the logic of the first partial tab in
FirstTabWidth (=2) + Style.TabWidth (=8) <= Spaces (=8) and only inserts one
tab. Proposed fix and test is attached.

Patch by Hylke Kleve.

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

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

5 years ago[ObjC] For type substitution in generics use a regular recursive type visitor.
Volodymyr Sapsai [Fri, 15 Feb 2019 22:14:58 +0000 (22:14 +0000)]
[ObjC] For type substitution in generics use a regular recursive type visitor.

Switch to the inheritance-based visitor from the lambda-based visitor to
allow both preorder and postorder customizations during type
transformation. NFC intended.

Reviewers: ahatanak, erik.pilkington

Reviewed By: erik.pilkington

Subscribers: jkorous, dexonsmith, cfe-commits

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

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

5 years agoFix implementation of [temp.local]p4.
Richard Smith [Fri, 15 Feb 2019 21:53:07 +0000 (21:53 +0000)]
Fix implementation of [temp.local]p4.

When a template-name is looked up, we need to give injected-class-name
declarations of class templates special treatment, as they denote a
template rather than a type.

Previously we achieved this by applying a filter to the lookup results
after completing name lookup, but that is incorrect in various ways, not
least of which is that it lost all information about access and how
members were named, and the filtering caused us to generally lose
all ambiguity errors between templates and non-templates.

We now preserve the lookup results exactly, and the few places that need
to map from a declaration found by name lookup into a declaration of a
template do so explicitly. Deduplication of repeated lookup results of
the same injected-class-name declaration is done by name lookup instead
of after the fact.

This reinstates r354091, which was previously reverted in r354097
because it exposed bugs in lldb and compiler-rt. Those bugs were fixed
in r354173 and r354174 respectively.

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

5 years agoRevert r354075 "[clang][FileManager] fillRealPathName even if we aren't opening the...
Reid Kleckner [Fri, 15 Feb 2019 20:48:12 +0000 (20:48 +0000)]
Revert r354075 "[clang][FileManager] fillRealPathName even if we aren't opening the file"

The new test doesn't pass on Windows.

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