]> granicus.if.org Git - clang/log
clang
6 years ago[X86] Correct the attributes on the incssp and rdssp builtins to only have 'nothrow'
Craig Topper [Fri, 4 May 2018 21:56:43 +0000 (21:56 +0000)]
[X86] Correct the attributes on the incssp and rdssp builtins to only have 'nothrow'

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

6 years ago[X86] Fix some inconsistent formatting in the first line of our intrinsics headers.
Craig Topper [Fri, 4 May 2018 21:45:25 +0000 (21:45 +0000)]
[X86] Fix some inconsistent formatting in the first line of our intrinsics headers.

Some were too long and some were too short.

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

6 years ago[analyzer] pr37209: Fix casts of glvalues to references.
Artem Dergachev [Fri, 4 May 2018 21:39:25 +0000 (21:39 +0000)]
[analyzer] pr37209: Fix casts of glvalues to references.

Many glvalue expressions aren't of their respective reference type -
they are simply glvalues of their value type.

This was causing problems when we were trying to obtain type of the original
expression while evaluating certain glvalue bit-casts.

Fixed by artificially forging a reference type to provide to the casting
procedure.

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

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

6 years ago[analyzer] Treat more const variables and fields as known contants.
Artem Dergachev [Fri, 4 May 2018 20:52:39 +0000 (20:52 +0000)]
[analyzer] Treat more const variables and fields as known contants.

When loading from a variable or a field that is declared as constant,
the analyzer will try to inspect its initializer and constant-fold it.
Upon success, the analyzer would skip normal load and return the respective
constant.

The new behavior also applies to fields/elements of brace-initialized structures
and arrays.

Patch by Rafael Stahl!

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

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

6 years agoAllow modifying the PrintingPolicy for fully qualified names.
Sterling Augustine [Fri, 4 May 2018 20:12:39 +0000 (20:12 +0000)]
Allow modifying the PrintingPolicy for fully qualified names.

Author: mikhail.ramalho@gmail.com

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

6 years ago[clang-format] Refactor #include insertion/deletion functionality into a class.
Eric Liu [Fri, 4 May 2018 17:55:13 +0000 (17:55 +0000)]
[clang-format] Refactor #include insertion/deletion functionality into a class.

Summary:
The class will be moved into libToolingCore as followup.

The new behaviors in this patch:
- New #include is inserted in the right position in a #include block to
preserver sorted #includes. This is best effort - only works when the
block is already sorted.
- When inserting multiple #includes to the end of a file which doesn't
end with a "\n" character, a "\n" will be prepended to each #include.
This is a special and rare case that was previously handled. This is now
relaxed to avoid complexity as it's rare in practice.

Reviewers: ilya-biryukov

Reviewed By: ilya-biryukov

Subscribers: klimek, cfe-commits, djasper

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

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

6 years ago[NFC]Convert Class to use member initialization instead of inline.
Erich Keane [Fri, 4 May 2018 16:19:53 +0000 (16:19 +0000)]
[NFC]Convert Class to use member initialization instead of inline.

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

6 years ago[clang-cl] Print /showIncludes to stderr, if used in combination with /E, /EP or /P
Erich Keane [Fri, 4 May 2018 15:58:31 +0000 (15:58 +0000)]
[clang-cl] Print /showIncludes to stderr, if used in combination with /E, /EP or /P

This replicates 'cl.exe' behavior and allows for both preprocessor output and
dependency information to be extraced with a single compiler invocation.

This is especially useful for compiler caching with tools like Mozilla's sccache.

See: https://github.com/mozilla/sccache/issues/246

Patch By: fxb

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

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

6 years agoRemove explicit cfg-temporary-dtors=true
Alexander Kornienko [Fri, 4 May 2018 14:13:14 +0000 (14:13 +0000)]
Remove explicit cfg-temporary-dtors=true

Summary:
Remove explicit -analyzer-config cfg-temporary-dtors=true in analyzer tests,
since this option defaults to true since r326461.

Reviewers: NoQ

Reviewed By: NoQ

Subscribers: cfe-commits

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

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

6 years ago[Coroutines] Catch exceptions in await_resume
Brian Gesiak [Fri, 4 May 2018 14:02:37 +0000 (14:02 +0000)]
[Coroutines] Catch exceptions in await_resume

Summary:
http://wg21.link/P0664r2 section "Evolution/Core Issues 24" describes a
proposed change to Coroutines TS that would have any exceptions thrown
after the initial suspend point of a coroutine be caught by the handler
specified by the promise type's 'unhandled_exception' member function.
This commit provides a sample implementation of the specified behavior.

Test Plan: `check-clang`

Reviewers: GorNishanov, EricWF

Reviewed By: GorNishanov

Subscribers: cfe-commits, lewissbaker, eric_niebler

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

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

6 years ago[Driver] Don't warn about unused inputs in config files
Martin Storsjo [Fri, 4 May 2018 06:05:58 +0000 (06:05 +0000)]
[Driver] Don't warn about unused inputs in config files

This avoids warnings about unused linker parameters, just like
other flags are ignored if they're from config files.

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

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

6 years ago[analyzer] NFC: Remove unused parameteer of StoreManager::CastRetrievedVal().
Artem Dergachev [Fri, 4 May 2018 00:53:41 +0000 (00:53 +0000)]
[analyzer] NFC: Remove unused parameteer of StoreManager::CastRetrievedVal().

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

6 years ago[X86] Make __builtin_ia32_directstore_u32 and __builtin_ia32_movdir64b 'nothrow'
Craig Topper [Thu, 3 May 2018 21:01:35 +0000 (21:01 +0000)]
[X86] Make __builtin_ia32_directstore_u32 and __builtin_ia32_movdir64b 'nothrow'

These builtins snuck in while I was in the middle of adding nothrow to the other builtins in my local clone and I guess I missed them.

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

6 years ago[CodeGenFunction] Use the StringRef::split function that takes a char separator inste...
Craig Topper [Thu, 3 May 2018 21:01:33 +0000 (21:01 +0000)]
[CodeGenFunction] Use the StringRef::split function that takes a char separator instead of StringRef separator. NFC

The char separator version should be a little better optimized.

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

6 years ago[OPENMP] Fix test typos: CHECK-DAG-N -> CHECK-N-DAG
Joel E. Denny [Thu, 3 May 2018 17:22:04 +0000 (17:22 +0000)]
[OPENMP] Fix test typos: CHECK-DAG-N -> CHECK-N-DAG

Reviewed by: ABataev

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

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

6 years agoRevert r331466: [OPENMP] Fix test typos: CHECK-DAG-N -> CHECK-N-DAG"
Joel E. Denny [Thu, 3 May 2018 17:22:01 +0000 (17:22 +0000)]
Revert r331466: [OPENMP] Fix test typos: CHECK-DAG-N -> CHECK-N-DAG"

Sorry, forgot to add commit log attributes.

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

6 years ago[OPENMP] Fix test typos: CHECK-DAG-N -> CHECK-N-DAG
Joel E. Denny [Thu, 3 May 2018 17:15:44 +0000 (17:15 +0000)]
[OPENMP] Fix test typos: CHECK-DAG-N -> CHECK-N-DAG

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

6 years agoAllow writing calling convention attributes on function types.
Aaron Ballman [Thu, 3 May 2018 15:33:50 +0000 (15:33 +0000)]
Allow writing calling convention attributes on function types.

Calling convention attributes notionally appertain to the function type -- they modify the mangling of the function, change the behavior of assignment operations, etc. This commit allows the calling convention attributes to be written in the type position as well as the declaration position.

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

6 years agoRename invariant.group.barrier to launder.invariant.group
Piotr Padlewski [Thu, 3 May 2018 11:03:01 +0000 (11:03 +0000)]
Rename invariant.group.barrier to launder.invariant.group

Summary:
This is one of the initial commit of "RFC: Devirtualization v2" proposal:
https://docs.google.com/document/d/16GVtCpzK8sIHNc2qZz6RN8amICNBtvjWUod2SujZVEo/edit?usp=sharing

Reviewers: rsmith, amharc, kuhar, sanjoy

Subscribers: arsenm, nhaehnle, javed.absar, hiraditya, llvm-commits

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

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

6 years agoEnable -fsanitize=function on FreeBSD.
Fangrui Song [Thu, 3 May 2018 06:37:47 +0000 (06:37 +0000)]
Enable -fsanitize=function on FreeBSD.

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

6 years agoFix -Wunused-variable warning in Clang.cpp
Karl-Johan Karlsson [Thu, 3 May 2018 05:53:29 +0000 (05:53 +0000)]
Fix -Wunused-variable warning in Clang.cpp

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

6 years agoTrack the result of evaluating a computed noexcept specification on the
Richard Smith [Thu, 3 May 2018 03:58:32 +0000 (03:58 +0000)]
Track the result of evaluating a computed noexcept specification on the
FunctionProtoType.

We previously re-evaluated the expression each time we wanted to know whether
the type is noexcept or not. We now evaluate the expression exactly once.

This is not quite "no functional change": it fixes a crasher bug during AST
deserialization where we would try to evaluate the noexcept specification in a
situation where we have not deserialized sufficient portions of the AST to
permit such evaluation.

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

6 years ago[CMake][Cache] Stop pretending that Fuchsia is UNIX
Petr Hosek [Thu, 3 May 2018 01:44:03 +0000 (01:44 +0000)]
[CMake][Cache] Stop pretending that Fuchsia is UNIX

This changes some aspects of the build that are not relevant or useful
for Fuchsia like setting the RPATH/RUNPATH.

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

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

6 years ago[Sema] Do not match function type with const T in template argument deduction
Lei Liu [Thu, 3 May 2018 01:43:23 +0000 (01:43 +0000)]
[Sema] Do not match function type with const T in template argument deduction

From http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1584,
function type should not match cv-qualified type in template argument
deduction. This also matches what GCC and EDG do in template argument
deduction.

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

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

6 years ago[ObjC] Supress the 'implementing unavailable method' warning when
Alex Lorenz [Thu, 3 May 2018 01:12:06 +0000 (01:12 +0000)]
[ObjC] Supress the 'implementing unavailable method' warning when
the method declaration is unavailable for an app extension platform

Rationale:
Classes are often shared between an app extension code and
non-app extension code. There's no way to remove the implementation
using preprocessor when building the app extension, so we should not warn here.

rdar://38150617

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

6 years ago[gcov] Make the CLang side coverage test work with the new
Chandler Carruth [Wed, 2 May 2018 22:57:20 +0000 (22:57 +0000)]
[gcov] Make the CLang side coverage test work with the new
instrumentation codegeneration strategy of using a data structure and
a loop. Required some finesse to get the critical things being tested to
surface in a nice way for FileCheck but I think this preserves the
original intent of the test.

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

6 years ago[ObjC] The absence of ownership qualifiers on an ambiguous property leads
Alex Lorenz [Wed, 2 May 2018 22:40:19 +0000 (22:40 +0000)]
[ObjC] The absence of ownership qualifiers on an ambiguous property leads
to synthesis of a valid property even when the selected protocol property
has ownership qualifiers

rdar://39024725

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

6 years ago[analyzer] Revert r331096 "CStringChecker: Add support for BSD strlcpy()...".
Artem Dergachev [Wed, 2 May 2018 20:33:17 +0000 (20:33 +0000)]
[analyzer] Revert r331096 "CStringChecker: Add support for BSD strlcpy()...".

The return values of the newly supported functions were not handled correctly:
strlcpy()/strlcat() return string sizes rather than pointers.

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

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

6 years ago[X86] Mark all x86 specific builtins as nothrow.
Craig Topper [Wed, 2 May 2018 20:18:57 +0000 (20:18 +0000)]
[X86] Mark all x86 specific builtins as nothrow.

I believe all of the x86 builtins should be considered nothrow.

I've left the incssp builtins alone because I think its current attributes are wrong and I'm following up with the contributor for that.

I plan to start adding const as well, but that requires more careful auditing.

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

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

6 years ago[OPENMP] Add support for reductions on simd directives in target
Alexey Bataev [Wed, 2 May 2018 20:03:27 +0000 (20:03 +0000)]
[OPENMP] Add support for reductions on simd directives in target
regions.

Added codegen for `simd reduction()` constructs in target directives.

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

6 years agoRevert "Emit an error when mixing <stdatomic.h> and <atomic>"
Volodymyr Sapsai [Wed, 2 May 2018 19:52:07 +0000 (19:52 +0000)]
Revert "Emit an error when mixing <stdatomic.h> and <atomic>"

It reverts r331378 as it caused test failures

    ThreadSanitizer-x86_64 :: Darwin/gcd-groups-destructor.mm
    ThreadSanitizer-x86_64 :: Darwin/libcxx-shared-ptr-stress.mm
    ThreadSanitizer-x86_64 :: Darwin/xpc-race.mm

Only clang part of the change is reverted, libc++ part remains as is because it
emits error less aggressively.

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

6 years ago[Driver] Infer Android sysroot location.
Dan Albert [Wed, 2 May 2018 19:38:37 +0000 (19:38 +0000)]
[Driver] Infer Android sysroot location.

Summary:
Android toolchains include their headers and libraries in a
self-contained directory within the toolchain.

Reviewers: srhines

Reviewed By: srhines

Subscribers: cfe-commits

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

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

6 years ago[Driver] Obey computed sysroot when finding libc++ headers.
Dan Albert [Wed, 2 May 2018 19:31:01 +0000 (19:31 +0000)]
[Driver] Obey computed sysroot when finding libc++ headers.

Summary:
A handful of targets will try some default paths if --sysroot is not provided.
If that is the case, it should be used for the libc++ header paths.

Reviewers: srhines, EricWF

Reviewed By: srhines

Subscribers: cfe-commits

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

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

6 years ago[OPENMP] Analyze the type of the mapped entity instead of its base.
Alexey Bataev [Wed, 2 May 2018 18:44:10 +0000 (18:44 +0000)]
[OPENMP] Analyze the type of the mapped entity instead of its base.

If the mapped entity is a data member, we erroneously checked the type
of its base rather than the type of the mapped entity itself.

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

6 years agoEmit an error when mixing <stdatomic.h> and <atomic>
Volodymyr Sapsai [Wed, 2 May 2018 17:50:43 +0000 (17:50 +0000)]
Emit an error when mixing <stdatomic.h> and <atomic>

Atomics in C and C++ are incompatible at the moment and mixing the
headers can result in confusing error messages.

Emit an error explicitly telling about the incompatibility. Introduce
the macro `__ALLOW_STDC_ATOMICS_IN_CXX__` that allows to choose in C++
between C atomics and C++ atomics.

rdar://problem/27435938

Reviewers: rsmith, EricWF, mclow.lists

Reviewed By: mclow.lists

Subscribers: jkorous-apple, christof, bumblebritches57, JonChesterfield, smeenai, cfe-commits

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

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

6 years ago[OPENMP] Do not emit warning for implicitly declared target functions.
Alexey Bataev [Wed, 2 May 2018 17:39:00 +0000 (17:39 +0000)]
[OPENMP] Do not emit warning for implicitly declared target functions.

Since upcoming OpenMP 5.0 functions can be mapped implicitly as declare
target and we should not emit warnings for such functions.

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

6 years ago[OPENMP] Enable c++ exceptions outside of the target constructs iff they are
Alexey Bataev [Wed, 2 May 2018 16:52:07 +0000 (16:52 +0000)]
[OPENMP] Enable c++ exceptions outside of the target constructs iff they are
enabled for the host.

If the compilation for the host enables C++ exceptions, but they are not
supported by the device, we still need to allow the code with the
exception handling constructs outside of the target regions.

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

6 years agoAdd -foutline option to enable the MachineOutliner in AArch64
Jessica Paquette [Wed, 2 May 2018 16:42:51 +0000 (16:42 +0000)]
Add -foutline option to enable the MachineOutliner in AArch64

Since we've been working on productizing the MachineOutliner in AArch64, it
makes sense to provide a more user-friendly way to enable it.

This allows users of AArch64 to enable the outliner using -foutline instead
of -mllvm -enable-machine-outliner. Other, less mature implementations (e.g,
x86-64) can still enable the pass using the -mllvm option.

Also add a test to make sure it works.

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

6 years ago[OPENMP] Support C++ member functions in the device constructs.
Alexey Bataev [Wed, 2 May 2018 15:45:28 +0000 (15:45 +0000)]
[OPENMP] Support C++ member functions in the device constructs.

Added correct emission of the C++ member functions for the device
function when they are used in the device constructs.

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

6 years ago[analyzer] Fix filename in cross-file HTML report
Malcolm Parsons [Wed, 2 May 2018 14:26:12 +0000 (14:26 +0000)]
[analyzer] Fix filename in cross-file HTML report

Summary:
The filename is currently taken from the start of the path, while the
line and column are taken from the end of the path.
This didn't matter until cross-file path reporting was added.

Reviewers: george.karpenkov, dcoughlin, vlad.tsyrklevich

Reviewed By: george.karpenkov, vlad.tsyrklevich

Subscribers: xazax.hun, szepet, a.sidorin, cfe-commits

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

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

6 years ago[OPENMP] Emit names of the globals depending on target.
Alexey Bataev [Wed, 2 May 2018 14:20:50 +0000 (14:20 +0000)]
[OPENMP] Emit names of the globals depending on target.

Some symbols are not allowed to be used as names on some targets. Patch
ries to unify the emission of the names of LLVM globals so they could be
used on different targets.

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

6 years ago[analyzer] Add `TaintBugVisitor` to the ArrayBoundV2, DivideZero and VLASize.
Henry Wong [Wed, 2 May 2018 12:11:22 +0000 (12:11 +0000)]
[analyzer] Add `TaintBugVisitor` to the ArrayBoundV2, DivideZero and VLASize.

Summary: Add `TaintBugVisitor` to the ArrayBoundV2, DivideZero, VLASize to be able to indicate where the taint information originated from.

Reviewers: NoQ, george.karpenkov, xazax.hun, a.sidorin

Reviewed By: NoQ

Subscribers: szepet, rnkovacs, cfe-commits, MTC

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

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

6 years ago[ASTImporter] Fix isa cast assert
Peter Szecsi [Wed, 2 May 2018 11:52:54 +0000 (11:52 +0000)]
[ASTImporter] Fix isa cast assert

Do early return if we can't import the found decl for a member expr.
This follows the pre-existing scheme, e.g with E->getMemberDecl().
E->getFoundDecl().getDecl() can be null when a member expression does
not involve lookup. It may involve a lookup in case of a using directive
which refers to a member function in a base class template.

We faced this assert during the CTU analysis of google::protobuf v3.5.2.
We tried hard to synthesize a minimal test example both by hand and by
executing creduce on multiple files. Unfortunately, we were unable to reduce
to such a minimal example, yet. Nevertheless, this fix solved the problem in
protobuf.

To reproduce the error one must execute the analyzer with
-Xclang -analyzer-config -Xclang experimental-enable-naive-ctu-analysis=true -Xclang -analyzer-config -Xclang ctu-dir=/path/to/ctu_dir

Patch by Gabor Marton!

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

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

6 years ago[Modules] Allow @import to reach submodules in private module maps
Bruno Cardoso Lopes [Wed, 2 May 2018 02:25:03 +0000 (02:25 +0000)]
[Modules] Allow @import to reach submodules in private module maps

A @import targeting a top level module from a private module map file
(@import Foo_Private), would fail if there's any submodule declaration
around (module Foo.SomeSub) in the same private module map.

This happens because compileModuleImpl, when building Foo_Private, will
start with the private module map and will not parse the public one,
which leads to unsuccessful parsing of Foo.SomeSub, since top level Foo
was never parsed.

Declaring other submodules in the private module map is not common and
should usually be avoided, but it shouldn't fail to build. Canonicalize
compileModuleImpl to always look at the public module first, so that all
necessary information is available when parsing the private one.

rdar://problem/39822328

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

6 years agoTrack skipped files in dependency scanning.
Volodymyr Sapsai [Tue, 1 May 2018 23:59:33 +0000 (23:59 +0000)]
Track skipped files in dependency scanning.

It's possible for a header to be a symlink to another header. In this
case both will be represented by clang::FileEntry with the same UID and
they'll use the same clang::HeaderFileInfo.

If you include both headers and use some single-inclusion mechanism
like a header guard or #import, one header will get a FileChanged
callback, and another FileSkipped.

So that we get an accurate dependency file, we therefore need to also
implement the FileSkipped callback in dependency scanning.

Patch by Pete Cooper.

Reviewers: bruno, pete

Reviewed By: bruno

Subscribers: cfe-commits, jkorous, vsapsai

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

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

6 years agoThis test fails if there is no integrated assembler, so change the -c option to ...
Douglas Yung [Tue, 1 May 2018 23:32:09 +0000 (23:32 +0000)]
This test fails if there is no integrated assembler, so change the -c option to -S as it is not important to the test and allows it to pass when there is no integrated assembler.

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

6 years ago[libclang] Fix the type of 'int (Foo);'
Shoaib Meenai [Tue, 1 May 2018 20:45:25 +0000 (20:45 +0000)]
[libclang] Fix the type of 'int (Foo);'

libclang exposes the type of 'int (Foo);' (a global variable of type int
called Foo) as CXType_Unexposed. This is because Clang represents Foo's
type as ParenType{BuiltinType{Int}}, and libclang does not handle
ParenType.

Make libclang return CXType_Int as the type of 'int (Foo);' by
unwrapping ParenType transparently.

Patch by Matt Glazar.

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

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

6 years ago[ARM] Remove redundant #if in test. NFC
Shoaib Meenai [Tue, 1 May 2018 20:38:05 +0000 (20:38 +0000)]
[ARM] Remove redundant #if in test. NFC

Both sides of this #if #include the same file. Drop the #if, leaving only the #include.

Patch by Matt Glazar.

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

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

6 years agoFix bogus MSVC char8_t mangling.
Richard Smith [Tue, 1 May 2018 18:50:15 +0000 (18:50 +0000)]
Fix bogus MSVC char8_t mangling.

This appears to have been caused by a bad automatic svn merge with r330225
attaching the 'case' label to the wrong block of code. :(

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

6 years agoDriver: fix an assertion with `-print-prog-name=`
Saleem Abdulrasool [Tue, 1 May 2018 18:40:42 +0000 (18:40 +0000)]
Driver: fix an assertion with `-print-prog-name=`

Fix an assertion when -print-prog-name= is invoked without parameter.
Returns an empty string.

Patch by Christian Bruel!

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

6 years agoUpdate existed CodeGen TBAA tests
Danil Malyshev [Tue, 1 May 2018 18:14:36 +0000 (18:14 +0000)]
Update existed CodeGen TBAA tests

Reviewers: hfinkel, kosarev, rjmccall

Reviewed By: rjmccall

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

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

6 years agoAdd Microsoft Mangling for OpenCL Half Type
Erich Keane [Tue, 1 May 2018 14:16:15 +0000 (14:16 +0000)]
Add Microsoft Mangling for OpenCL Half Type

Half-type mangling is accomplished following the method introduced by Erich
Keane for mangling _Float16. Updated the half.cl LIT test to cover this
particular case.

Patch By: vbridgers

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

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

6 years ago[OPENMP] Emit template instatiation|specialization functions for
Alexey Bataev [Tue, 1 May 2018 14:09:46 +0000 (14:09 +0000)]
[OPENMP] Emit template instatiation|specialization functions for
devices.

If the function is an instantiation|specialization of the template and
is used in the device code, the definitions of such functions should be
emitted for the device.

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

6 years ago[X86] directstore and movdir64b intrinsics
Gabor Buella [Tue, 1 May 2018 10:05:42 +0000 (10:05 +0000)]
[X86] directstore and movdir64b intrinsics

Reviewers: spatel, craig.topper, RKSimon

Reviewed By: craig.topper

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

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

6 years agoFix up r331244 - the emitted definition is weak_odr linkage. Should get
Chandler Carruth [Tue, 1 May 2018 06:48:30 +0000 (06:48 +0000)]
Fix up r331244 - the emitted definition is weak_odr linkage. Should get
the build bots to healthy again without a full revert. As the
functionality added has nothing to do with linkage this seems unlikely
to represent a deep or interesting bug in the patch.

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

6 years agoImplement P0482R2, support for char8_t type.
Richard Smith [Tue, 1 May 2018 05:02:45 +0000 (05:02 +0000)]
Implement P0482R2, support for char8_t type.

This is not yet part of any C++ working draft, and so is controlled by the flag
-fchar8_t rather than a -std= flag. (The GCC implementation is controlled by a
flag with the same name.)

This implementation is experimental, and will be removed or revised
substantially to match the proposal as it makes its way through the C++
committee.

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

6 years ago[ShadowCallStack] fix the docs
Kostya Serebryany [Tue, 1 May 2018 00:15:56 +0000 (00:15 +0000)]
[ShadowCallStack] fix the docs

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

6 years ago[Modules] Fix testcases from r331232
Bruno Cardoso Lopes [Mon, 30 Apr 2018 22:57:02 +0000 (22:57 +0000)]
[Modules] Fix testcases from r331232

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

6 years ago[Modules] Handle ObjC/C ODR-like semantics for EnumConstantDecl
Bruno Cardoso Lopes [Mon, 30 Apr 2018 22:14:29 +0000 (22:14 +0000)]
[Modules] Handle ObjC/C ODR-like semantics for EnumConstantDecl

Support for ObjC/C ODR-like semantics with structural equivalence
checking was added back in r306918. There enums are handled and also
checked for structural equivalence. However, at use time of
EnumConstantDecl, support was missing for preventing ambiguous
name lookup.

Add the missing bits for properly merging EnumConstantDecl.

rdar://problem/38374569

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

6 years ago[CodeGen] Fix typo in comment form->from. NFC
Craig Topper [Mon, 30 Apr 2018 22:02:48 +0000 (22:02 +0000)]
[CodeGen] Fix typo in comment form->from. NFC

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

6 years ago[docs] Fix docs/InternalsManual.rst heading.
Fangrui Song [Mon, 30 Apr 2018 20:51:50 +0000 (20:51 +0000)]
[docs] Fix docs/InternalsManual.rst heading.

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

6 years ago[MC] Change AsmParser to leverage Assembler during evaluation
Nirav Dave [Mon, 30 Apr 2018 19:22:40 +0000 (19:22 +0000)]
[MC] Change AsmParser to leverage Assembler during evaluation

Teach AsmParser to check with Assembler for when evaluating constant
expressions.  This improves the handing of preprocessor expressions
that must be resolved at parse time. This idiom can be found as
assembling-time assertion checks in source-level assemblers. Note that
this relies on the MCStreamer to keep sufficient tabs on Section /
Fragment information which the MCAsmStreamer does not. As a result the
textual output may fail where the equivalent object generation would
pass. This can most easily be resolved by folding the MCAsmStreamer
and MCObjectStreamer together which is planned for in a separate
patch.

Currently, this feature is only enabled for assembly input, keeping IR
compilation consistent between assembly and object generation.

Reviewers: echristo, rnk, probinson, espindola, peter.smith

Reviewed By: peter.smith

Subscribers: eraman, peter.smith, arichardson, jyknight, hiraditya, llvm-commits

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

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

6 years agoAMDGPU: Add Vega12 and Vega20
Matt Arsenault [Mon, 30 Apr 2018 19:08:27 +0000 (19:08 +0000)]
AMDGPU: Add Vega12 and Vega20

Changes by
  Matt Arsenault
  Konstantin Zhuravlyov

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

6 years agoclang-cl: Expose -fmerge-all-constants
Hans Wennborg [Mon, 30 Apr 2018 19:04:04 +0000 (19:04 +0000)]
clang-cl: Expose -fmerge-all-constants

Now that constant merging is off by default, we'd like a way to enable
it on Windows.

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

6 years ago[OPENMP] Do not emit warning about non-declared target function params.
Alexey Bataev [Mon, 30 Apr 2018 18:28:08 +0000 (18:28 +0000)]
[OPENMP] Do not emit warning about non-declared target function params.

We should not emit warning that the parameters are not marked as declare
target, these declaration are local and cannot be marked as declare
target.

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

6 years ago[Driver, CodeGen] rename options to disable an FP cast optimization
Sanjay Patel [Mon, 30 Apr 2018 18:19:03 +0000 (18:19 +0000)]
[Driver, CodeGen] rename options to disable an FP cast optimization

As suggested in the post-commit thread for rL331056, we should match these
clang options with the established vocabulary of the corresponding sanitizer
option. Also, the use of 'strict' is well-known for these kinds of knobs,
and we can improve the descriptive text in the docs.

So this intends to match the logic of D46135 but only change the words.
Matching LLVM commit to match this spelling of the attribute to follow shortly.

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

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

6 years agoRegenerated AST Matchers doc.
Alexander Kornienko [Mon, 30 Apr 2018 18:12:15 +0000 (18:12 +0000)]
Regenerated AST Matchers doc.

Backported a minor fix to the comment in the header.

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

6 years ago[OPENMP] Do not crash on codegen for CXX member functions.
Alexey Bataev [Mon, 30 Apr 2018 18:09:40 +0000 (18:09 +0000)]
[OPENMP] Do not crash on codegen for CXX member functions.

Non-static member functions should not be emitted as a standalone
functions, this leads to compiler crash.

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

6 years ago[OPENMP] Do not crash on incorrect input data.
Alexey Bataev [Mon, 30 Apr 2018 16:26:57 +0000 (16:26 +0000)]
[OPENMP] Do not crash on incorrect input data.

Emit error messages instead of compiler crashing when the target region
does not exist in the device code + fix crash when the location comes
from macros.

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

6 years agoIWYU for llvm-config.h in clang. See r331124 for details.
Nico Weber [Mon, 30 Apr 2018 13:52:15 +0000 (13:52 +0000)]
IWYU for llvm-config.h in clang. See r331124 for details.

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

6 years agoRemove unnecessary indirection. No behavior change.
Nico Weber [Mon, 30 Apr 2018 13:47:04 +0000 (13:47 +0000)]
Remove unnecessary indirection. No behavior change.

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

6 years ago[Targets] Implement getConstraintRegister for ARM and AArch64
Mikhail Maltsev [Mon, 30 Apr 2018 09:11:08 +0000 (09:11 +0000)]
[Targets] Implement getConstraintRegister for ARM and AArch64

Summary:
The getConstraintRegister method is used by semantic checking of
inline assembly statements in order to diagnose conflicts between
clobber list and input/output lists. Currently ARM and AArch64 don't
override getConstraintRegister, so conflicts between registers
assigned to variables in asm labels and clobber lists are not
diagnosed. Such conflicts can cause assertion failures in the back end
and even miscompilations.

This patch implements getConstraintRegister for ARM and AArch64
targets. Since these targets don't have single-register constraints,
the implementation is trivial and just returns the register specified
in an asm label (if any).

Reviewers: eli.friedman, javed.absar, thopre

Reviewed By: thopre

Subscribers: rengolin, eraman, rogfer01, myatsina, kristof.beyls, cfe-commits, chrib

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

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

6 years agoPR37189 Fix incorrect end source location and spelling for a split '>>' token.
Richard Smith [Mon, 30 Apr 2018 05:25:48 +0000 (05:25 +0000)]
PR37189 Fix incorrect end source location and spelling for a split '>>' token.

When a '>>' token is split into two '>' tokens (in C++11 onwards), or (as an
extension) when we do the same for other tokens starting with a '>', we can't
just use a location pointing to the first '>' as the location of the split
token, because that would result in our miscomputing the length and spelling
for the token. As a consequence, for example, a refactoring replacing 'A<X>'
with something else would sometimes replace one character too many, and
similarly diagnostics highlighting a template-id source range would highlight
one character too many.

Fix this by creating an expansion range covering the first character of the
'>>' token, whose spelling is '>'. For this to work, we generalize the
expansion range of a macro FileID to be either a token range (the common case)
or a character range (used in this new case).

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

6 years agoRename DiagnosticClient to DiagnosticConsumer as per issue 5397.
Fangrui Song [Mon, 30 Apr 2018 00:34:09 +0000 (00:34 +0000)]
Rename DiagnosticClient to DiagnosticConsumer as per issue 5397.

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

6 years agoFix printing of reference-to-reference types.
Richard Smith [Sun, 29 Apr 2018 05:33:38 +0000 (05:33 +0000)]
Fix printing of reference-to-reference types.

Previously we would sometimes print these as 'T &&&' or even 'T &&&&'.

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

6 years agoPR37275 packed attribute should not apply to base classes
Richard Smith [Sun, 29 Apr 2018 04:55:46 +0000 (04:55 +0000)]
PR37275 packed attribute should not apply to base classes

Clang incorrectly applied the packed attribute to base classes. Per GCC's
documentation and as can be observed from its behavior, packed only applies to
members, not base classes.

This change is conditioned behind -fclang-abi-compat so that an ABI break can
be avoided by users if desired.

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

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

6 years agoRemove unused includes of clang/Config/config.h
Nico Weber [Sat, 28 Apr 2018 23:48:36 +0000 (23:48 +0000)]
Remove unused includes of clang/Config/config.h

Found by opening config.h.cmake in vim, finding all defined macros with

  /define\(01\)\? \zs[A-Za-z0-9_]*<cr>
  :%s//\=setreg('A', submatch(0), 'V')/gn<cr>
  :put A<cr>

and then joining them all with |, and passing that to

  git grep -E that_pattern 'clang/*.h' 'clang/*.cpp' 'clang/*.c'

and diffing that output with the result of

  git grep Config/config.h 'clang/*.h' 'clang/*.cpp' 'clang/*.c'

No intended behavior change.

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

6 years ago[ItaniumMangle] Undeduced auto type shouldn't be substitutable.
Erik Pilkington [Sat, 28 Apr 2018 02:40:28 +0000 (02:40 +0000)]
[ItaniumMangle] Undeduced auto type shouldn't be substitutable.

We still support the old mangling if we're trying to be ABI-compatible with
Clang 6.0, though.

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

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

6 years ago[analyzer] CStringChecker: Add support for BSD strlcpy() and strlcat().
Artem Dergachev [Fri, 27 Apr 2018 23:50:55 +0000 (23:50 +0000)]
[analyzer] CStringChecker: Add support for BSD strlcpy() and strlcat().

Patch by David Carlier!

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

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

6 years agoFix diag-format test to not care about what cl.exe is on path
Reid Kleckner [Fri, 27 Apr 2018 22:32:21 +0000 (22:32 +0000)]
Fix diag-format test to not care about what cl.exe is on path

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

6 years ago[analyzer] ObjCAutoreleaseWrite: Support a few more APIs and fix warning text.
Artem Dergachev [Fri, 27 Apr 2018 22:00:51 +0000 (22:00 +0000)]
[analyzer] ObjCAutoreleaseWrite: Support a few more APIs and fix warning text.

API list and improved warning text composed by Devin Coughlin.

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

6 years agoRevert r329698 (and r329702).
Nico Weber [Fri, 27 Apr 2018 20:29:57 +0000 (20:29 +0000)]
Revert r329698 (and r329702).

Speculative. ClangMoveTests started failing on
http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/9958
after this change. I can't reproduce on my machine, let's see
if it was due to this change.

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

6 years agos/LLVM_ON_WIN32/_WIN32/, clang
Nico Weber [Fri, 27 Apr 2018 19:11:14 +0000 (19:11 +0000)]
s/LLVM_ON_WIN32/_WIN32/, clang

LLVM_ON_WIN32 is set exactly with MSVC and MinGW (but not Cygwin) in
HandleLLVMOptions.cmake, which is where _WIN32 defined too.  Just use the
default macro instead of a reinvented one.

See thread "Replacing LLVM_ON_WIN32 with just _WIN32" on llvm-dev and cfe-dev.
No intended behavior change.

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

6 years ago[clang-format/ObjC] Use getIdentifierInfo() instead of tok::identifier
Ben Hamilton [Fri, 27 Apr 2018 18:51:12 +0000 (18:51 +0000)]
[clang-format/ObjC] Use getIdentifierInfo() instead of tok::identifier

Summary:
Previously, we checked tokens for `tok::identifier` to see if they
were identifiers inside an Objective-C selector.

However, this missed C++ keywords like `new` and `delete`.

To fix this, this diff uses `getIdentifierInfo()` to find
identifiers or keywords inside Objective-C selectors.

Test Plan: New tests added. Ran tests with:
  % make -j16 FormatTests && ./tools/clang/unittests/Format/FormatTests

Reviewers: djasper, jolesiak

Reviewed By: djasper

Subscribers: klimek, cfe-commits

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

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

6 years ago[Modules][ObjC] ASTReader should add protocols for class extensions
Bruno Cardoso Lopes [Fri, 27 Apr 2018 18:01:23 +0000 (18:01 +0000)]
[Modules][ObjC] ASTReader should add protocols for class extensions

During deserialization clang is currently missing the merging of
protocols into the canonical interface for the class extension.

This merging only currently happens during parsing and should also
be considered during deserialization.

rdar://problem/38724303

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

6 years ago[docs] more dashes
Sanjay Patel [Fri, 27 Apr 2018 16:24:39 +0000 (16:24 +0000)]
[docs] more dashes

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

6 years ago[docs] add -ffp-cast-overflow-workaround to the release notes
Sanjay Patel [Fri, 27 Apr 2018 16:21:22 +0000 (16:21 +0000)]
[docs] add -ffp-cast-overflow-workaround to the release notes

This option was added with:
D46135
rL331041
...copying the text from UsersManual.rst for more exposure.

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

6 years ago[MC] Undo spurious commit added into r331052.
Nirav Dave [Fri, 27 Apr 2018 16:16:06 +0000 (16:16 +0000)]
[MC] Undo spurious commit added into r331052.

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

6 years agoTest commit removing trailing whitespace
Stuart Brady [Fri, 27 Apr 2018 16:11:56 +0000 (16:11 +0000)]
Test commit removing trailing whitespace

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

6 years ago[MC] Provide default value for IsResolved.
Nirav Dave [Fri, 27 Apr 2018 16:11:24 +0000 (16:11 +0000)]
[MC] Provide default value for IsResolved.

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

6 years ago[MC] Modify MCAsmStreamer to always build MCAssembler. NFCI.
Nirav Dave [Fri, 27 Apr 2018 15:45:54 +0000 (15:45 +0000)]
[MC] Modify MCAsmStreamer to always build MCAssembler. NFCI.

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

6 years ago[Driver, CodeGen] add options to enable/disable an FP cast optimization
Sanjay Patel [Fri, 27 Apr 2018 14:22:48 +0000 (14:22 +0000)]
[Driver, CodeGen] add options to enable/disable an FP cast optimization

As discussed in the post-commit thread for:
rL330437 ( http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20180423/545906.html )

We need a way to opt-out of a float-to-int-to-float cast optimization because too much
existing code relies on the platform-specific undefined result of those casts when the
float-to-int overflows.

The LLVM changes associated with adding this function attribute are here:
rL330947
rL330950
rL330951

Also as suggested, I changed the LLVM doc to mention the specific sanitizer flag that
catches this problem:
rL330958

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

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

6 years ago[ARM,AArch64] Add intrinsics for dot product instructions
Oliver Stannard [Fri, 27 Apr 2018 14:03:32 +0000 (14:03 +0000)]
[ARM,AArch64] Add intrinsics for dot product instructions

The ACLE spec which describes these intrinsics hasn't been published yet, but
this is based on the final draft which will be published soon, and these have
already been implemented by GCC.

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

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

6 years ago[ARM] Add __ARM_FEATURE_DOTPROD pre-defined macro
Oliver Stannard [Fri, 27 Apr 2018 13:56:02 +0000 (13:56 +0000)]
[ARM] Add __ARM_FEATURE_DOTPROD pre-defined macro

This adds a pre-defined macro to test if the compiler has support for the
v8.2-A dot rpoduct intrinsics in AArch32 mode.

The AAcrh64 equivalent has already been added by rL330229.

The ACLE spec which describes this macro hasn't been published yet, but this is
based on the final internal draft, and GCC has already implemented this.

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

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

6 years ago[OpenCL] Add separate read_only and write_only pipe IR types
Sven van Haastregt [Fri, 27 Apr 2018 10:37:04 +0000 (10:37 +0000)]
[OpenCL] Add separate read_only and write_only pipe IR types

SPIR-V encodes the read_only and write_only access qualifiers of pipes,
so separate LLVM IR types are required to target SPIR-V.  Other backends
may also find this useful.

These new types are `opencl.pipe_ro_t` and `opencl.pipe_wo_t`, which
replace `opencl.pipe_t`.

This replaces __get_pipe_num_packets(...) and __get_pipe_max_packets(...)
which took a read_only pipe with separate versions for read_only and
write_only pipes, namely:

 * __get_pipe_num_packets_ro(...)
 * __get_pipe_num_packets_wo(...)
 * __get_pipe_max_packets_ro(...)
 * __get_pipe_max_packets_wo(...)

These separate versions exist to avoid needing a bitcast to one of the
two qualified pipe types.

Patch by Stuart Brady.

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

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

6 years agoMake MultiplexASTDeserializationListener part of the API [NFC]
Raphael Isemann [Fri, 27 Apr 2018 07:05:40 +0000 (07:05 +0000)]
Make MultiplexASTDeserializationListener part of the API [NFC]

Summary:
This patch moves the MultiplexASTDeserializationListener declaration into a public header.

We're currently using this multiplexer in the cling interpreter to attach another
ASTDeserializationListener during the execution (so, after the MultiplexConsumer is already
attached which prevents us from attaching more). So far we're doing this by patching clang
and making this class public, but it makes things easier if we make this instead just public in
upstream.

Reviewers: thakis, v.g.vassilev, rsmith, bruno

Reviewed By: bruno

Subscribers: llvm-commits, cfe-commits, v.g.vassilev

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

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

6 years ago[CodeGen] Avoid destructing a callee-destructued struct type in a
Akira Hatanaka [Fri, 27 Apr 2018 06:57:00 +0000 (06:57 +0000)]
[CodeGen] Avoid destructing a callee-destructued struct type in a
function if a function delegates to another function.

Fix a bug introduced in r328731, which caused a struct with ObjC __weak
fields that was passed to a function to be destructed twice, once in the
callee function and once in another function the callee function
delegates to. To prevent this, keep track of the callee-destructed
structs passed to a function and disable their cleanups at the point of
the call to the delegated function.

This reapplies r331016, which was reverted in r331019 because it caused
an assertion to fail in EmitDelegateCallArg on a windows bot. I made
changes to EmitDelegateCallArg so that it doesn't try to deactivate
cleanups for structs that have trivial destructors (cleanups for those
structs are never pushed to the cleanup stack in EmitParmDecl).

rdar://problem/39194693

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

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

6 years agoRevert "[CodeGen] Avoid destructing a callee-destructued struct type in a"
Akira Hatanaka [Fri, 27 Apr 2018 05:56:55 +0000 (05:56 +0000)]
Revert "[CodeGen] Avoid destructing a callee-destructued struct type in a"

This reverts commit r331016, which broke a windows bot.

http://lab.llvm.org:8011/builders/clang-x86-windows-msvc2015/builds/11727

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

6 years agoFix typo.
Richard Smith [Fri, 27 Apr 2018 04:27:26 +0000 (04:27 +0000)]
Fix typo.

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

6 years ago[CodeGen] Avoid destructing a callee-destructued struct type in a
Akira Hatanaka [Fri, 27 Apr 2018 04:21:51 +0000 (04:21 +0000)]
[CodeGen] Avoid destructing a callee-destructued struct type in a
function if a function delegates to another function.

Fix a bug introduced in r328731, which caused a struct with ObjC __weak
fields that was passed to a function to be destructed twice, once in the
callee function and once in another function the callee function
delegates to. To prevent this, keep track of the callee-destructed
structs passed to a function and disable their cleanups at the point of
the call to the delegated function.

rdar://problem/39194693

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

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