]> granicus.if.org Git - clang/log
clang
6 years ago[ASTMatchers] Don't assert-fail in specifiesTypeLoc().
David L. Jones [Mon, 18 Jun 2018 08:59:16 +0000 (08:59 +0000)]
[ASTMatchers] Don't assert-fail in specifiesTypeLoc().

The specifiesTypeLoc() matcher narrows a nestedNameSpecifier matcher based on a
typeloc within the NNS. However, the matcher does not guard against NNS which
are a namespace, and cause getTypeLoc to assert-fail.

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

6 years ago[analyzer] Add method to the generic SMT API to dump the SMT formula
Mikhail R. Gadelha [Sat, 16 Jun 2018 14:36:17 +0000 (14:36 +0000)]
[analyzer] Add method to the generic SMT API to dump the SMT formula

Summary:
New method dump the SMT formula and the Z3 implementation.

There is no test because I only used it for debugging.

However, if requested, I can add an option to the static analyzer to dump the formula (whole program? per path?), maybe something like the trimmed graph but for SMT formulas.

Reviewers: NoQ, george.karpenkov, ddcc

Reviewed By: george.karpenkov

Subscribers: xazax.hun, szepet, a.sidorin

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

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

6 years agoAdd RUN line for amdgcn to lit test conditional-temporaries.cpp
Yaxun Liu [Sat, 16 Jun 2018 12:28:51 +0000 (12:28 +0000)]
Add RUN line for amdgcn to lit test conditional-temporaries.cpp

This is partial re-commit of r332982.

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

6 years agoCall CreateTempAllocaWithoutCast for ActiveFlag
Yaxun Liu [Sat, 16 Jun 2018 01:20:52 +0000 (01:20 +0000)]
Call CreateTempAllocaWithoutCast for ActiveFlag

This is partial re-commit of r332982.

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

6 years ago[docs] -fsanitize=cfi only allowed with -fvisibility=
Fangrui Song [Fri, 15 Jun 2018 23:11:18 +0000 (23:11 +0000)]
[docs] -fsanitize=cfi only allowed with -fvisibility=

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

6 years ago[Modules] Improve .Private fix-its to handle 'explicit' and 'framework'
Bruno Cardoso Lopes [Fri, 15 Jun 2018 20:13:28 +0000 (20:13 +0000)]
[Modules] Improve .Private fix-its to handle 'explicit' and 'framework'

When in the context of suggestion the fix-it from .Private to _Private
for private modules, trim off the 'explicit' and add 'framework' when
appropriate.

rdar://problem/41030554

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

6 years ago[X86] Lowering sqrt intrinsics to native IR
Tomasz Krupa [Fri, 15 Jun 2018 18:05:59 +0000 (18:05 +0000)]
[X86] Lowering sqrt intrinsics to native IR

Reviewers: craig.topper, spatel, RKSimon, igorb, uriel.k

Reviewed By: craig.topper

Subscribers: tkrupa, cfe-commits

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

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

6 years ago[X86] __builtin_ia32_prord512_mask, __builtin_ia32_prorq512_mask, __builtin_ia32_shuf...
Craig Topper [Fri, 15 Jun 2018 17:40:37 +0000 (17:40 +0000)]
[X86] __builtin_ia32_prord512_mask, __builtin_ia32_prorq512_mask, __builtin_ia32_shufpd should only accept an ICE constant.

The rotates also need to check for the immediate to fit in 8-bits. Shufpd already checks its immediate range.

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

6 years ago[X86] The immediate argument to getmantpd*_mask should be an ICE and it should only...
Craig Topper [Fri, 15 Jun 2018 17:03:32 +0000 (17:03 +0000)]
[X86] The immediate argument to getmantpd*_mask should be an ICE and it should only be 4 bits wide.

We already checked this for the scalar version, but missed the vector version somehow.

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

6 years agobpf: recognize target specific option -mattr=dwarfris in clang
Yonghong Song [Fri, 15 Jun 2018 15:53:31 +0000 (15:53 +0000)]
bpf: recognize target specific option -mattr=dwarfris in clang

The following is the usage example with clang:
  bash-4.2$ clang -target bpf -O2 -g -c -Xclang -target-feature -Xclang +dwarfris t.c
  bash-4.2$ llvm-objdump -S -d t.o

  t.o:    file format ELF64-BPF

  Disassembly of section .text:
  test:
  ; int test(void) {
       0:       b7 00 00 00 00 00 00 00         r0 = 0
  ; return 0;
         1:       95 00 00 00 00 00 00 00         exit
  bash-4.2$ cat t.c
  int test(void) {
    return 0;
  }
  bash-4.2$

Signed-off-by: Yonghong Song <yhs@fb.com>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@334839 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[NFC] Add CreateMemTempWithoutCast and CreateTempAllocaWithoutCast
Yaxun Liu [Fri, 15 Jun 2018 15:33:22 +0000 (15:33 +0000)]
[NFC] Add CreateMemTempWithoutCast and CreateTempAllocaWithoutCast

This is partial re-commit of r332982

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

6 years ago[AArch64] Reverted rC334696 with Clang VCVTA test fix
Luke Geeson [Fri, 15 Jun 2018 10:10:45 +0000 (10:10 +0000)]
[AArch64] Reverted  rC334696 with Clang VCVTA test fix

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

6 years ago[ASTImporter] Corrected diagnostic client handling in tests.
Adam Balogh [Fri, 15 Jun 2018 06:45:39 +0000 (06:45 +0000)]
[ASTImporter] Corrected diagnostic client handling in tests.

ASTImporter tests may produce source file related warnings, the diagnostic
client should be in correct state to handle it. Added 'beginSourceFile' to set
the client state.

Patch by: Balázs Kéri

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

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

6 years ago[Format] Do not use a global static value for EOF within ScopedMacroState.
David L. Jones [Fri, 15 Jun 2018 06:08:54 +0000 (06:08 +0000)]
[Format] Do not use a global static value for EOF within ScopedMacroState.

ScopedMacroState injects its own EOF token under certain conditions, and the
returned token may be modified in several different locations. If multiple
reformat operations are started in different threads, then they will both see
the same fake EOF token, and may both try to modify it. This is a data race.

This bug was caught with tsan.

Reviewers: klimek

Subscribers: cfe-commits

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

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

6 years ago[cmake] Add linker detection for Apple platforms
Shoaib Meenai [Thu, 14 Jun 2018 23:26:33 +0000 (23:26 +0000)]
[cmake] Add linker detection for Apple platforms

LLVM currently assumes that Apple platforms will always use ld64. In the
future, LLD Mach-O might also be supported, so add the beginnings of
linker detection support. ld64 is currently the only detected linker,
since `ld64.lld -v` doesn't yield any useful version output, but we can
add that detection later, and in the meantime it's still useful to have
the ld64 identification.

Switch clang's order file check to use this new detection rather than
just checking for the presence of an ld64 executable.

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

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

6 years agoModules: Fix implicit output file for .cppm to .pcm instead of stdout
David Blaikie [Thu, 14 Jun 2018 23:09:06 +0000 (23:09 +0000)]
Modules: Fix implicit output file for .cppm to .pcm instead of stdout

This code was introduced back in r178148, a change to introduce
-module-file-info - which still exists & seems like it's still tested (&
this change didn't cause any of those tests to fail).

It doesn't look like this change was necessary there - since it's about
pcm output, whereas -module-file-info looks like it's for pcm /input/.
So I'm not really sure what the original motivation was.

I'm open to ideas though, if it turns out the original change was
necessary/useful.

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

6 years ago[X86] Rename __builtin_ia32_pslldqi128 to __builtin_ia32_pslldqi128_byteshift and...
Craig Topper [Thu, 14 Jun 2018 22:02:35 +0000 (22:02 +0000)]
[X86] Rename __builtin_ia32_pslldqi128 to __builtin_ia32_pslldqi128_byteshift and similar for other sizes. Remove the multiply by 8 from the header files.

The previous names took the shift amount in bits to match gcc and required a multiply by 8 in the header. This creates a misleading error message when we check the range of the immediate to the builtin since the allowed range also got multiplied by 8.

This commit changes the builtins to use a byte shift amount to match the underlying instruction and the Intel intrinsic.

Fixes the remaining issue from PR37795.

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

6 years ago[c++17] If a class inherits virtual functions from a base class, it is
Richard Smith [Thu, 14 Jun 2018 20:03:22 +0000 (20:03 +0000)]
[c++17] If a class inherits virtual functions from a base class, it is
not an aggregtae.

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

6 years ago[X86] Add inline assembly versions of _InterlockedExchange_HLEAcquire/Release and...
Craig Topper [Thu, 14 Jun 2018 18:43:52 +0000 (18:43 +0000)]
[X86] Add inline assembly versions of _InterlockedExchange_HLEAcquire/Release and _InterlockedCompareExchange_HLEAcquire/Release for MSVC compatibility.

Clang/LLVM doesn't have a way to pass an HLE hint through to the X86 backend to emit HLE prefixed instructions. So this is a good short term fix.

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

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

6 years ago[CMAKE][c-index-test] Honor CMAKE_OSX_SYSROOT to compute include dir for libxml2
Bruno Cardoso Lopes [Thu, 14 Jun 2018 18:20:04 +0000 (18:20 +0000)]
[CMAKE][c-index-test] Honor CMAKE_OSX_SYSROOT to compute include dir for libxml2

On MacOS, if CMAKE_OSX_SYSROOT is used and the user has command line tools
installed, we currently get the include path for libxml2 as
/usr/include/libxml2, instead of ${CMAKE_OSX_SYSROOT}/usr/include/libxml2.

Make it consistent on MacOS by prefixing ${CMAKE_OSX_SYSROOT} when
possible.

rdar://problem/41103601

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

6 years ago[X86] Lowering Mask Scalar intrinsics to native IR (Clang part)
Tomasz Krupa [Thu, 14 Jun 2018 17:36:23 +0000 (17:36 +0000)]
[X86] Lowering Mask Scalar intrinsics to native IR (Clang part)

Summary: Lowering add, sub, mul, and div mask scalar intrinsic calls
to native IR.

Reviewers: craig.topper, RKSimon, spatel, sroland

Reviewed By: craig.topper

Subscribers: cfe-commits

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

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

6 years ago[clang-format] Disable AlwaysBreakBeforeMultilineStrings in Google style for Objectiv...
Ben Hamilton [Thu, 14 Jun 2018 17:30:10 +0000 (17:30 +0000)]
[clang-format] Disable AlwaysBreakBeforeMultilineStrings in Google style for Objective-C 📜

Contributed by @stephanemoore.

Reviewers: benhamilton, jolesiak, djasper

Reviewed By: benhamilton

Subscribers: klimek, cfe-commits

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

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

6 years ago[Fixed Point Arithmetic] Addition of the remaining fixed point types and their satura...
Leonard Chan [Thu, 14 Jun 2018 14:53:51 +0000 (14:53 +0000)]
[Fixed Point Arithmetic] Addition of the remaining fixed point types and their saturated equivalents

This diff includes changes for the remaining _Fract and _Sat fixed point types.

```
signed short _Fract s_short_fract;
signed _Fract s_fract;
signed long _Fract s_long_fract;
unsigned short _Fract u_short_fract;
unsigned _Fract u_fract;
unsigned long _Fract u_long_fract;

// Aliased fixed point types
short _Accum short_accum;
_Accum accum;
long _Accum long_accum;
short _Fract short_fract;
_Fract fract;
long _Fract long_fract;

// Saturated fixed point types
_Sat signed short _Accum sat_s_short_accum;
_Sat signed _Accum sat_s_accum;
_Sat signed long _Accum sat_s_long_accum;
_Sat unsigned short _Accum sat_u_short_accum;
_Sat unsigned _Accum sat_u_accum;
_Sat unsigned long _Accum sat_u_long_accum;
_Sat signed short _Fract sat_s_short_fract;
_Sat signed _Fract sat_s_fract;
_Sat signed long _Fract sat_s_long_fract;
_Sat unsigned short _Fract sat_u_short_fract;
_Sat unsigned _Fract sat_u_fract;
_Sat unsigned long _Fract sat_u_long_fract;

// Aliased saturated fixed point types
_Sat short _Accum sat_short_accum;
_Sat _Accum sat_accum;
_Sat long _Accum sat_long_accum;
_Sat short _Fract sat_short_fract;
_Sat _Fract sat_fract;
_Sat long _Fract sat_long_fract;
```

This diff only allows for declaration of these fixed point types. Assignment and other operations done on fixed point types according to http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1169.pdf will be added in future patches.

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

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

6 years agoclang-format: Fix documentation generation
Francois Ferrand [Thu, 14 Jun 2018 13:32:14 +0000 (13:32 +0000)]
clang-format: Fix documentation generation

Summary:
It seems that the changes done to `ClangFormatStyleOptions.rst` @334408 are causing the generation of the documentation to fail, with the following error:

  Warning, treated as error:
    /llvm/tools/clang/docs/ClangFormatStyleOptions.rst:1060: WARNING: Definition list ends without a blank line; unexpected unindent.

This is due to missing indent in some code block, and fixed by this patch.

Reviewers: krasimir, djasper, klimek

Reviewed By: krasimir

Subscribers: cfe-commits

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

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

6 years ago[OpenCL] Support new/delete in Sema
Sven van Haastregt [Thu, 14 Jun 2018 09:51:54 +0000 (09:51 +0000)]
[OpenCL] Support new/delete in Sema

Reject uses of the default new/delete operators with a diagnostic
instead of a crash in OpenCL C++ mode and accept user-defined forms.

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

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

6 years ago[AArch64] reverting rC334693 due to build failures
Luke Geeson [Thu, 14 Jun 2018 08:59:33 +0000 (08:59 +0000)]
[AArch64] reverting rC334693 due to build failures

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

6 years agoRemoved trunk-Codegen directory added in error
Luke Geeson [Thu, 14 Jun 2018 08:51:52 +0000 (08:51 +0000)]
Removed trunk-Codegen directory added in error

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

6 years ago[AArch64] Added support for the vcvta_u16_f16 instrinsic for FP16 Armv8.2-A
Luke Geeson [Thu, 14 Jun 2018 08:28:56 +0000 (08:28 +0000)]
[AArch64] Added support for the vcvta_u16_f16 instrinsic for FP16 Armv8.2-A

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

6 years ago[clang-format] Add SpaceBeforeCpp11BracedList option.
Hans Wennborg [Thu, 14 Jun 2018 08:01:09 +0000 (08:01 +0000)]
[clang-format] Add SpaceBeforeCpp11BracedList option.

WebKit C++ style for object initialization is as follows:

  Foo foo { bar };

Yet using clang-format -style=webkit changes this to:

  Foo foo{ bar };

As there is no existing combination of rules that will ensure a space
before a braced list in this fashion, this patch adds a new
SpaceBeforeCpp11BracedList rule.

Patch by Ross Kirsling!

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

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

6 years ago[analyzer] Re-enable C++17-specific RVO construction contexts.
Artem Dergachev [Thu, 14 Jun 2018 01:59:35 +0000 (01:59 +0000)]
[analyzer] Re-enable C++17-specific RVO construction contexts.

Not contexts themselves, but rather support for them in the analyzer.

Such construction contexts appear when C++17 mandatory copy elision occurs
while returning an object from a function, and presence of a destructor causes
a CXXBindTemporaryExpr to appear in the AST.

Additionally, such construction contexts may be chained, because a return-value
construction context doesn't really explain where the object is being returned
into, but only points to the parent stack frame, where the object may be
consumed by literally anything including another return statement. This
behavior is now modeled correctly by the analyzer as long as the object is not
returned beyond the boundaries of the analysis.

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

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

6 years ago[analyzer] Re-enable C++17-specific variable and member construction contexts.
Artem Dergachev [Thu, 14 Jun 2018 01:54:21 +0000 (01:54 +0000)]
[analyzer] Re-enable C++17-specific variable and member construction contexts.

Not contexts themselves, but rather support for them in the analyzer.

Such construction contexts appear when C++17 mandatory copy elision occurs
during initialization, and presence of a destructor causes a
CXXBindTemporaryExpr to appear in the AST.

Similar C++17-specific constructors for return values are still to be supported.

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

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

6 years ago[analyzer] Track class member initializer constructors path-sensitively.
Artem Dergachev [Thu, 14 Jun 2018 01:40:49 +0000 (01:40 +0000)]
[analyzer] Track class member initializer constructors path-sensitively.

The reasoning behind this change is similar to the previous commit, r334681.
Because members are already in scope when construction occurs, we are not
suffering from liveness problems, but we still want to figure out if the object
was constructed with construction context, because in this case we'll be able
to avoid trivial copy, which we don't always model perfectly. It'd also have
more importance when copy elision is implemented.

This also gets rid of the old CFG look-behind mechanism.

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

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

6 years ago[analyzer] pr37270: Track constructor target region, even if just a variable.
Artem Dergachev [Thu, 14 Jun 2018 01:32:46 +0000 (01:32 +0000)]
[analyzer] pr37270: Track constructor target region, even if just a variable.

The very idea of construction context implies that first the object is
constructed, and then later, in a separate moment of time, the constructed
object goes into scope, i.e. becomes "live".

Most construction contexts require path-sensitive tracking of the constructed
object region in order to compute the outer expressions accordingly before
the object becomes live.

Semantics of simple variable construction contexts don't immediately require
that such tracking happens in path-sensitive manner, but shortcomings of the
analyzer force us to track it path-sensitively as well. Namely, whether
construction context was available at all during construction is a
path-sensitive information. Additionally, path-sensitive tracking takes care of
our liveness problems that kick in as the temporal gap between construction and
going-into-scope becomes larger (eg., due to copy elision).

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

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

6 years ago[analyzer] NFC: Merge code for finding and tracking construction target.
Artem Dergachev [Thu, 14 Jun 2018 01:20:12 +0000 (01:20 +0000)]
[analyzer] NFC: Merge code for finding and tracking construction target.

When analyzing C++ code, a common operation in the analyzer is to discover
target region for object construction by looking at CFG metadata ("construction
contexts"), and then track the region path-sensitively until object construction
is resolved, where the amount of information, again, depends on construction
context.

Scan construction context only once for both purposes.

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

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

6 years agoP0096R5, P0941R2: Update to match latest feature test macro specification.
Richard Smith [Thu, 14 Jun 2018 00:40:20 +0000 (00:40 +0000)]
P0096R5, P0941R2: Update to match latest feature test macro specification.

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

6 years ago[www] Update cxx_status page for Rapperswil motions.
Richard Smith [Thu, 14 Jun 2018 00:05:28 +0000 (00:05 +0000)]
[www] Update cxx_status page for Rapperswil motions.

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

6 years agoDriver: De-duplicate some code. NFCI.
Peter Collingbourne [Thu, 14 Jun 2018 00:03:41 +0000 (00:03 +0000)]
Driver: De-duplicate some code. NFCI.

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

6 years agodocs: Add a missing LTO visibility reference.
Peter Collingbourne [Wed, 13 Jun 2018 23:21:02 +0000 (23:21 +0000)]
docs: Add a missing LTO visibility reference.

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

6 years agodocs: Correct some misstatements in the control flow integrity docs.
Peter Collingbourne [Wed, 13 Jun 2018 23:18:26 +0000 (23:18 +0000)]
docs: Correct some misstatements in the control flow integrity docs.

These were true at one point but haven't been true for a long time.

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

6 years agoSimplify test from r334650
Erich Keane [Wed, 13 Jun 2018 20:47:12 +0000 (20:47 +0000)]
Simplify test from r334650

No reason to have the 'bool' as an intermediary value,
simply use the fact that curley braces enforce eval order.

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

6 years agoImplement constexpr __builtin_*_overflow
Erich Keane [Wed, 13 Jun 2018 20:43:27 +0000 (20:43 +0000)]
Implement constexpr __builtin_*_overflow

As requested here:https://bugs.llvm.org/show_bug.cgi?id=37633
permit the __builtin_*_overflow builtins in constexpr functions.

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

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

6 years ago[COFF] Add ARM64 intrinsics: __yield, __wfe, __wfi, __sev, __sevl
Mandeep Singh Grang [Wed, 13 Jun 2018 18:49:35 +0000 (18:49 +0000)]
[COFF] Add ARM64 intrinsics: __yield, __wfe, __wfi, __sev, __sevl

Summary: These intrinsics result in hint instructions. They are provided here for MSVC ARM64 compatibility.

Reviewers: mstorsjo, compnerd, javed.absar

Reviewed By: mstorsjo

Subscribers: kristof.beyls, chrib, cfe-commits

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

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

6 years ago[analyzer] Fix offset overflow check in MemRegion
George Karpenkov [Wed, 13 Jun 2018 18:32:19 +0000 (18:32 +0000)]
[analyzer] Fix offset overflow check in MemRegion

rdar://39593879
https://bugs.llvm.org/show_bug.cgi?id=37142

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

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

6 years ago[CodeGen] make nan builtins pure rather than const (PR37778)
Sanjay Patel [Wed, 13 Jun 2018 17:54:52 +0000 (17:54 +0000)]
[CodeGen] make nan builtins pure rather than const (PR37778)

https://bugs.llvm.org/show_bug.cgi?id=37778
...shows a miscompile resulting from marking nan builtins as 'const'.

The nan libcalls/builtins take a pointer argument:
http://www.cplusplus.com/reference/cmath/nan-function/
...and the chars dereferenced by that arg are used to fill in the NaN constant payload bits.

"const" means that the pointer argument isn't dereferenced. That's translated to "readnone" in LLVM.
"pure" means that the pointer argument may be dereferenced. That's translated to "readonly" in LLVM.

This change prevents the IR optimizer from killing the lead-up to the nan call here:

double a() {
  char buf[4];
  buf[0] = buf[1] = buf[2] = '9';
  buf[3] = '\0';
  return __builtin_nan(buf);
}

...the optimizer isn't currently able to simplify this to a constant as we might hope,
but this patch should solve the miscompile.

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

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

6 years ago[Basic] Fix -Wreorder warning
Benjamin Kramer [Wed, 13 Jun 2018 16:45:12 +0000 (16:45 +0000)]
[Basic] Fix -Wreorder warning

Just use field initializers that don't suffer from this problem

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

6 years ago[PowerPC] The __float128 type should only be available on Power9
Stefan Pintilie [Wed, 13 Jun 2018 16:05:05 +0000 (16:05 +0000)]
[PowerPC] The __float128 type should only be available on Power9

Diasble the use of the type __float128 for PPC machines older
than Power9.

The use of -mfloat128 for PPC machine older than Power9 will result
in an error.

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

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

6 years ago[libclang] Make c-index-test.c ISO C90 compliant.
Matt Morehouse [Wed, 13 Jun 2018 16:00:39 +0000 (16:00 +0000)]
[libclang] Make c-index-test.c ISO C90 compliant.

Fixes a build bot breakage caused by r334593.

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

6 years agoAdd -fforce-emit-vtables
Piotr Padlewski [Wed, 13 Jun 2018 13:55:42 +0000 (13:55 +0000)]
Add -fforce-emit-vtables

Summary:
 In many cases we can't devirtualize
 because definition of vtable is not present. Most of the
 time it is caused by inline virtual function not beeing
 emitted. Forcing emitting of vtable adds a reference of these
 inline virtual functions.
 Note that GCC was always doing it.

Reviewers: rjmccall, rsmith, amharc, kuhar

Subscribers: llvm-commits, cfe-commits

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

Co-authored-by: Krzysztof Pszeniczny <krzysztof.pszeniczny@gmail.com>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@334600 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoCorrect behavior of __builtin_*_overflow and constexpr.
Erich Keane [Wed, 13 Jun 2018 13:25:11 +0000 (13:25 +0000)]
Correct behavior of __builtin_*_overflow and constexpr.

Enable these builtins to be called across a lambda
boundary with captureless const/constexpr, as brought up by
Eli here: https://reviews.llvm.org/D48040

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

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

6 years ago[libclang] Optionally add code completion results for arrow instead of dot
Ivan Donchevskii [Wed, 13 Jun 2018 12:37:08 +0000 (12:37 +0000)]
[libclang] Optionally add code completion results for arrow instead of dot

Follow up for D41537 - libclang part.

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

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

6 years ago[X86] Remove masking from avx512vbmi2 concat and shift by immediate builtins. Use...
Craig Topper [Wed, 13 Jun 2018 07:19:28 +0000 (07:19 +0000)]
[X86] Remove masking from avx512vbmi2 concat and shift by immediate builtins. Use select builtins instead.

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

6 years agocrash-report-modules.m: Shorten path length to make Windows bot happy
Hans Wennborg [Wed, 13 Jun 2018 06:48:40 +0000 (06:48 +0000)]
crash-report-modules.m: Shorten path length to make Windows bot happy

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

6 years agoRemove extraneous semicolon.
Bill Wendling [Wed, 13 Jun 2018 06:33:59 +0000 (06:33 +0000)]
Remove extraneous semicolon.

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

6 years ago[Sema] When the address of a member function is used as a template
Akira Hatanaka [Wed, 13 Jun 2018 05:26:23 +0000 (05:26 +0000)]
[Sema] When the address of a member function is used as a template
argument, use the context in which it is used for checking its
accessibility.

This fixes PR32898.

rdar://problem/33737747

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

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

6 years agoFix crash emitting transparent list initializer for a large aggregate.
Richard Smith [Wed, 13 Jun 2018 02:06:28 +0000 (02:06 +0000)]
Fix crash emitting transparent list initializer for a large aggregate.

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

6 years ago[CUDA][HIP] Allow CUDA __global__ functions to have amdgpu kernel attributes
Yaxun Liu [Tue, 12 Jun 2018 23:58:59 +0000 (23:58 +0000)]
[CUDA][HIP] Allow CUDA __global__ functions to have amdgpu kernel attributes

There are HIP applications e.g. Tensorflow 1.3 using amdgpu kernel attributes, however
currently they are only allowed on OpenCL kernel functions.

This patch will allow amdgpu kernel attributes to be applied to CUDA/HIP __global__
functions.

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

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

6 years ago[analyzer] Do not crash in the visitor when the function is given more arguments...
George Karpenkov [Tue, 12 Jun 2018 23:53:54 +0000 (23:53 +0000)]
[analyzer] Do not crash in the visitor when the function is given more arguments than it has parameters

rdar://40335545

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

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

6 years ago[analyzer] Ensure that loop widening does not invalidate references
Matthew Voss [Tue, 12 Jun 2018 22:22:35 +0000 (22:22 +0000)]
[analyzer] Ensure that loop widening does not invalidate references

Loop widening can invalidate a reference. If the analyzer attempts to visit the
destructor to a non-existent reference, it will crash. This patch ensures that
the reference is preserved.

https://reviews.llvm.org/D47044

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

6 years ago[CMake][Darwin] Match cxx-headers -> cxx_headers libcxx target rename.
Ahmed Bougacha [Tue, 12 Jun 2018 21:27:36 +0000 (21:27 +0000)]
[CMake][Darwin] Match cxx-headers -> cxx_headers libcxx target rename.

This was changed in r334477.

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

6 years ago[analyzer] [NFC] Remove "removeInvalidation" from visitor API
George Karpenkov [Tue, 12 Jun 2018 20:51:19 +0000 (20:51 +0000)]
[analyzer] [NFC] Remove "removeInvalidation" from visitor API

removeInvalidation is a very problematic API, as it makes suppression
order-dependent.
Moreover, it was used only once, and could be rewritten in a much
cleaner way.

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

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

6 years ago[analyzer] [NFC] Move ::dump methods from BugReporter.cpp to PathDiagnostics.cpp
George Karpenkov [Tue, 12 Jun 2018 20:51:01 +0000 (20:51 +0000)]
[analyzer] [NFC] Move ::dump methods from BugReporter.cpp to PathDiagnostics.cpp

BugReporter.cpp is already severely overloaded, and those dump methods
are on PathDiagnostics and should belong in the corresponding
implementation file.

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

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

6 years ago[analyzer] [NFC] Remove most usages of getEndPath
George Karpenkov [Tue, 12 Jun 2018 20:50:44 +0000 (20:50 +0000)]
[analyzer] [NFC] Remove most usages of getEndPath

getEndPath is a problematic API, because it's not clear when it's called
(hint: not always at the end of the path), it crashes at runtime with
more than one non-nullptr returning implementation, and diagnostics
internal depend on it being called at some exact place.

However, most visitors don't actually need that: all they want is a
function consistently called after all nodes are traversed, to perform
finalization and to decide whether invalidation is needed.

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

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

6 years agoWork around false -Wmissing-braces warning from old clang which has been fixed in...
Fangrui Song [Tue, 12 Jun 2018 20:44:11 +0000 (20:44 +0000)]
Work around false -Wmissing-braces warning from old clang which has been fixed in r314838

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

6 years ago[AArch64] Support reserving x20 register
Petr Hosek [Tue, 12 Jun 2018 20:00:50 +0000 (20:00 +0000)]
[AArch64] Support reserving x20 register

Register x20 is a callee-saved register which may be used for other
purposes in certain contexts, for example to hold special variables
within the kernel. This change adds support for reserving this register
both to frontend and backend to make this register usable for these
purposes.

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

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

6 years ago[clang-format] Fix crash while reflowing backslash in comments
Krasimir Georgiev [Tue, 12 Jun 2018 19:33:15 +0000 (19:33 +0000)]
[clang-format] Fix crash while reflowing backslash in comments

Summary:
The added test case was currently crashing with an assertion:
```
krasimir@krasimir> cat test.cc                                                                                                                                                              ~
// How to run:
// bbbbb run \
// rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr \
// <log_file> -- --output_directory="<output_directory>"
krasimir@krasimir> ~/work/llvm-build/bin/clang-format test.cc                                                                                                                               ~
clang-format: /usr/local/google/home/krasimir/work/llvm/tools/clang/lib/Format/WhitespaceManager.cpp:117: void clang::format::WhitespaceManager::calculateLineBreakInformation(): Assertion `PreviousOriginalWhitespaceEndOffset <= OriginalWhitespaceStartOffset' failed.
```
The root cause was that BreakableToken was not considering the case of a reflow between an unescaped newline in a line comment.

Subscribers: cfe-commits

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

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

6 years ago[analyzer] [NFC] Now let's have only one place for diagnostics generation
George Karpenkov [Tue, 12 Jun 2018 19:08:17 +0000 (19:08 +0000)]
[analyzer] [NFC] Now let's have only one place for diagnostics generation

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

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

6 years ago[analyzer] [NFC] Unify Minimal and Extensive diagnostics.
George Karpenkov [Tue, 12 Jun 2018 19:08:00 +0000 (19:08 +0000)]
[analyzer] [NFC] Unify Minimal and Extensive diagnostics.

Once we removed AlternateExtensive, I've looked closer into the
difference between Minimal and Extensive, and turns out, the difference
was not that large.

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

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

6 years ago[analyzer] [NFC] Remove unused Extensive diagnostic setting,
George Karpenkov [Tue, 12 Jun 2018 19:07:41 +0000 (19:07 +0000)]
[analyzer] [NFC] Remove unused Extensive diagnostic setting,

Rename AlternateExtensive to Extensive.
In 2013, five years ago, we have switched to AlternateExtensive
diagnostics by default, and Extensive was available under unused,
undocumented flag.
This change remove the flag, renames the Alternate
diagnostic to Extensive (as it's no longer Alternate), and ports the
test.

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

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

6 years agoRefactor ExecuteAndWait to take StringRefs.
Zachary Turner [Tue, 12 Jun 2018 17:43:52 +0000 (17:43 +0000)]
Refactor ExecuteAndWait to take StringRefs.

This simplifies some code which had StringRefs to begin with, and
makes other code more complicated which had const char* to begin
with.

In the end, I think this makes for a more idiomatic and platform
agnostic API.  Not all platforms launch process with null terminated
c-string arrays for the environment pointer and argv, but the api
was designed that way because it allowed easy pass-through for
posix-based platforms.  There's a little additional overhead now
since on posix based platforms we'll be takign StringRefs which
were constructed from null terminated strings and then copying
them to null terminate them again, but from a readability and
usability standpoint of the API user, I think this API signature
is strictly better.

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

6 years ago[clang-format] Discourage breaks in submessage entries, hard rule
Krasimir Georgiev [Tue, 12 Jun 2018 17:26:31 +0000 (17:26 +0000)]
[clang-format] Discourage breaks in submessage entries, hard rule

Summary:
Currently clang-format allows this for text protos:
```
submessage:
    { key: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' }
```
when it is under the column limit and when putting it all on one line exceeds the column limit.

This is not a very intuitive formatting, so I'd prefer having
```
submessage: {
  key: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
}
```
instead, even if it takes one line more.

This patch prevents clang-format from inserting a break between `: {` and similar cases.

Reviewers: djasper, sammccall

Reviewed By: sammccall

Subscribers: cfe-commits

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

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

6 years agoFix overload resolution between Ptr-To-Member and Bool
Erich Keane [Tue, 12 Jun 2018 13:59:32 +0000 (13:59 +0000)]
Fix overload resolution between Ptr-To-Member and Bool

As reported here (https://bugs.llvm.org/show_bug.cgi?id=19808)
and discovered independently when looking at plum-hall tests,
we incorrectly implemented over.ics.rank, which says "A conversion
that is not a conversion of a pointer, or pointer to member, to bool
is better than another conversion that is such a conversion.".

In the current Draft (N4750), this is phrased slightly differently in
paragraph 4.1: A conversion that does not convert a pointer, a pointer
to member, or std::nullptr_t to bool is better than one that does.

The comment on isPointerConversionToBool (the changed function)
also confirms that this is the case (note outdated reference):
isPointerConversionToBool - Determines whether this conversion is
a conversion of a pointer or pointer-to-member to bool. This is
used as part of the ranking of standard conversion sequences
(C++ 13.3.3.2p4).

However, despite this comment, it didn't check isMemberPointerType
on the 'FromType', presumably incorrectly assuming that 'isPointerType'
matched it.  This patch fixes this by adding isMemberPointerType to
this function. Additionally, member function pointers are just
MemberPointerTypes that point to functions insted of data, so that
is fixed in this patch as well.

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

6 years agoRe-apply r334418 "Enable crash recovery tests on Windows, globs work in the lit inter...
Hans Wennborg [Tue, 12 Jun 2018 11:51:22 +0000 (11:51 +0000)]
Re-apply r334418 "Enable crash recovery tests on Windows, globs work in the lit internal shell now"

Plus change run lines from

  not env FOO=bar %clang

to

  env FOO=bar not %clang

To not confuse the internal shell.

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

6 years agoRevert r334418 "Enable crash recovery tests on Windows, globs work in the lit interna...
Hans Wennborg [Tue, 12 Jun 2018 11:33:44 +0000 (11:33 +0000)]
Revert r334418 "Enable crash recovery tests on Windows, globs work in the lit internal shell now"

The tests fail on Windows bots, and for me locally.

> Enable crash recovery tests on Windows, globs work in the lit internal shell now

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

6 years ago[AArch64] Corrected FP16 Intrinsic range checks in Clang + added Sema tests
Luke Geeson [Tue, 12 Jun 2018 09:54:27 +0000 (09:54 +0000)]
[AArch64] Corrected FP16 Intrinsic range checks in Clang + added Sema tests

Summary:
This fixes the ranges for the vcvth family of FP16 intrinsics in the clang front end. Previously it was accepting incorrect ranges
-Changed builtin range checking in SemaChecking
-added tests SemaCheck changes - included in  their own file since no similar one exists
-modified existing tests to reflect new ranges

Reviewers: SjoerdMeijer, javed.absar

Reviewed By: SjoerdMeijer

Subscribers: kristof.beyls, cfe-commits

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

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

6 years agoFix that AlignedAllocation.h doesn't compile because of VersionTuple
Raphael Isemann [Tue, 12 Jun 2018 03:43:21 +0000 (03:43 +0000)]
Fix that AlignedAllocation.h doesn't compile because of VersionTuple

Summary:
 rL334399 put VersionTuple in the llvm namespace, but this header still assumes it's in the clang namespace.
This leads to compilation failures with enabled modules when building Clang.

Subscribers: cfe-commits

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

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

6 years ago[CUDA][HIP] Set kernel calling convention before arrange function
Yaxun Liu [Tue, 12 Jun 2018 00:16:33 +0000 (00:16 +0000)]
[CUDA][HIP] Set kernel calling convention before arrange function

Currently clang set kernel calling convention for CUDA/HIP after
arranging function, which causes incorrect kernel function type since
it depends on calling convention.

This patch moves setting kernel convention before arranging
function.

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

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

6 years ago[CMake] Use libc++ and compiler-rt for bootstrap Fuchsia Clang
Petr Hosek [Mon, 11 Jun 2018 22:06:44 +0000 (22:06 +0000)]
[CMake] Use libc++ and compiler-rt for bootstrap Fuchsia Clang

We want to build the second stage compiler with libc++ and compiler-rt,
also include builtins and runtimes into extra bootstrap components to
ensure these get built.

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

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

6 years ago[CMake] Allow specifying extra dependencies of bootstrap stage
Petr Hosek [Mon, 11 Jun 2018 20:59:31 +0000 (20:59 +0000)]
[CMake] Allow specifying extra dependencies of bootstrap stage

This allows adding additional bootstrap dependencies to the bootstrap
compiler that may be needed by later stages.

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

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

6 years ago[X86] Fix operand order in the shuffle created for blend builtins.
Craig Topper [Mon, 11 Jun 2018 17:06:01 +0000 (17:06 +0000)]
[X86] Fix operand order in the shuffle created for blend builtins.

This was broken when the builtin was added in r334249.

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

6 years ago[clang-fuzzer] Modified protobuf and converter to add new signature, remove conditionals.
Matt Morehouse [Mon, 11 Jun 2018 17:05:45 +0000 (17:05 +0000)]
[clang-fuzzer] Modified protobuf and converter to add new signature, remove conditionals.

Changed the function signature and removed conditionals from loop body.

Patch By:  emmettneyman

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

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

6 years agoEnable crash recovery tests on Windows, globs work in the lit internal shell now
Reid Kleckner [Mon, 11 Jun 2018 16:50:07 +0000 (16:50 +0000)]
Enable crash recovery tests on Windows, globs work in the lit internal shell now

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

6 years ago[MS] Use mangled names and comdats for string merging with ASan
Reid Kleckner [Mon, 11 Jun 2018 16:49:43 +0000 (16:49 +0000)]
[MS] Use mangled names and comdats for string merging with ASan

This should reduce the binary size penalty of ASan on Windows. After
r334313, ASan will add red zones to globals in comdats, so we will still
find OOB accesses to string literals.

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

6 years ago[X86] Properly account for the immediate being multiplied by 8 in the immediate range...
Craig Topper [Mon, 11 Jun 2018 16:34:10 +0000 (16:34 +0000)]
[X86] Properly account for the immediate being multiplied by 8 in the immediate range checking for BI__builtin_ia32_psrldqi128 and friends.

The limit was set to 1023 which only up to 127*8. It needs to be 2047 to allow 255*8.

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

6 years agoclang-format: [JS] strict prop init annotation.
Martin Probst [Mon, 11 Jun 2018 16:20:13 +0000 (16:20 +0000)]
clang-format: [JS] strict prop init annotation.

Summary:
TypeScript uses the `!` token for strict property initialization
assertions, as in:

    class X {
      strictPropAsserted!: string;
    }

Previously, clang-format would wrap between the `!` and the `:` for
overly long lines. This patch fixes that by generally preventing the
wrap in that location.

Reviewers: krasimir

Subscribers: cfe-commits

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

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

6 years ago[Driver] Add aliases for -Qn/-Qy
Mikhail Maltsev [Mon, 11 Jun 2018 16:10:06 +0000 (16:10 +0000)]
[Driver] Add aliases for -Qn/-Qy

This patch adds aliases for -Qn (-fno-ident) and -Qy (-fident) which
look less cryptic than -Qn/-Qy. The aliases are compatible with GCC.

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

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

6 years agoclang-format: Introduce BreakInheritanceList option
Francois Ferrand [Mon, 11 Jun 2018 14:41:26 +0000 (14:41 +0000)]
clang-format: Introduce BreakInheritanceList option

Summary:
This option replaces the BreakBeforeInheritanceComma option with an
enum, thus introducing a mode where the colon stays on the same line as
constructor declaration:

  // When it fits on line:
  class A : public B, public C {
    ...
  };

  // When it does not fit:
  class A :
      public B,
      public C {
    ...
  };

This matches the behavior of the `BreakConstructorInitializers` option,
introduced in https://reviews.llvm.org/D32479.

Reviewers: djasper, klimek

Reviewed By: djasper

Subscribers: mzeren-vmw, cfe-commits

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

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

6 years ago[clang-format] text protos: put entries on separate lines if there is a submessage
Krasimir Georgiev [Mon, 11 Jun 2018 12:53:25 +0000 (12:53 +0000)]
[clang-format] text protos: put entries on separate lines if there is a submessage

Summary:
This patch updates clang-format text protos to put entries of a submessage into separate lines if the submessage contains at least two entries and contains at least one submessage entry.

For example, the entries here are kept on separate lines even if putting them on a single line would be under the column limit:
```
message: {
  entry: 1
  submessage: { key: value }
}
```

Messages containing a single submessage or several scalar entries can still be put on one line if they fit:
```
message { submessage { key: value } }
message { x: 1 y: 2 z: 3 }
```

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: klimek, cfe-commits

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

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

6 years agoMove VersionTuple from clang/Basic to llvm/Support
Pavel Labath [Mon, 11 Jun 2018 10:28:04 +0000 (10:28 +0000)]
Move VersionTuple from clang/Basic to llvm/Support

Summary:
This kind of functionality is useful to other project apart from clang.
LLDB works with version numbers a lot, but it does not have a convenient
abstraction for this. Moving this class to a lower level library allows
it to be freely used within LLDB.

Since this class is used in a lot of places in clang, and it used to be
in the clang namespace, it seemed appropriate to add it to the list of
adopted classes in LLVM.h to avoid prefixing all uses with "llvm::".

Also, I didn't find any tests specific for this class, so I wrote a
couple of quick ones for the more interesting bits of functionality.

Reviewers: zturner, erik.pilkington

Subscribers: mgorny, cfe-commits, llvm-commits

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

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

6 years ago[MS ABI] Mangle unnamed empty enums (PR37723)
Hans Wennborg [Mon, 11 Jun 2018 06:54:23 +0000 (06:54 +0000)]
[MS ABI] Mangle unnamed empty enums (PR37723)

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

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

6 years ago[X86] Remove masking from dbpsadbw builtins, use select builtin instead.
Craig Topper [Mon, 11 Jun 2018 06:18:29 +0000 (06:18 +0000)]
[X86] Remove masking from dbpsadbw builtins, use select builtin instead.

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

6 years ago[X86] Use target independent masked expandload and compressstore intrinsics to implem...
Craig Topper [Sun, 10 Jun 2018 17:27:05 +0000 (17:27 +0000)]
[X86] Use target independent masked expandload and compressstore intrinsics to implement expandload/compressstore builtins.

Summary: We've had these target independent intrinsics for at least a year and a half. Looks like they do exactly what we need here and the backend already supports them.

Reviewers: RKSimon, delena, spatel, GBuella

Reviewed By: RKSimon

Subscribers: cfe-commits, llvm-commits

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

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

6 years ago[NEON] Support VST1xN intrinsics in AArch32 mode (Clang part)
Ivan A. Kosarev [Sun, 10 Jun 2018 09:28:10 +0000 (09:28 +0000)]
[NEON] Support VST1xN intrinsics in AArch32 mode (Clang part)

We currently support them only in AArch64. The NEON Reference,
however, says they are 'ARMv7, ARMv8' intrinsics.

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

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

6 years ago[X86] Remove masking from the 512-bit packed floating point add/sub/mul/div builtins...
Craig Topper [Sun, 10 Jun 2018 06:01:42 +0000 (06:01 +0000)]
[X86] Remove masking from the 512-bit packed floating point add/sub/mul/div builtins. Use select in IR instead.

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

6 years ago[analyzer] Clean up the program state map of DanglingInternalBufferChecker.
Reka Kovacs [Sat, 9 Jun 2018 21:08:27 +0000 (21:08 +0000)]
[analyzer] Clean up the program state map of DanglingInternalBufferChecker.

Symbols are cleaned up from the program state map when they go out of scope.
Memory regions are cleaned up when the corresponding object is destroyed, and
additionally in 'checkDeadSymbols' in case destructor modeling was incomplete.

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

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

6 years ago[analyzer] Add dangling internal buffer check.
Reka Kovacs [Sat, 9 Jun 2018 13:03:49 +0000 (13:03 +0000)]
[analyzer] Add dangling internal buffer check.

This check will mark raw pointers to C++ standard library container internal
buffers 'released' when the objects themselves are destroyed. Such information
can be used by MallocChecker to warn about use-after-free problems.

In this first version, 'std::basic_string's are supported.

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

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

6 years agoUse SmallPtrSet instead of SmallSet in places where we iterate over the set.
Craig Topper [Sat, 9 Jun 2018 00:30:45 +0000 (00:30 +0000)]
Use SmallPtrSet instead of SmallSet in places where we iterate over the set.

SmallSet forwards to SmallPtrSet for pointer types. SmallPtrSet supports iteration, but a normal SmallSet doesn't. So if it wasn't for the forwarding, this wouldn't work.

These places were found by hiding the begin/end methods in the SmallSet forwarding.

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

6 years ago[X86] Add avx512 feature flags to __builtin_ia32_select*.
Craig Topper [Fri, 8 Jun 2018 22:19:42 +0000 (22:19 +0000)]
[X86] Add avx512 feature flags to __builtin_ia32_select*.

There are many masked intrinsics that just wrap a select around a legacy intrinsic from a pre-avx512 instruciton set. If that intrinsic is implemented as a macro, nothing prevents it from being used when only the older feature was enabled. This likely generates very poor code since we don't have a good way to convert from the scalar masked type used by the intrinsic into a vector control for a legacy blend instruction. If we even have a blend instruction to use.

By adding a feature to the select builtins we can prevent and diagnose misuse of these intrinsics.

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

6 years ago[X86] Add back some masked vector truncate builtins. Custom IRgen a a few others.
Craig Topper [Fri, 8 Jun 2018 21:50:08 +0000 (21:50 +0000)]
[X86] Add back some masked vector truncate builtins. Custom IRgen a a few others.

I'd like to make the select builtins require an avx512f, avx512bw, or avx512vl fature to match what is normally required to get masking. Truncate is special in that there are instructions with a 128/256-bit masked result even without avx512vl.

By using special buitlins we can emit a select without using the 128/256-bit select builtins.

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

6 years ago[X86] Fold masking into subvector extract builtins.
Craig Topper [Fri, 8 Jun 2018 21:50:07 +0000 (21:50 +0000)]
[X86] Fold masking into subvector extract builtins.

I'm looking into making the select builtins require avx512f, avx512bw, or avx512vl since masking operations generally require those features.

The extract builtins are funny because the 512-bit versions return a 128 or 256 bit vector with masking even when avx512vl is not supported.

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

6 years ago[X86] Add builtins for vpermq/vpermpd instructions to enable target feature checking.
Craig Topper [Fri, 8 Jun 2018 18:00:25 +0000 (18:00 +0000)]
[X86] Add builtins for vpermq/vpermpd instructions to enable target feature checking.

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